[Piglit] [PATCH 4/5] shader_runner: Partially process the requirements section before creating the context
Ian Romanick
idr at freedesktop.org
Fri Nov 16 15:09:07 PST 2012
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.
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.
More information about the Piglit
mailing list