[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 11:08:17 PST 2012


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;


More information about the Piglit mailing list