[Piglit] [PATCH 1/4] util: Bind fixed attrib locations for "piglit_vertex" and "piglit_texcoord"

Ian Romanick idr at freedesktop.org
Mon May 13 15:15:50 PDT 2013


On 05/08/2013 02:01 PM, Eric Anholt wrote:
> This will let us easily use piglit_draw_rect_tex() in ES-only shader
> tests, and is a step toward having the same shaders usable between ES
> and desktop without going to full VBO setup in shader_runner.

The first 3 patches in this series are

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

It sounds like the others might have some rework?

> ---
>   tests/shaders/shader_runner.c | 7 +++++++
>   tests/util/piglit-shader.c    | 8 ++++++++
>   2 files changed, 15 insertions(+)
>
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index 9089f09..5a3629d 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -779,6 +779,13 @@ link_and_use_shaders(void)
>   	}
>   #endif
>
> +	/* If the shaders reference piglit_vertex or piglit_tex, bind
> +	 * them to some fixed attribute locations so they can be used
> +	 * with piglit_draw_rect_tex() in GLES.
> +	 */
> +	glBindAttribLocation(prog, PIGLIT_ATTRIB_POS, "piglit_vertex");
> +	glBindAttribLocation(prog, PIGLIT_ATTRIB_TEX, "piglit_texcoord");
> +
>   	glLinkProgram(prog);
>
>   	for (i = 0; i < num_vertex_shaders; i++) {
> diff --git a/tests/util/piglit-shader.c b/tests/util/piglit-shader.c
> index c67e58a..ca48f41 100644
> --- a/tests/util/piglit-shader.c
> +++ b/tests/util/piglit-shader.c
> @@ -246,6 +246,14 @@ GLint piglit_link_simple_program(GLint vs, GLint fs)
>   		glAttachShader(prog, vs);
>   	if (fs)
>   		glAttachShader(prog, fs);
> +
> +	/* If the shaders reference piglit_vertex or piglit_tex, bind
> +	 * them to some fixed attribute locations so they can be used
> +	 * with piglit_draw_rect_tex() in GLES.
> +	 */
> +	glBindAttribLocation(prog, PIGLIT_ATTRIB_POS, "piglit_vertex");
> +	glBindAttribLocation(prog, PIGLIT_ATTRIB_TEX, "piglit_texcoord");
> +
>   	glLinkProgram(prog);
>
>   	if (!piglit_link_check_status(prog)) {
>



More information about the Piglit mailing list