[Piglit] [PATCH] egl: Add test egl-create-context-verify-gl-flavor

Chad Versace chad.versace at linux.intel.com
Thu Nov 8 13:31:41 PST 2012


On 11/08/2012 01:20 PM, Ian Romanick wrote:
> On 11/08/2012 10:19 AM, Chad Versace wrote:
>> This test requests various flavors (that is, api and version and profile) of
>> contexts and verifies that the context's actual flavor is compatible with
>> the requested flavor.
>>
>> The following subcases fail on mesa-a196f43 with Intel Sandybridge:
>>      - For each OpenGL context >= 3.2, context creation fails with EGL
>>        error EGL_SUCCESS.
>>      - For OpenGL ES 3.0, the context version reported by glGetString is
>>        2.0.
>> All other cases skip or pass.
> 
> Minor nit (with substantive comments below)... there's a lot of mixed tabs and
> spaces that make the indentation look wonkey.

Oops about the tabs. My editor was configured incorrectly. I'll resend with fixed
indentation after you reply to my use of eglGetProcAddress.

>> +int
>> +get_gl_version(void)
>> +{
>> +    const char *version_string;
>> +    int scanf_count;
>> +    int major;
>> +    int minor;
>> +
>> +    version_string = (const char*) piglit_glGetString(GL_VERSION);
> 
> If we don't have a test that sanity checks glGetString(GL_VERSION) vs
> glGetIntegerv(GL_MAJOR_VERION) and glGetIntegerv(GL_MINOR_VERSION), maybe we
> should do that here?  Dunno...


Doing a check here sure wouldn't hurt. I'll add that.


>> +int
>> +main(int argc, char **argv)
>> +{
>> +        enum piglit_result result = PIGLIT_SKIP;
>> +
>> +        /* We call glGetIntegerv with a GL context, a GLES1 context,
>> +         * and a GLES2 context current. So we shouldn't use the statically
>> +         * available symbol provided by libGL. Ditto the other functions
>> +         * below.
>> +         */
>> +        piglit_glGetString = (void*) eglGetProcAddress("glGetString");
>> +        piglit_glGetIntegerv = (void*) eglGetProcAddress("glGetIntegerv");
> 
> Eh... what?

If I have a GLES2 context current and I call the glGetString that I linked in
from libGL.so, is the behavior defined? I was unsure, that's why I
GetProcAddress'd them.



More information about the Piglit mailing list