[Piglit] [PATCH 4/5] shader_runner: Partially process the requirements section before creating the context

Chad Versace chad.versace at linux.intel.com
Fri Nov 16 15:21:57 PST 2012


On 11/16/2012 03:09 PM, Ian Romanick wrote:
> On 11/16/2012 11:08 AM, Chad Versace wrote:
>> On 11/13/2012 05:00 PM, Ian Romanick wrote:
>>> From: Ian Romanick <ian.d.romanick at intel.com>
>>>
>>> A test script can require a specific GLSL version or a specific GL
>>> version.  To satisfy this requirement, the piglit framework code needs
>>> to know about the requirement before creating the context.  However,
>>> the requirements section can contain other requirements, such as
>>> minimum number of uniforms.
>>>
>>> The requirements section can't be fully processed until after the
>>> context is created, but the context can't be created until after the
>>> requirements section is processed.  Do a quick can over the
>>> requirements section to find the GL and GLSL version requirements.
>>> Use these to guide context creation.
>>>
>>> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
>>> ---
>>>   tests/shaders/shader_runner.c | 102 +++++++++++++++++++++++++++++++++++++++++-
>>>   1 file changed, 101 insertions(+), 1 deletion(-)
>>>
>>
>>
>>> +    switch (requested_glsl_version) {
>>> +    case 14:
>>> +    case 15:
>>> +    case 33:
>>> +        if (requested_gl_version < 31)
>>> +            requested_gl_version = 31;
>>> +        break;
>>> +    case 40:
>>> +    case 41:
>>> +    case 42:
>>> +        if (requested_gl_version < 40)
>>> +            requested_gl_version = 40;
>>> +        break;
>>> +    }
>>> +
>>> +    if (requested_gl_version > 30) {
>>> +        config->supports_gl_core_version = requested_gl_version;
>>> +        config->supports_gl_compat_version = requested_gl_version;
>>> +    } else {
>>> +        config->supports_gl_core_version = 0;
>>> +        config->supports_gl_compat_version = 10;
>>> +    }
>>> +}
>>
>> I'm missing something. I expected the switch to look like below.
>>
>>    case 14:
>>      if (requested_gl_version < 31)
>>          requested_gl_version = 31;
>>      break;
>>    case 15:
>>      if (requested_gl_version < 32)
>>          requested_gl_version = 32;
>>      break;
>>    case 33:
>>      if (requested_gl_version < 33)
>>          requested_gl_version = 33;
>>      break;
> 
> I'm assuming that requesting a core profile of 3.1 can return 3.2, 3.3, or later.

Strangely, though, a no request for 3.1 is allowed to return 3.2 compat. Neither
GLX nor EGL allow it. (I hate all the special cases for 3.1).
 
> I'm assuming that it's possible for some implementation to have GLSL 1.50 on
> 3.1.  We do stuff like that sometimes.  There probably won't be any utility at
> 1.50, but 3.30 adds very little.  I could envision us enabling that before the
> rest of 3.3.

I expected that was your reasoning, but wanted to make sure my understanding
wasn't missing anything.

Reviewed-by: Chad Versace <chad.versace at linux.intel.com>





More information about the Piglit mailing list