Please disregard this patch. Marek
On Fri, Mar 22, 2013 at 2:22 PM, Marek Olšák <mar...@gmail.com> wrote: > --- > tests/all.tests | 1 + > .../spec/ext_transform_feedback/CMakeLists.gl.txt | 2 +- > tests/spec/ext_transform_feedback/primgen.c | 114 > ++++++++++++++++++++ > 3 files changed, 116 insertions(+), 1 deletion(-) > create mode 100644 tests/spec/ext_transform_feedback/primgen.c > > diff --git a/tests/all.tests b/tests/all.tests > index 911cd61..d942527 100644 > --- a/tests/all.tests > +++ b/tests/all.tests > @@ -1943,6 +1943,7 @@ ext_transform_feedback['position-readback-bufferrange'] > = concurrent_test('ext > ext_transform_feedback['position-readback-bufferrange-discard'] = > concurrent_test('ext_transform_feedback-position range discard') > > ext_transform_feedback['negative-prims'] = > concurrent_test('ext_transform_feedback-negative-prims') > +ext_transform_feedback['primgen'] = > concurrent_test('ext_transform_feedback-primgen') > > ext_transform_feedback['position-render-bufferbase'] = > concurrent_test('ext_transform_feedback-position render') > ext_transform_feedback['position-render-bufferbase-discard'] = > concurrent_test('ext_transform_feedback-position render discard') > diff --git a/tests/spec/ext_transform_feedback/CMakeLists.gl.txt > b/tests/spec/ext_transform_feedback/CMakeLists.gl.txt > index 93b8aae..a5828c5 100644 > --- a/tests/spec/ext_transform_feedback/CMakeLists.gl.txt > +++ b/tests/spec/ext_transform_feedback/CMakeLists.gl.txt > @@ -22,12 +22,12 @@ piglit_add_executable > (ext_transform_feedback-discard-drawarrays discard-drawarr > piglit_add_executable (ext_transform_feedback-discard-drawpixels > discard-drawpixels.c) > piglit_add_executable (ext_transform_feedback-generatemipmap > generatemipmap.c) > piglit_add_executable (ext_transform_feedback-get-buffer-state > get-buffer-state.c) > -piglit_add_executable (ext_transform_feedback-position position.c) > piglit_add_executable (ext_transform_feedback-immediate-reuse > immediate-reuse.c) > piglit_add_executable (ext_transform_feedback-interleaved interleaved.c) > piglit_add_executable (ext_transform_feedback-intervening-read > intervening-read.c) > piglit_add_executable (ext_transform_feedback-max-varyings max-varyings.c) > piglit_add_executable (ext_transform_feedback-negative-prims > negative-prims.c) > +piglit_add_executable (ext_transform_feedback-primgen primgen.c) > piglit_add_executable (ext_transform_feedback-separate separate.c) > piglit_add_executable (ext_transform_feedback-output-type output-type.c) > piglit_add_executable (ext_transform_feedback-order order.c) > diff --git a/tests/spec/ext_transform_feedback/primgen.c > b/tests/spec/ext_transform_feedback/primgen.c > new file mode 100644 > index 0000000..2873943 > --- /dev/null > +++ b/tests/spec/ext_transform_feedback/primgen.c > @@ -0,0 +1,114 @@ > +/* > + * Copyright © 2013 Marek Olšák <mar...@gmail.com> > + * > + * Permission is hereby granted, free of charge, to any person obtaining a > + * copy of this software and associated documentation files (the "Software"), > + * to deal in the Software without restriction, including without limitation > + * the rights to use, copy, modify, merge, publish, distribute, sublicense, > + * and/or sell copies of the Software, and to permit persons to whom the > + * Software is furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice (including the next > + * paragraph) shall be included in all copies or substantial portions of the > + * Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > DEALINGS > + * IN THE SOFTWARE. > + */ > + > +/** > + * Tests if PRIMITIVES_GENERATED works with transform feedback disabled. > + * > + * From EXT_transform_feedback: > + * "the primitives-generated count is incremented every time a primitive > + * reaches the Discarding Rasterization stage" > + */ > + > +#include "piglit-util-gl-common.h" > + > +PIGLIT_GL_TEST_CONFIG_BEGIN > + > + config.supports_gl_compat_version = 10; > + > + config.window_width = 64; > + config.window_height = 32; > + config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGB > | PIGLIT_GL_VISUAL_ALPHA; > + > +PIGLIT_GL_TEST_CONFIG_END > + > +static const char *vstext = { > + "void main() {" > + " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;" > + " gl_FrontColor = vec4(1.0);" > + "}" > +}; > + > +GLuint prog; > +GLuint q; > + > +void piglit_init(int argc, char **argv) > +{ > + GLuint vs; > + > + piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE); > + > + /* Check the driver. */ > + piglit_require_gl_version(15); > + piglit_require_GLSL(); > + piglit_require_transform_feedback(); > + > + glGenQueries(1, &q); > + > + /* Create shaders. */ > + vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vstext); > + prog = glCreateProgram(); > + glAttachShader(prog, vs); > + glLinkProgram(prog); > + if (!piglit_link_check_status(prog)) { > + glDeleteProgram(prog); > + piglit_report_result(PIGLIT_FAIL); > + } > + > + glClearColor(0.2, 0.2, 0.2, 1.0); > + glEnableClientState(GL_VERTEX_ARRAY); > +} > + > +enum piglit_result piglit_display(void) > +{ > + GLboolean pass = GL_TRUE; > + unsigned qresult; > + static const float verts[] = { > + 10, 10, > + 10, 20, > + 20, 20, > + 20, 10 > + }; > + static const unsigned indices[] = { > + 0, 1, 3, 1, 2, 3 > + }; > + int expected = 2; > + > + glClear(GL_COLOR_BUFFER_BIT); > + glBeginQuery(GL_PRIMITIVES_GENERATED, q); > + > + glLoadIdentity(); > + glUseProgram(prog); > + glVertexPointer(2, GL_FLOAT, 0, verts); > + glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, indices); > + > + glEndQuery(GL_PRIMITIVES_GENERATED_EXT); > + glGetQueryObjectuiv(q, GL_QUERY_RESULT, &qresult); > + if (qresult != expected) { > + printf("Primitives generated: %i, Expected: %i\n", qresult, > expected); > + pass = GL_FALSE; > + } > + > + piglit_present_results(); > + > + return pass ? PIGLIT_PASS : PIGLIT_FAIL; > +} > -- > 1.7.10.4 > _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev