Fredrik Höglund <[email protected]> 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");
> +}

Attachment: pgpjti5hM5CtJ.pgp
Description: PGP signature

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to