[Piglit] [PATCH] Add a test for EXT_texture_swizzle and DEPTH_TEXTURE_MODE together.

Kenneth Graunke kenneth at whitecape.org
Fri Sep 21 11:00:35 PDT 2012


On 09/21/2012 08:41 AM, Brian Paul wrote:
> On 09/21/2012 03:47 AM, Kenneth Graunke wrote:
[snip]
>> +#define Elements(x) (sizeof(x)/sizeof(*(x)))
> 
> We have an ARRAY_SIZE() macro already.

Oops :)  I thought we had one of those, but I must've been blind when I
went looking for it...

> 
>> +
>> +enum piglit_result
>> +piglit_display()
>> +{
>> +    bool pass = true;
>> +    int i = 0;
>> +    static const struct {
>> +        int depth_mode;
>> +        int swizzles[4];
> 
> minor nit: s/int/GLenum/

I'll change depth_mode to a GLenum, but I'm going to leave swizzles[4]
as int.  Otherwise, when I supply it to glTexParameteriv, I get this:

depth_texture_mode_and_swizzle.c: In function ‘piglit_display’:
depth_texture_mode_and_swizzle.c:105:6: warning: pointer targets in
passing argument 3 of ‘piglit_dispatch_glTexParameteriv’ differ in
signedness [-Wpointer-sign]
depth_texture_mode_and_swizzle.c:105:6: note: expected ‘const GLint *’
but argument is of type ‘const GLenum *’

[snip]
>> +        piglit_probe_rect_rgba(10 + 20 * i, 10, 10, 10,
>> +                       tests[i].expected);
> 
> Don't you need "pass = piglit_probe_rect_rgba() && pass"?  :)

Wow.  Yes I do.  Thanks :)

[snip]
>> +    int vs, fs, prog, tex_location;
> 
> another nit:  GLuint vs, fs, prog;

Fixed.

[snip]
>> +    piglit_require_extension("GL_EXT_texture_swizzle");
>> +    piglit_require_extension("GL_ARB_texture_rg");
> 
> require GLSL too?

It's actually already implied: piglit_compile_shader_text calls
piglit_require_GLSL().

> Looks good otherwise.
> 
> Reviewed-by: Brian Paul <brianp at vmware.com>

Thanks Brian!

--Ken


More information about the Piglit mailing list