[Piglit] [PATCH] gles1: add tests for GL_OES_draw_texture

Chia-I Wu olvaffe at gmail.com
Fri Sep 16 05:50:38 PDT 2011


Sorry for the slow response.

On Tue, Sep 13, 2011 at 11:12 PM, Ian Romanick <idr at freedesktop.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 09/11/2011 01:21 AM, Chia-I Wu wrote:
>> If there are conventions I should follow or piglitutil functions
>> that I should use, please let me know.
>
> I think the test code should live in tests/spec/oes_draw_texture.
Even the extension is GLESv1-specific?  Just want to double confirm
before making the change.
>> This should be the first GLESv1 tests.  Not sure whether it should
>> be in all.tests, or where it should be in all.tests.  Suggestions
>> are appreciated.
>
> Putting it in all.tests probably won't work.  Many people won't have
> the ES1 library installed, so these tests would erroneously show up as
> failing.  I think the ES1 tests (and ES2 tests when we have them)
> should be in their own all_es1.tests.
Ok.
> Other than that issue and one comment below, this looks like a good,
> basic test.
>
>> --- tests/gles1/CMakeLists.gles1.txt |    4 +
>> tests/gles1/draw-tex.c           |  237
>> ++++++++++++++++++++++++++++++++++++++ 2 files changed, 241
>> insertions(+), 0 deletions(-) create mode 100644
>> tests/gles1/draw-tex.c
>>
>> diff --git a/tests/gles1/CMakeLists.gles1.txt
>> b/tests/gles1/CMakeLists.gles1.txt index e78b487..ddcbd57 100644
>> --- a/tests/gles1/CMakeLists.gles1.txt +++
>> b/tests/gles1/CMakeLists.gles1.txt @@ -12,4 +12,8 @@
>> link_libraries( piglitutil_gles1 )
>>
>> +add_executable(draw-tex +    draw-tex.c +    ) + # vim: ft=cmake: diff
>> --git a/tests/gles1/draw-tex.c b/tests/gles1/draw-tex.c new file
>> mode 100644 index 0000000..6c5da1a --- /dev/null +++
>> b/tests/gles1/draw-tex.c @@ -0,0 +1,237 @@ +/* + * Copyright © 2011
>> LunarG, Inc. + * + * Permission is hereby granted, free of charge,
>> to any person obtaining a + * copy of this software and associated
>> documentation files (the "Software"), + * to deal in the Software
>> without restriction, including without limitation + * the rights to
>> use, copy, modify, merge, publish, distribute, sublicense, + *
>> and/or sell copies of the Software, and to permit persons to whom
>> the + * Software is furnished to do so, subject to the following
>> conditions: + * + * The above copyright notice and this permission
>> notice (including the next + * paragraph) shall be included in all
>> copies or substantial portions of the + * Software. + * + * THE
>> SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
>> OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
>> MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND
>> NONINFRINGEMENT.  IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT
>> HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY,
>> WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + *
>> FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
>> DEALINGS + * IN THE SOFTWARE. + * + * Author: Chia-I Wu
>> <olv at lunarg.com> + */ + +/** @file draw-tex.c + * + * Test
>> GL_OES_draw_texture. + */ + +#include <EGL/egl.h> + +#include
>> "piglit-util.h" + +#define TEXTURE_SIZE 2 + +int piglit_width =
>> 100, piglit_height = 100; +int piglit_window_mode = GLUT_RGB |
>> GLUT_ALPHA | GLUT_DEPTH | GLUT_DOUBLE; + +/* see
>> piglit_rgbw_texture */ +static const float red[4] =   { 1.0f, 0.0f,
>> 0.0f, 0.0f }; +static const float green[4] = { 0.0f, 1.0f, 0.0f,
>> 0.25f }; +static const float blue[4] =  { 0.0f, 0.0f, 1.0f, 0.50f
>> }; +static const float white[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; +
>> +static PFNGLDRAWTEXIOESPROC glDrawTexiOES;
>
> Doing this is a bad, bad, bad idea.  You shouldn't have
>
> int (*printf)(const char *format, ...);
>
> in a program and expect things to not explode, would you?  GLEW gets
> around this by naming things glew_FunctionPtr and wrapping it with a
> marco.  The piglit function pointers are usually named
> piglit_Function.  I'd recommend calling this piglit_DrawTexiOES.
You are right.  Will do.


-- 
olv at LunarG.com


More information about the Piglit mailing list