[Piglit] [PATCH 5/7] arb_vertex_attrib_binding: Test changing offsets

Eric Anholt eric at anholt.net
Wed Oct 30 19:04:54 CET 2013


Fredrik Höglund <fredrik at kde.org> writes:

> This test verifies that changing vertex buffer offsets between
> draw calls works as expected.

> diff --git a/tests/spec/arb_vertex_attrib_binding/offsets.c b/tests/spec/arb_vertex_attrib_binding/offsets.c
> new file mode 100644
> index 0000000..ec99bea
> --- /dev/null
> +++ b/tests/spec/arb_vertex_attrib_binding/offsets.c

> +/**
> + * @file offsets.c
> + *
> + * Tests that changing vertex buffer offsets between draw calls
> + * works as expected.
> + */
> +
> +#include "piglit-util-gl-common.h"
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> +
> +	config.supports_gl_compat_version = 10;
> +
> +	config.window_width = 128;
> +	config.window_height = 128;
> +	config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;

core, size, alpha

> +PIGLIT_GL_TEST_CONFIG_END
> +
> +const char *vs_source =
> +	"attribute vec4 pos;\n"
> +	"attribute vec4 color;\n"
> +	"varying vec4 col;\n"
> +	"void main() {\n"
> +	"    col = color;\n"
> +	"    gl_Position = pos;\n"
> +	"}";
> +
> +const char *fs_source =
> +	"varying vec4 col;\n"
> +	"void main() {\n"
> +	"    gl_FragColor = col;\n"
> +	"}";
> +
> +struct Vertex
> +{
> +	float pos[2];
> +	unsigned char color[4];
> +};

lower case

> +void
> +piglit_init(int argc, char **argv)
> +{
> +	GLuint vs, fs;
> +
> +	piglit_require_extension("GL_ARB_vertex_attrib_binding");
> +
> +	vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vs_source);
> +	fs = piglit_compile_shader_text(GL_FRAGMENT_SHADER, fs_source);
> +	program = piglit_link_simple_program(vs, fs);

piglit_build_simple_program()

> +	/* Set up the vertex arrays */
> +	pos   = glGetAttribLocation(program, "pos");
> +	color = glGetAttribLocation(program, "color");
> +}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20131030/e9efeb2d/attachment.pgp>


More information about the Piglit mailing list