[Piglit] [PATCH 5/6] Support both core and compat contexts in xfb/intervening-read.c.

Ian Romanick idr at freedesktop.org
Thu Aug 8 15:01:01 PDT 2013


On 08/07/2013 01:28 PM, Paul Berry wrote:
> This will allow the test to be adapted for geometry shaders.
> ---
>   tests/spec/ext_transform_feedback/intervening-read.c | 15 ++++++++++++---
>   1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/tests/spec/ext_transform_feedback/intervening-read.c b/tests/spec/ext_transform_feedback/intervening-read.c
> index ac74aa3..7d7eece 100644
> --- a/tests/spec/ext_transform_feedback/intervening-read.c
> +++ b/tests/spec/ext_transform_feedback/intervening-read.c
> @@ -51,6 +51,7 @@
>   PIGLIT_GL_TEST_CONFIG_BEGIN
>
>   	config.supports_gl_compat_version = 10;
> +	config.supports_gl_core_version = 31;
>
>   	config.window_width = 64;
>   	config.window_height = 32;
> @@ -87,7 +88,7 @@ static const char *fstext =
>
>   static const char *varyings[] = { "out_position", "out_color" };
>
> -static GLuint xfb_buf;
> +static GLuint xfb_buf, vao, array_buf;
>   static GLuint prog;
>   static GLuint query;
>
> @@ -137,7 +138,12 @@ piglit_init(int argc, char **argv)
>   	}
>
>   	glGenBuffers(1, &xfb_buf);
> +	glGenBuffers(1, &array_buf);
>   	glGenQueries(1, &query);
> +	if (piglit_is_extension_supported("GL_ARB_vertex_array_object")) {

Same suggestion as patch 3.

> +		glGenVertexArrays(1, &vao);
> +		glBindVertexArray(vao);
> +	}
>   }
>
>   struct vertex_data {
> @@ -180,12 +186,15 @@ piglit_display(void)
>   	glUseProgram(prog);
>
>   	/* Setup inputs */
> +	glBindBuffer(GL_ARRAY_BUFFER, array_buf);
> +	glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_input), &vertex_input,
> +		     GL_STATIC_DRAW);
>   	glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE,
>   			      sizeof(struct vertex_data),
> -			      &vertex_input[0].position);
> +			      (void *) offsetof(struct vertex_data, position));
>   	glVertexAttribPointer(1, 4, GL_FLOAT, GL_FALSE,
>   			      sizeof(struct vertex_data),
> -			      &vertex_input[0].color);
> +			      (void *) offsetof(struct vertex_data, color));
>   	glEnableVertexAttribArray(0);
>   	glEnableVertexAttribArray(1);
>
>



More information about the Piglit mailing list