[Piglit] [PATCH v2] fbo: test that swizzle doesn't affect mipmap generation

Robert Bragg robert at sixbynine.org
Mon Jun 16 17:25:25 PDT 2014


On Mon, Jun 16, 2014 at 3:13 PM, Brian Paul <brianp at vmware.com> wrote:
> On 06/16/2014 06:59 AM, Robert Bragg wrote:
>> +create_fbo(void)
>> +{
>> +       GLuint tex, fb;
>> +       GLenum status;
>> +       int i, dim;
>> +
>> +       glGenTextures(1, &tex);
>> +       glBindTexture(GL_TEXTURE_2D, tex);
>> +       glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzle);
>> +
>> +       for (i = 0, dim = TEX_WIDTH; dim >0; i++, dim /= 2) {
>> +               glTexImage2D(GL_TEXTURE_2D, i, GL_RED,
>
>
> I think a GL_RED texture requires GL_ARB_texture_rg, right?

Ah right, good point thanks.

>
> It might be nice to use another format to avoid another extension
> dependency.

If it's not a big problem, I quite like the idea of sticking with
using a GL_RED texture from the pov that it that keeps the test case
relatively close to the original use case that triggered the bug in
Mesa. Considering why ARB_texture_swizzle would be used, I guess it's
quite likely that other projects follow this pattern too to help
maintain compatibility between say GLES2 with component alpha textures
and GL 3.1+ with only component red textures.

>> +
>> +void piglit_init(int argc, char **argv)
>> +{
>> +       piglit_require_extension("GL_EXT_framebuffer_object");
>> +       piglit_require_extension("GL_ARB_texture_swizzle");
>
>
> If you decide to keep the GL_RED texture, require GL_ARB_texture_rg.
>

I'll send an updated patch.

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

Thanks for the review!

--
Robert

> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list