[Piglit] [PATCH 2/2] gles-2.0: Check that ES 3 queries are not allowed in ES 2

Ian Romanick idr at freedesktop.org
Tue Dec 11 11:34:17 PST 2012


On 12/11/2012 10:12 AM, Matt Turner wrote:
> On Tue, Dec 11, 2012 at 9:57 AM, Eric Anholt <eric at anholt.net> wrote:
>> Matt Turner <mattst88 at gmail.com> writes:
>>> +void
>>> +piglit_init(int argc, char **argv)
>>> +{
>>> +     /* ES 3 adds many new queries over ES 2. This test confirms that ES 2
>>> +      * correctly rejects them with an INVALID_OPERATION error.
>>> +      */
>>> +     static const struct {
>>> +             const char *name;
>>> +             GLenum val;
>>> +     } query[] = {
>>> +             /* GL_ARB_ES3_compatibility */
>>> +             { "GL_MAX_ELEMENT_INDEX", 0x8D6B },
>>
>> I guess we can't use piglit_get_gl_enum_name() because it doesn't cover
>> these with this tests built for GLES2?  Or we don't have the enums
>> included in our build at all?
>
> Right, we don't have a piglit_get_gl_enum_name() for gles2 and it
> wouldn't contain these enums anyway. Although I wonder why we need an
> piglit_get_gl_enum_name for GL and another for GLES3. Do we have any
> collisions?

Once we take care of the "TODO: Automatically generate this file," we 
should just use the same one.  Until then, I think we're stuck. 
However, we should be able to use the same one for ES2 and ES3.  It will 
use the gl3.h at compile-time, but it won't have any link-time or 
run-time dependencies on ES3.

> Also, including non-GLES2 headers to get these enums doesn't seem right.
>
>>> +             /* GL_ARB_framebuffer_object */
>>> +             { "GL_MAX_SAMPLES", 0x8D57 },
>>
>> Have you confirmed that the enums in this list don't get exposed by any
>> of the extensions we suppport?  That was my concern with this patch.
>
> They are exposed by extensions we support, but not under GLES2. I
> pulled all of these enums from my Mesa patches that enable them for
> GLES3.

The list of checked enums should get split up.  If an implementation 
doesn't support a specific extension on ES2, then the enums for that 
extension should get checked.  At least some of these enums could be 
exposed on ES2 by Mesa-based drivers in the future.

I usually do that by having separate enum lists, using a try function, 
and doing things like:

  if (!piglit_extension_supported("GL_ANGLE_framebuffer_multisample")) {
     pass = try(ANGLE_framebuffer_multisample_enums,
                ARRAY_SIZE(ANGLE_framebuffer_multisample_enums))
         && pass;
  }

>>> +     for (i = 0; i < ARRAY_SIZE(query); i++) {
>>> +             glGetInteger64v(query[i].val, &param);
>>
>> I'm confused, I don't see glGetInteger64v in my GLES2 spec.
>
> Right, fixed in v2.
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>



More information about the Piglit mailing list