[Piglit] [PATCH 1/5] shader_runner: add ability to specify GL_TEXTURE_BASE_LEVEL

Ian Romanick idr at freedesktop.org
Mon Oct 7 17:44:20 CEST 2013


Oof.  I think we made a mistake when we first started adding the
glTexParameter values.  I'd rather see a table-based approach somewhat
like 7ec46686.  It would be slightly more tricky for glTexParameter
because some parameters want to be integer, and some want to be float.
Maybe use a table like

struct TexParameter_target_table {
    const char *name;
    GLenum pname;

    enum {
        is_float,
        is_int
    } type;

    unsigned value_count; // number of values passed to glTexParameter?v
};

We could put the existing names in the table with both the existing
spelling and the GL_... spelling.

I don't think we need to keep the #ifdef around the LOD bias, but we may
need an '#ifndef .... #define...' block.  The implementation will
generate an error, so anyone using lod_bias will know the test is broken
anyway... the error just won't be as friendly.

On 10/04/2013 09:08 PM, Chris Forbes wrote:
> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
> ---
>  tests/shaders/shader_runner.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index ba76cd0..ca571ec 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -1585,6 +1585,11 @@ handle_texparameter(const char *line)
>  		printf("lod_bias feature is only available in desktop GL\n");
>  		piglit_report_result(PIGLIT_SKIP);
>  #endif
> +	} else if (string_match("base_level ", line)) {
> +		line += strlen("base_level ");
> +		glTexParameteri(target, GL_TEXTURE_BASE_LEVEL,
> +				strtol(line, NULL, 10));
> +		return;
>  	} else {
>  		fprintf(stderr, "unknown texture parameter in `%s'\n", line);
>  		piglit_report_result(PIGLIT_FAIL);
> 



More information about the Piglit mailing list