Fredrik Höglund <[email protected]> writes:

> This test verifies that switching vertex buffers between draw calls
> works as expected.

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

> +/**
> + * @file buffers.c
> + *
> + * Tests that switching buffers 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;

core, drop sizes

> +     config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;

Oops, I didn't notice that in the previous test and this one, you should
have PIGLIT_GL_VISUAL_ALPHA, since you're using probe_rgba.  Of course,
your colors happen to have alpha of 1, so it ends up working out, but
let's be consistent.

> +
> +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

> +     pass = piglit_probe_pixel_rgba(piglit_width * .25, piglit_height * .75, 
> red);
> +     pass = piglit_probe_pixel_rgba(piglit_width * .75, piglit_height * .75, 
> green);
> +     pass = piglit_probe_pixel_rgba(piglit_width * .25, piglit_height * .25, 
> blue);
> +     pass = piglit_probe_pixel_rgba(piglit_width * .75, piglit_height * .25, 
> white);

probe_rect?

> +
> +     piglit_present_results();
> +
> +     glDeleteBuffers(1, &vbo1);
> +     glDeleteBuffers(1, &vbo2);
> +     glDeleteBuffers(1, &ibo);
> +
> +     glDeleteVertexArrays(1, &vao);
> +
> +     glUseProgram(0);
> +
> +     return pass ? PIGLIT_PASS : PIGLIT_FAIL;
> +}
> +
> +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

Attachment: pgpqeMffrIOIz.pgp
Description: PGP signature

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

Reply via email to