[Piglit] [PATCH v2 0/4] arb_gpu_shader5: tests to verify 'stream' layout qualifier
This is the second version of the patch series. This version includes the following changes: * Remove a trailing whitespace from patch 1. * Added a new test (patch 4) that checks that a vertex emitted in stream !=0 is not processed by the fragment shader, following the suggestion of Chris Forbes in: http://lists.freedesktop.org/archives/mesa-dev/2014-June/062117.html Thanks, Sam P.S: I don't have commit access to the repository Samuel Iglesias Gonsalvez (4): arb_gpu_shader5: add some compiler tests for stream qualifier arb_gpu_shader5: Add linker tests to verify 'stream' layout qualifier arb_gpu_shader5: Add execution test to verify 'stream' layout qualifier arb_gpu_shader5: Add new test emitstreamvertex_nodraw tests/all.py | 5 + tests/spec/arb_gpu_shader5/CMakeLists.txt | 3 +- tests/spec/arb_gpu_shader5/compiler/CMakeLists.txt | 3 +- .../compiler/stream-qualifier/CMakeLists.gl.txt| 12 + .../compiler/stream-qualifier/CMakeLists.txt | 1 + .../correct-multiple-layout-qualifier-stream.geom | 40 .../incorrect-in-layout-qualifier-stream.geom | 19 ++ ...ect-multiple-block-layout-qualifier-stream.geom | 32 +++ ...incorrect-negative-layout-qualifier-stream.geom | 24 ++ .../stream-qualifier/stream_value_too_large.c | 193 .../arb_gpu_shader5/execution/CMakeLists.gl.txt| 2 + .../execution/emitstreamvertex_nodraw.c| 170 ++ .../execution/xfb-streams-without-invocations.c| 248 + .../spec/arb_gpu_shader5/linker/CMakeLists.gl.txt | 13 ++ tests/spec/arb_gpu_shader5/linker/CMakeLists.txt | 1 + .../linker/emitstreamvertex_stream_too_large.c | 133 +++ .../linker/stream-different-zero-gs-fs.shader_test | 50 + .../linker/stream-invalid-prim-output.shader_test | 54 + .../linker/stream-negative-value.shader_test | 38 .../arb_gpu_shader5/linker/tf-wrong-stream-value.c | 116 ++ 20 files changed, 1155 insertions(+), 2 deletions(-) create mode 100644 tests/spec/arb_gpu_shader5/compiler/stream-qualifier/CMakeLists.gl.txt create mode 100644 tests/spec/arb_gpu_shader5/compiler/stream-qualifier/CMakeLists.txt create mode 100644 tests/spec/arb_gpu_shader5/compiler/stream-qualifier/correct-multiple-layout-qualifier-stream.geom create mode 100644 tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-in-layout-qualifier-stream.geom create mode 100644 tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-multiple-block-layout-qualifier-stream.geom create mode 100644 tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-negative-layout-qualifier-stream.geom create mode 100644 tests/spec/arb_gpu_shader5/compiler/stream-qualifier/stream_value_too_large.c create mode 100644 tests/spec/arb_gpu_shader5/execution/emitstreamvertex_nodraw.c create mode 100644 tests/spec/arb_gpu_shader5/execution/xfb-streams-without-invocations.c create mode 100644 tests/spec/arb_gpu_shader5/linker/CMakeLists.gl.txt create mode 100644 tests/spec/arb_gpu_shader5/linker/CMakeLists.txt create mode 100644 tests/spec/arb_gpu_shader5/linker/emitstreamvertex_stream_too_large.c create mode 100644 tests/spec/arb_gpu_shader5/linker/stream-different-zero-gs-fs.shader_test create mode 100644 tests/spec/arb_gpu_shader5/linker/stream-invalid-prim-output.shader_test create mode 100644 tests/spec/arb_gpu_shader5/linker/stream-negative-value.shader_test create mode 100644 tests/spec/arb_gpu_shader5/linker/tf-wrong-stream-value.c -- 2.0.0 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH v2 1/4] arb_gpu_shader5: add some compiler tests for stream qualifier
Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- v2: Remove trailing whitespace tests/all.py | 1 + tests/spec/arb_gpu_shader5/compiler/CMakeLists.txt | 3 +- .../compiler/stream-qualifier/CMakeLists.gl.txt| 12 ++ .../compiler/stream-qualifier/CMakeLists.txt | 1 + .../correct-multiple-layout-qualifier-stream.geom | 40 + .../incorrect-in-layout-qualifier-stream.geom | 19 ++ ...ect-multiple-block-layout-qualifier-stream.geom | 32 ...incorrect-negative-layout-qualifier-stream.geom | 24 +++ .../stream-qualifier/stream_value_too_large.c | 193 + 9 files changed, 324 insertions(+), 1 deletion(-) create mode 100644 tests/spec/arb_gpu_shader5/compiler/stream-qualifier/CMakeLists.gl.txt create mode 100644 tests/spec/arb_gpu_shader5/compiler/stream-qualifier/CMakeLists.txt create mode 100644 tests/spec/arb_gpu_shader5/compiler/stream-qualifier/correct-multiple-layout-qualifier-stream.geom create mode 100644 tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-in-layout-qualifier-stream.geom create mode 100644 tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-multiple-block-layout-qualifier-stream.geom create mode 100644 tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-negative-layout-qualifier-stream.geom create mode 100644 tests/spec/arb_gpu_shader5/compiler/stream-qualifier/stream_value_too_large.c diff --git a/tests/all.py b/tests/all.py index 17d5d9b..7734929 100644 --- a/tests/all.py +++ b/tests/all.py @@ -1698,6 +1698,7 @@ add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-minmax') add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-invocation-id') add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-invocations_count_too_large') add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-xfb-streams') +add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-stream_value_too_large') arb_texture_query_levels = {} spec['ARB_texture_query_levels'] = arb_texture_query_levels diff --git a/tests/spec/arb_gpu_shader5/compiler/CMakeLists.txt b/tests/spec/arb_gpu_shader5/compiler/CMakeLists.txt index 4a012b9..ec80122 100644 --- a/tests/spec/arb_gpu_shader5/compiler/CMakeLists.txt +++ b/tests/spec/arb_gpu_shader5/compiler/CMakeLists.txt @@ -1 +1,2 @@ -piglit_include_target_api() \ No newline at end of file +add_subdirectory (stream-qualifier) +piglit_include_target_api() diff --git a/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/CMakeLists.gl.txt b/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/CMakeLists.gl.txt new file mode 100644 index 000..11b3110 --- /dev/null +++ b/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/CMakeLists.gl.txt @@ -0,0 +1,12 @@ +include_directories( + ${GLEXT_INCLUDE_DIR} + ${OPENGL_INCLUDE_PATH} +) + +link_libraries ( + piglitutil_${piglit_target_api} + ${OPENGL_gl_LIBRARY} + ${OPENGL_glu_LIBRARY} +) + +piglit_add_executable (arb_gpu_shader5-stream_value_too_large stream_value_too_large.c) diff --git a/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/CMakeLists.txt b/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/CMakeLists.txt new file mode 100644 index 000..144a306 --- /dev/null +++ b/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/CMakeLists.txt @@ -0,0 +1 @@ +piglit_include_target_api() diff --git a/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/correct-multiple-layout-qualifier-stream.geom b/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/correct-multiple-layout-qualifier-stream.geom new file mode 100644 index 000..46c0644 --- /dev/null +++ b/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/correct-multiple-layout-qualifier-stream.geom @@ -0,0 +1,40 @@ +// [config] +// expect_result: pass +// glsl_version: 1.50 +// require_extensions: GL_ARB_gpu_shader5 +// check_link: false +// [end config] +// +// ARB_gpu_shader5 spec says: +// A default stream number may be declared at global +//scope by qualifying interface qualifier out as in this example: +// +// layout(stream = 1) out; +// +//The stream number specified in such a declaration replaces any previous +//default and applies to all subsequent block and variable declarations +//until a new default is established. The initial default stream number is +//zero. +// +// Tests for multiple declarations of layout qualifier 'stream'. +// + +#version 150 +#extension GL_ARB_gpu_shader5 : enable + +layout(points) in; +layout(points) out; + +out vec4 var1; +layout(stream=1) out; +out vec4 var2; +layout(stream=2) out vec3 var3; + +layout(stream=3) out Block1 { + float var4; + layout(stream=3) vec4 var5; +}; + +void main() +{ +} diff --git a/tests/spec/arb_gpu_shader5/compiler/stream-qualifier/incorrect-in-layout-qualifier-stream.geom
[Piglit] [PATCH v2 3/4] arb_gpu_shader5: Add execution test to verify 'stream' layout qualifier
Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- tests/all.py | 1 + .../arb_gpu_shader5/execution/CMakeLists.gl.txt| 1 + .../execution/xfb-streams-without-invocations.c| 248 + 3 files changed, 250 insertions(+) create mode 100644 tests/spec/arb_gpu_shader5/execution/xfb-streams-without-invocations.c diff --git a/tests/all.py b/tests/all.py index fac9488..8667fa4 100644 --- a/tests/all.py +++ b/tests/all.py @@ -1701,6 +1701,7 @@ add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-xfb-streams') add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-stream_value_too_large') add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-emitstreamvertex_stream_too_large') add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-tf-wrong-stream-value') +add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-xfb-streams-without-invocations') arb_texture_query_levels = {} spec['ARB_texture_query_levels'] = arb_texture_query_levels diff --git a/tests/spec/arb_gpu_shader5/execution/CMakeLists.gl.txt b/tests/spec/arb_gpu_shader5/execution/CMakeLists.gl.txt index 18e9ad8..fcd271f 100644 --- a/tests/spec/arb_gpu_shader5/execution/CMakeLists.gl.txt +++ b/tests/spec/arb_gpu_shader5/execution/CMakeLists.gl.txt @@ -11,3 +11,4 @@ link_libraries ( piglit_add_executable (arb_gpu_shader5-invocation-id invocation-id.c) piglit_add_executable (arb_gpu_shader5-xfb-streams xfb-streams.c) +piglit_add_executable (arb_gpu_shader5-xfb-streams-without-invocations xfb-streams-without-invocations.c) diff --git a/tests/spec/arb_gpu_shader5/execution/xfb-streams-without-invocations.c b/tests/spec/arb_gpu_shader5/execution/xfb-streams-without-invocations.c new file mode 100644 index 000..aee8ded --- /dev/null +++ b/tests/spec/arb_gpu_shader5/execution/xfb-streams-without-invocations.c @@ -0,0 +1,248 @@ +/* + * Copyright (c) 2014 Igalia S.L. + * + * 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. + */ + +#include piglit-util-gl-common.h + +/** + * @file xfb-streams-without-invocations.c + * + * This test uses geometry shader multiple stream support from + * GL_ARB_gpu_shader5 and GL_ARB_transform_feedback3 to capture + * transform feedback from 3 streams into 2 buffers. + * + * Based on the work of Jordan's work in xfb-streams.c. + */ + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 32; + config.supports_gl_core_version = 32; + +PIGLIT_GL_TEST_CONFIG_END + +static const char vs_pass_thru_text[] = + #version 150\n + void main() {\n + gl_Position = vec4(0.0);\n + }\n; + +static const char gs_text[] = + #version 150\n + #extension GL_ARB_gpu_shader5 : enable\n + layout(points) in;\n + layout(points, max_vertices = 3) out;\n + layout(stream = 0) out float stream0_0_out;\n + layout(stream = 1) out vec2 stream1_0_out;\n + layout(stream = 2) out float stream2_0_out;\n + layout(stream = 2) out vec4 stream2_1_out;\n + void main() {\n + gl_Position = gl_in[0].gl_Position;\n + stream0_0_out = 0.0;\n + EmitStreamVertex(0);\n + EndStreamPrimitive(0);\n + + stream2_0_out = 0.0;\n + stream2_1_out = vec4(1.0, 2.0, 3.0, 4.0);\n + EmitStreamVertex(2);\n + EndStreamPrimitive(2);\n + + stream1_0_out = vec2(0.0, 1.0);\n + EmitStreamVertex(1);\n + EndStreamPrimitive(1);\n + }; + +int stream_float_counts[] = { 1, 2, 5, 0 }; + +#define STREAMS 4 + +static const char *varyings[] = { + stream0_0_out, gl_NextBuffer, + stream1_0_out, gl_NextBuffer, + stream2_0_out, stream2_1_out +}; + +static void +build_and_use_program() +{ + GLuint prog; + + prog = piglit_build_simple_program_multiple_shaders( + GL_VERTEX_SHADER, vs_pass_thru_text, +
[Piglit] [PATCH v2 2/4] arb_gpu_shader5: Add linker tests to verify 'stream' layout qualifier
Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- tests/all.py | 2 + tests/spec/arb_gpu_shader5/CMakeLists.txt | 3 +- .../spec/arb_gpu_shader5/linker/CMakeLists.gl.txt | 13 ++ tests/spec/arb_gpu_shader5/linker/CMakeLists.txt | 1 + .../linker/emitstreamvertex_stream_too_large.c | 133 + .../linker/stream-different-zero-gs-fs.shader_test | 50 .../linker/stream-invalid-prim-output.shader_test | 54 + .../linker/stream-negative-value.shader_test | 38 ++ .../arb_gpu_shader5/linker/tf-wrong-stream-value.c | 116 ++ 9 files changed, 409 insertions(+), 1 deletion(-) create mode 100644 tests/spec/arb_gpu_shader5/linker/CMakeLists.gl.txt create mode 100644 tests/spec/arb_gpu_shader5/linker/CMakeLists.txt create mode 100644 tests/spec/arb_gpu_shader5/linker/emitstreamvertex_stream_too_large.c create mode 100644 tests/spec/arb_gpu_shader5/linker/stream-different-zero-gs-fs.shader_test create mode 100644 tests/spec/arb_gpu_shader5/linker/stream-invalid-prim-output.shader_test create mode 100644 tests/spec/arb_gpu_shader5/linker/stream-negative-value.shader_test create mode 100644 tests/spec/arb_gpu_shader5/linker/tf-wrong-stream-value.c diff --git a/tests/all.py b/tests/all.py index 7734929..fac9488 100644 --- a/tests/all.py +++ b/tests/all.py @@ -1699,6 +1699,8 @@ add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-invocation-id') add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-invocations_count_too_large') add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-xfb-streams') add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-stream_value_too_large') +add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-emitstreamvertex_stream_too_large') +add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-tf-wrong-stream-value') arb_texture_query_levels = {} spec['ARB_texture_query_levels'] = arb_texture_query_levels diff --git a/tests/spec/arb_gpu_shader5/CMakeLists.txt b/tests/spec/arb_gpu_shader5/CMakeLists.txt index f41c000..60d83cb 100644 --- a/tests/spec/arb_gpu_shader5/CMakeLists.txt +++ b/tests/spec/arb_gpu_shader5/CMakeLists.txt @@ -1,3 +1,4 @@ add_subdirectory (compiler) add_subdirectory (execution) -piglit_include_target_api() \ No newline at end of file +add_subdirectory (linker) +piglit_include_target_api() diff --git a/tests/spec/arb_gpu_shader5/linker/CMakeLists.gl.txt b/tests/spec/arb_gpu_shader5/linker/CMakeLists.gl.txt new file mode 100644 index 000..f955e83 --- /dev/null +++ b/tests/spec/arb_gpu_shader5/linker/CMakeLists.gl.txt @@ -0,0 +1,13 @@ +include_directories( + ${GLEXT_INCLUDE_DIR} + ${OPENGL_INCLUDE_PATH} +) + +link_libraries ( + piglitutil_${piglit_target_api} + ${OPENGL_gl_LIBRARY} + ${OPENGL_glu_LIBRARY} +) + +piglit_add_executable (arb_gpu_shader5-emitstreamvertex_stream_too_large emitstreamvertex_stream_too_large.c) +piglit_add_executable (arb_gpu_shader5-tf-wrong-stream-value tf-wrong-stream-value.c) diff --git a/tests/spec/arb_gpu_shader5/linker/CMakeLists.txt b/tests/spec/arb_gpu_shader5/linker/CMakeLists.txt new file mode 100644 index 000..144a306 --- /dev/null +++ b/tests/spec/arb_gpu_shader5/linker/CMakeLists.txt @@ -0,0 +1 @@ +piglit_include_target_api() diff --git a/tests/spec/arb_gpu_shader5/linker/emitstreamvertex_stream_too_large.c b/tests/spec/arb_gpu_shader5/linker/emitstreamvertex_stream_too_large.c new file mode 100644 index 000..a478055 --- /dev/null +++ b/tests/spec/arb_gpu_shader5/linker/emitstreamvertex_stream_too_large.c @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2014 Igalia S.L. + * + * 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. + */ + +/** + * @file emitstreamvertex_stream_too_large.c + * + * Test that exceeding the implementation's maximum streams + * value (GL_MAX_VERTEX_STREAMS) when calling
[Piglit] [PATCH v2 4/4] arb_gpu_shader5: Add new test emitstreamvertex_nodraw
It checks that a vertex emitted in stream !=0 is not processed by the fragment shader. Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- tests/all.py | 1 + .../arb_gpu_shader5/execution/CMakeLists.gl.txt| 1 + .../execution/emitstreamvertex_nodraw.c| 170 + 3 files changed, 172 insertions(+) create mode 100644 tests/spec/arb_gpu_shader5/execution/emitstreamvertex_nodraw.c diff --git a/tests/all.py b/tests/all.py index 8667fa4..4b0caf0 100644 --- a/tests/all.py +++ b/tests/all.py @@ -1702,6 +1702,7 @@ add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-stream_value_too_large') add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-emitstreamvertex_stream_too_large') add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-tf-wrong-stream-value') add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-xfb-streams-without-invocations') +add_concurrent_test(arb_gpu_shader5, 'arb_gpu_shader5-emitstreamvertex_nodraw') arb_texture_query_levels = {} spec['ARB_texture_query_levels'] = arb_texture_query_levels diff --git a/tests/spec/arb_gpu_shader5/execution/CMakeLists.gl.txt b/tests/spec/arb_gpu_shader5/execution/CMakeLists.gl.txt index fcd271f..0b743d9 100644 --- a/tests/spec/arb_gpu_shader5/execution/CMakeLists.gl.txt +++ b/tests/spec/arb_gpu_shader5/execution/CMakeLists.gl.txt @@ -12,3 +12,4 @@ link_libraries ( piglit_add_executable (arb_gpu_shader5-invocation-id invocation-id.c) piglit_add_executable (arb_gpu_shader5-xfb-streams xfb-streams.c) piglit_add_executable (arb_gpu_shader5-xfb-streams-without-invocations xfb-streams-without-invocations.c) +piglit_add_executable (arb_gpu_shader5-emitstreamvertex_nodraw emitstreamvertex_nodraw.c) diff --git a/tests/spec/arb_gpu_shader5/execution/emitstreamvertex_nodraw.c b/tests/spec/arb_gpu_shader5/execution/emitstreamvertex_nodraw.c new file mode 100644 index 000..777cdc3 --- /dev/null +++ b/tests/spec/arb_gpu_shader5/execution/emitstreamvertex_nodraw.c @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2014 Igalia S.L. + * + * 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. + */ + +/** + * @file emitstreamvertex_no_draw.c + * + * Test that a vertex emitted in stream 1 is not processed by fragment + * shader. + */ + +#include piglit-util-gl-common.h + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 32; + config.supports_gl_core_version = 32; + config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGB; + config.window_width = 100; + config.window_height = 100; + +PIGLIT_GL_TEST_CONFIG_END + +GLuint vertexbuffer; +GLint program; + +static const GLfloat g_vertex_buffer_data[] = { + -0.5f, -0.5f, 0.0f, + 0.5f, -0.5f, 0.0f, + 0.0f, 0.50f, 0.0f, +}; + +enum piglit_result +piglit_display(void) +{ + int pass; + float c[3] = {1.0, 0.0 , 0.0}; + float c_clear[3] = {0.0, 0.0 , 0.0}; + + glUseProgram(program); + + /* +* Workaround: if define glPointSize == 1, piglit_probe_pixel_rgb() +* will fail unless the window is resized. +*/ + glPointSize(2); + + glViewport(0, 0, piglit_width, piglit_height); + /* Clear the back buffer to black */ + glClearColor(0, 0, 0, 0); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glEnableVertexAttribArray(0); + glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer); + glVertexAttribPointer( + 0, + 3, + GL_FLOAT, + GL_FALSE, + 0, + (void*)0); + + glDrawArrays(GL_POINTS, 0, 3); + glDisableVertexAttribArray(0); + + /* Probe that the point in stream=1 is not drawn. */ + pass = piglit_probe_pixel_rgb(piglit_width/2, piglit_height/2, c_clear); +
[Piglit] [PATCH] dispatch: Do not generate extraneous parentheses.
This patch fixes 592 clang parentheses-equality warnings on Fedora 20. Signed-off-by: Vinson Lee v...@freedesktop.org --- tests/util/piglit-dispatch-gen.c.mako | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/tests/util/piglit-dispatch-gen.c.mako b/tests/util/piglit-dispatch-gen.c.mako index 772d936..16f9b17 100644 --- a/tests/util/piglit-dispatch-gen.c.mako +++ b/tests/util/piglit-dispatch-gen.c.mako @@ -31,23 +31,30 @@ resolve_${f0.name}(void) { % for req in alias_set.requirements: ---/* ${req.command.name} (${req.provider.name}) */ -% for api in sorted(set(dispatch.APIS[x] for x in req.apis)): +% apis = sorted(set(dispatch.APIS[x] for x in req.apis)) % +% for api in apis: % if loop.first: if (( -% else: . +---if ( +% if req.has_extension: +( +% endif +% endif +% if len(apis) 1: +( % endif -.(dispatch_api == ${api.c_piglit_token} +.dispatch_api == ${api.c_piglit_token} % if req.has_feature and req.feature.version_int api.base_version_int: ... check_version(${req.feature.version_int}) % endif +% if len(apis) 1: ) +% endif % if not loop.last: -. || +. || . % endif % endfor -) % if req.has_extension: +) --- check_extension(${req.extension.name}) % endif ...) { -- 1.9.1 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] cl: Add __attribute__(work_group_size_hint(..)) test
Currently, this test triggers an llvm error on r600g/radeonsi. Signed-off-by: Aaron Watry awa...@gmail.com CC: Tom Stellard thomas.stell...@amd.com Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76223 --- tests/cl/program/execute/attributes.cl | 40 ++ 1 file changed, 40 insertions(+) create mode 100644 tests/cl/program/execute/attributes.cl diff --git a/tests/cl/program/execute/attributes.cl b/tests/cl/program/execute/attributes.cl new file mode 100644 index 000..c31762a --- /dev/null +++ b/tests/cl/program/execute/attributes.cl @@ -0,0 +1,40 @@ +/*! +[config] +name: __attribute__ tests +clc_version_min: 10 + +[test] +name: work_group_size_hint +kernel_name: testKernel +dimensions: 1 +global_size: 4 0 0 +arg_out: 0 buffer int[4] repeat 5 + +!*/ + +/* +https://bugs.freedesktop.org/show_bug.cgi?id=76223 + +If you remove the __attribute__((work_group_size_hint(4,1,1)), then the test works. + +With the attribute, you get: +LLVM ERROR: not a number, or does not fit in an unsigned int + +This only causes an error if there's more than 1 kernel in the program +*/ +__kernel __attribute__((work_group_size_hint(4, 1, 1))) void testKernel( + global int* out +) { + const size_t gid = get_global_id(0); + if (gid = get_global_size(0)) + return; + out[gid] = 5; +} + +/* +XXX: With this useless kernel commented out, things work... +*/ +__kernel void BogusKernel(global int* out, global int* in){ + *out = *in; +} + -- 1.9.1 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 2/2] gl-3.0/integer-errors: do more glTexImage parameter error checking
Instead of spot checking a few internalFormat/format/type combinations test all of them. And only test the core profile formats. The ext_texture_integer-errors test hits the other legacy/compat formats. Remove the tests for glDrawPixels, glReadPixels, etc. since that's covered in the new ext_texture_integer-errors test. Also, we were mistakenly checking that the packed datatypes were accepted. But actually, the packed types were only made legal with the GL_ARB_texture_rgb10_a2ui extension not GL_EXT_texture_integer. --- tests/spec/gl-3.0/api/integer-errors.c | 179 +++- 1 file changed, 63 insertions(+), 116 deletions(-) diff --git a/tests/spec/gl-3.0/api/integer-errors.c b/tests/spec/gl-3.0/api/integer-errors.c index 8323bb5..ccfd279 100644 --- a/tests/spec/gl-3.0/api/integer-errors.c +++ b/tests/spec/gl-3.0/api/integer-errors.c @@ -22,9 +22,7 @@ /** * \file integer-errors.c - * Do error checking for functions taking signed/unsigned integer - * (non-normalized) formats, such as glTex[Sub]Image, glDrawPixels and - * glReadPixels. + * Do error checking for OpenGL 3.0 glTexImage with integer formats/types. */ @@ -32,93 +30,11 @@ PIGLIT_GL_TEST_CONFIG_BEGIN - config.supports_gl_compat_version = 10; + config.supports_gl_compat_version = 30; config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE; PIGLIT_GL_TEST_CONFIG_END -static bool -test_api_errors(void) -{ - /* clear any prev errors */ - while (glGetError()) - ; - - /* use a new tex obj */ - glBindTexture(GL_TEXTURE_2D, 42); - - /* Check that glDrawPixels of integer data is illegal */ - { - static const GLfloat pixel[4] = {0, 0, 0, 0}; - - glDrawPixels(1, 1, GL_RGBA_INTEGER_EXT, GL_INT, pixel); - if (!piglit_check_gl_error(GL_INVALID_OPERATION)) - return false; - } - - /* Check glTexImage for invalid internalFormat/format/type combos */ - { - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16UI_EXT, 1, 1, 0, -GL_RGBA_INTEGER, GL_FLOAT, NULL); - if (!piglit_check_gl_error(GL_INVALID_ENUM)) - return false; - - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 4, 4, 0, -GL_RGBA_INTEGER, GL_SHORT, NULL); - if (!piglit_check_gl_error(GL_INVALID_OPERATION)) - return false; - } - - /* Check glTexSubImage for invalid format/type combination */ - { - /* make valid texture image here */ - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32UI_EXT, 8, 8, 0, -GL_RGBA_INTEGER, GL_UNSIGNED_INT, NULL); - if (!piglit_check_gl_error(GL_NO_ERROR)) - return false; - - glTexSubImage2D(GL_TEXTURE_2D, 0, - 0, 0, 4, 4, - GL_RGBA_INTEGER, GL_FLOAT, NULL); - if (!piglit_check_gl_error(GL_INVALID_ENUM)) - return false; - } - - /* Check for GL_INVALID_OPERATION when trying to copy framebuffer pixels -* to an integer texture when the framebuffer is not an integer format. -*/ - { - /* make valid texture image here */ - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16UI_EXT, 4, 4, 0, -GL_RGBA_INTEGER, GL_UNSIGNED_SHORT, NULL); - if (!piglit_check_gl_error(GL_NO_ERROR)) - return false; - - glCopyTexSubImage2D(GL_TEXTURE_2D, 0, - 0, 0, 0, 0, 4, 4); - if (!piglit_check_gl_error(GL_INVALID_OPERATION)) - return false; - } - - /* Is GL_INVALID_ENUM generated by glReadPixels? */ - { - GLfloat buf[64]; - glReadPixels(0, 0, 4, 4, GL_RGBA_INTEGER, GL_FLOAT, buf); - if (!piglit_check_gl_error(GL_INVALID_ENUM)) - return false; - } - - /* Is GL_INVALID_OPERATION generated by glReadPixels? */ - { - GLuint buf[64]; - glReadPixels(0, 0, 4, 4, GL_RGBA_INTEGER, GL_UNSIGNED_INT, buf); - if (!piglit_check_gl_error(GL_INVALID_OPERATION)) - return false; - } - - return true; -} - /** * Test specific combinations of (internalFormat, format, type) with @@ -127,37 +43,74 @@ test_api_errors(void) static bool test_teximage_format_combos(void) { - /* These format combinations should all work */ - struct { - GLenum intFormat, srcFormat, srcType; - } formats[] = { - { GL_RGBA8UI_EXT, GL_RGBA_INTEGER, GL_UNSIGNED_BYTE }, - { GL_RGBA8UI_EXT, GL_RGBA_INTEGER, GL_SHORT }, - { GL_RGBA8UI_EXT, GL_RGBA_INTEGER,
[Piglit] [PATCH] util/wfl: remove log prints in success paths
Commit 04c9e870 introduced some debugging prints on success that make it clearer what's going on. However having these output for ever test seems unnecessary. Hide them behind compilation guards. Signed-off-by: Ilia Mirkin imir...@alum.mit.edu --- tests/util/piglit-framework-gl/piglit_wfl_framework.c | 4 1 file changed, 4 insertions(+) diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c b/tests/util/piglit-framework-gl/piglit_wfl_framework.c index e443f1b..a63f809 100644 --- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c +++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c @@ -438,9 +438,11 @@ special_case_gl31(struct piglit_wfl_framework *wfl_fw, * promise that the returned context will have the requested * profile. So Piglit has no need to check the profile here. */ +#if 0 piglit_logi(Requested an %s, and received a matching %d.%d context\n, context_description, actual_gl_version / 10, actual_gl_version % 10); +#endif return true; } @@ -451,12 +453,14 @@ special_case_gl31(struct piglit_wfl_framework *wfl_fw, return true; } +#if 0 piglit_logi(Requested an %s, and the returned context is exactly a 3.1 context. But it has the wrong profile because it %s the GL_ARB_compatibility extension. Fallback to requesting a 3.2 context, which is guaranteed to have the correct profile if context creation succeeds., context_description, error_verb); +#endif waffle_config_destroy(wfl_fw-config); waffle_context_destroy(wfl_fw-context); -- 1.8.5.5 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit