Re: [Piglit] [PATCH 00/40] Replace vpfp-generic with shader_runner.
On 7 June 2015 at 12:11, Kenneth Graunke kenn...@whitecape.org wrote: Hi all, This patch series ports all vpfp-generic tests to shader_runner, and then deletes vpfp-generic. A bit of history: - vpfp-generic was introduced by Nicolai Hähnle in 2009, as a generic ARB_vertex|fragment_program test runner. - shader_runner was introduced by Ian Romanick in 2010, as a generic GLSL shader runner. - shader_runner gained ARB program support in 2011 (courtesy of Eric Anholt). At this point, vpfp-generic is fairly redundant - shader_runner can do everything we need, and is much more widespread (12000+ tests). I've been meaning to delete it for a few years, but never got around to it. One difference is that the new tests don't glClear() before drawing. Since they draw the entire window, it's pretty unnecessary, and just makes the tests harder to debug. Many shader_runner tests don't bother clearing. This is actually annoying feature, esp if all tests use the same color for success, because we render one test, it passes, we render another test, it doesn't draw anything but it has gotten the back buffer from the previous tests, and it magically passes. This happens a lot more often on GPUs with VRAM. Dave. ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 00/13] Add more arb_shader_storage_buffer_object tests
On 05/06/15 09:50, Jordan Justen wrote: On 2015-05-13 23:17:12, Samuel Iglesias Gonsalvez wrote: This patchset adds piglit tests for arb_shader_storage_buffer_object extension. They are also available on this repository: $ git clone -b arb_shader_storage_buffer_object-v1 \ https://github.com/Igalia/piglit.git Thanks, Sam Samuel Iglesias Gonsalvez (13): arb_shader_storage_buffer_object: Add preprocessor tests arb_shader_storage_buffer_object: add compiler tests arb_shader_storage_buffer_object: Add linker tests arb_shader_storage_buffer: Add rendering test arb_shader_storage_buffer_object: add test for GL_MAX_SHADER_STORAGE_BUFFER_SIZE arb_shader_storage_buffer_object: add test to check glGetIntegeri_v() queries arb_shader_storage_buffer_object: Add new test for glDeleteBuffers() behavior arb_shader_storage_buffer_object: Add test to check maximum number of allowed SSBOs arb_shader_storage_buffer_object: New test for setting/getting block bindings. arb_shader_storage_buffer_object: Add test for setting binding point to an array of SSBOs arb_shader_storage_buffer_object: add test to check SSBO writes with layout(std430) arb_shader_storage_buffer_object: add test to check SSBO writes with layout(std140) arb_shader_storage_buffer_object: Add test for buffer variable queries tests/all.py | 21 ++ .../CMakeLists.gl.txt | 10 + .../array-ssbo-binding.c | 149 + .../extension-disabled-shader-storage-block.frag | 15 + .../compiler/extension-disabled-std430.frag| 13 + .../compiler/layout-std430-non-shader-storage.frag | 24 ++ .../compiler/layout-std430-within-block.frag | 22 ++ .../compiler/shader-storage-block-initializer.frag | 21 ++ .../compiler/shader-storage-block-sampler.frag | 23 ++ .../compiler/shader-storage-outside-block.frag | 20 ++ .../compiler/unsized-array-argument-function.frag | 29 ++ .../unsized-array-not-in-last-position.frag| 24 ++ .../deletebuffers.c| 105 ++ .../getintegeri_v.c| 120 +++ .../layout-std140-write-shader.c | 161 + .../layout-std430-write-shader.c | 185 +++ ...hader-storage-block-different-def-2.shader_test | 40 +++ ...hader-storage-block-different-def-3.shader_test | 40 +++ .../shader-storage-block-different-def.shader_test | 38 +++ ...shader-storage-block-different-size.shader_test | 41 +++ .../arb_shader_storage_buffer_object/maxblocks.c | 358 + .../maxshaderstorageblocksize.c| 240 ++ .../preprocessor/define.frag | 19 ++ .../preprocessor/define.vert | 19 ++ .../program-interface-query.c | 166 ++ .../arb_shader_storage_buffer_object/rendering.c | 232 + .../shaderstorageblockbinding.c| 125 +++ 27 files changed, 2260 insertions(+) create mode 100644 tests/spec/arb_shader_storage_buffer_object/array-ssbo-binding.c create mode 100644 tests/spec/arb_shader_storage_buffer_object/compiler/extension-disabled-shader-storage-block.frag create mode 100644 tests/spec/arb_shader_storage_buffer_object/compiler/extension-disabled-std430.frag create mode 100644 tests/spec/arb_shader_storage_buffer_object/compiler/layout-std430-non-shader-storage.frag create mode 100644 tests/spec/arb_shader_storage_buffer_object/compiler/layout-std430-within-block.frag create mode 100644 tests/spec/arb_shader_storage_buffer_object/compiler/shader-storage-block-initializer.frag create mode 100644 tests/spec/arb_shader_storage_buffer_object/compiler/shader-storage-block-sampler.frag create mode 100644 tests/spec/arb_shader_storage_buffer_object/compiler/shader-storage-outside-block.frag create mode 100644 tests/spec/arb_shader_storage_buffer_object/compiler/unsized-array-argument-function.frag create mode 100644 tests/spec/arb_shader_storage_buffer_object/compiler/unsized-array-not-in-last-position.frag create mode 100644 tests/spec/arb_shader_storage_buffer_object/deletebuffers.c create mode 100644 tests/spec/arb_shader_storage_buffer_object/getintegeri_v.c create mode 100644 tests/spec/arb_shader_storage_buffer_object/layout-std140-write-shader.c create mode 100644 tests/spec/arb_shader_storage_buffer_object/layout-std430-write-shader.c create mode 100644 tests/spec/arb_shader_storage_buffer_object/linker/shader-storage-block-different-def-2.shader_test create mode 100644 tests/spec/arb_shader_storage_buffer_object/linker/shader-storage-block-different-def-3.shader_test create mode 100644
Re: [Piglit] [PATCH 00/40] Replace vpfp-generic with shader_runner.
On 8 June 2015 at 15:31, Kenneth Graunke kenn...@whitecape.org wrote: On Monday, June 08, 2015 06:29:26 AM Dave Airlie wrote: On 7 June 2015 at 12:11, Kenneth Graunke kenn...@whitecape.org wrote: Hi all, This patch series ports all vpfp-generic tests to shader_runner, and then deletes vpfp-generic. A bit of history: - vpfp-generic was introduced by Nicolai Hähnle in 2009, as a generic ARB_vertex|fragment_program test runner. - shader_runner was introduced by Ian Romanick in 2010, as a generic GLSL shader runner. - shader_runner gained ARB program support in 2011 (courtesy of Eric Anholt). At this point, vpfp-generic is fairly redundant - shader_runner can do everything we need, and is much more widespread (12000+ tests). I've been meaning to delete it for a few years, but never got around to it. One difference is that the new tests don't glClear() before drawing. Since they draw the entire window, it's pretty unnecessary, and just makes the tests harder to debug. Many shader_runner tests don't bother clearing. This is actually annoying feature, esp if all tests use the same color for success, because we render one test, it passes, we render another test, it doesn't draw anything but it has gotten the back buffer from the previous tests, and it magically passes. This happens a lot more often on GPUs with VRAM. Dave. I don't know...the tests probe the entire window...so the only failure mode that will bite you like that is the driver didn't render anything at all. And the assumption is that, even with such a broken driver, clearing will actually succeed at drawing... Yes but what happens if all the tests run and don't bother clearing, so drawing fails in test 1, test 2 passes because it doesn't clear, and it gets test1 result frame, where it passed, It looks like test2 passes when it clearly hasn't. You've actually said it, clearing would succeed, but the problem is the tests don't clear. and yes there are many reasons things don't render, the main one I see if where an earlier test has locked up the GPU but not totally. Dave. ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 00/40] Replace vpfp-generic with shader_runner.
On Monday, June 08, 2015 06:29:26 AM Dave Airlie wrote: On 7 June 2015 at 12:11, Kenneth Graunke kenn...@whitecape.org wrote: Hi all, This patch series ports all vpfp-generic tests to shader_runner, and then deletes vpfp-generic. A bit of history: - vpfp-generic was introduced by Nicolai Hähnle in 2009, as a generic ARB_vertex|fragment_program test runner. - shader_runner was introduced by Ian Romanick in 2010, as a generic GLSL shader runner. - shader_runner gained ARB program support in 2011 (courtesy of Eric Anholt). At this point, vpfp-generic is fairly redundant - shader_runner can do everything we need, and is much more widespread (12000+ tests). I've been meaning to delete it for a few years, but never got around to it. One difference is that the new tests don't glClear() before drawing. Since they draw the entire window, it's pretty unnecessary, and just makes the tests harder to debug. Many shader_runner tests don't bother clearing. This is actually annoying feature, esp if all tests use the same color for success, because we render one test, it passes, we render another test, it doesn't draw anything but it has gotten the back buffer from the previous tests, and it magically passes. This happens a lot more often on GPUs with VRAM. Dave. I don't know...the tests probe the entire window...so the only failure mode that will bite you like that is the driver didn't render anything at all. And the assumption is that, even with such a broken driver, clearing will actually succeed at drawing... Is that really so common? i965 will usually either draw something, or fail so spectacularly that even clear doesn't work... signature.asc Description: This is a digitally signed message part. ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 2/4] arb_arrays_of_arrays: add simple atomic counters execution test
Test results: Nvidia GeForce 840M - NVIDIA 346.47: pass --- .../vs-simple-inc-dec-read.shader_test | 119 + 1 file changed, 119 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/execution/atomic_counters/vs-simple-inc-dec-read.shader_test diff --git a/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/vs-simple-inc-dec-read.shader_test b/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/vs-simple-inc-dec-read.shader_test new file mode 100644 index 000..4233448 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/atomic_counters/vs-simple-inc-dec-read.shader_test @@ -0,0 +1,119 @@ +# Simple test of atomicCounterIncrement, atomicCounterDecrement and +# atomicCounter being used in the VS. + +[require] +GLSL = 1.40 +GL_ARB_shader_atomic_counters +GL_ARB_arrays_of_arrays +INT GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 2 + +[vertex shader] +#version 140 +#extension GL_ARB_shader_atomic_counters: require +#extension GL_ARB_arrays_of_arrays: require + +layout(binding = 0) uniform atomic_uint a0[2][4]; +layout(binding = 0) uniform atomic_uint a1[3][2][2]; + +in vec4 piglit_vertex; +out vec4 vcolor; + +void main() +{ + bool passed = true; + uint v0[12]; + uint v1[12]; + + /* Get all initail values of a0 */ + v0[0] = atomicCounter(a0[0][0]); + v0[1] = atomicCounter(a0[0][1]); + v0[2] = atomicCounter(a0[0][2]); + v0[3] = atomicCounter(a0[0][3]); + v0[4] = atomicCounter(a0[1][0]); + v0[5] = atomicCounter(a0[1][1]); + v0[6] = atomicCounter(a0[1][2]); + v0[7] = atomicCounter(a0[1][3]); + + /* Test that incrementing, followed by a read of an atomic +* counter results in a larger value. +* Also test that all other array elements are unaffected. */ + atomicCounterIncrement(a0[0][0]); + atomicCounterIncrement(a0[1][2]); + v1[0] = atomicCounter(a0[0][0]); + v1[1] = atomicCounter(a0[0][1]); + v1[2] = atomicCounter(a0[0][2]); + v1[3] = atomicCounter(a0[0][3]); + v1[4] = atomicCounter(a0[1][0]); + v1[5] = atomicCounter(a0[1][1]); + v1[6] = atomicCounter(a0[1][2]); + v1[7] = atomicCounter(a0[1][3]); + if(v1[0] = v0[0] v1[1] != v0[1] v1[2] != v0[2] + v1[3] != v0[3] v1[4] != v0[4] v1[5] != v0[5] + v1[6] = v0[6] v1[7] != v0[7]) + passed = false; + + /* Get all initail values of a1 */ + v0[0] = atomicCounter(a1[0][0][0]); + v0[1] = atomicCounter(a1[0][0][1]); + v0[2] = atomicCounter(a1[0][1][0]); + v0[3] = atomicCounter(a1[0][1][1]); + v0[4] = atomicCounter(a1[1][0][0]); + v0[5] = atomicCounter(a1[1][0][0]); + v0[6] = atomicCounter(a1[1][0][1]); + v0[7] = atomicCounter(a1[1][1][0]); + v0[8] = atomicCounter(a1[2][0][0]); + v0[9] = atomicCounter(a1[2][0][0]); + v0[10] = atomicCounter(a1[2][0][1]); + v0[11] = atomicCounter(a1[2][1][0]); + + /* Skip one decrement since it may be the 0 = 0x +* transition. +*/ + atomicCounterDecrement(a1[2][0][1]); + + /* Test that a decrement of an atomic +* counter results in a smaller value. +* Also test that all other array elements are unaffected. +*/ + v1[0] = atomicCounter(a1[0][0][0]); + v1[1] = atomicCounter(a1[0][0][1]); + v1[2] = atomicCounter(a1[0][1][0]); + v1[3] = atomicCounterDecrement(a1[0][1][1]); + v1[4] = atomicCounter(a1[1][0][0]); + v1[5] = atomicCounter(a1[1][0][1]); + v1[6] = atomicCounter(a1[1][1][0]); + v1[7] = atomicCounter(a1[1][1][1]); + v1[8] = atomicCounter(a1[2][0][0]); + v1[9] = atomicCounterDecrement(a1[2][0][1]); + v1[10] = atomicCounter(a1[2][1][0]); + v1[11] = atomicCounter(a1[2][1][1]); + + if(v1[0] != v0[0] v1[1] != v0[1] v1[2] != v0[2] + v1[3] = v0[3] v1[4] != v0[4] v1[5] != v0[5] + v1[6] != v0[6] v1[7] != v0[7] v1[8] != v0[8] + v1[9] = v0[9] v1[10] != v0[10] v1[11] != v0[11]) + passed = false; + + if (passed) + vcolor = vec4(0.0, 1.0, 0.0, 1.0); + else + vcolor = vec4(1.0, 0.0, 0.0, 1.0); + + gl_Position = piglit_vertex; +} + +[fragment shader] +#version 140 +in vec4 vcolor; +out vec4 fcolor; + +void main() +{ + fcolor = vcolor; +} + +[test] +atomic counters 2 + +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 1.0 -- 2.1.0 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 4/4] arb_arrays_of_arrays: basic image store execution tests
Test results: Nvidia GeForce 840M - NVIDIA 346.47 basic-imageStore-const-uniform-index.shader_test - pass basic-imageStore-non-const-uniform-index.shader_test - pass --- ...asic-imageStore-const-uniform-index.shader_test | 58 ...-imageStore-non-const-uniform-index.shader_test | 101 + 2 files changed, 159 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-const-uniform-index.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-non-const-uniform-index.shader_test diff --git a/tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-const-uniform-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-const-uniform-index.shader_test new file mode 100644 index 000..0009f86 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-const-uniform-index.shader_test @@ -0,0 +1,58 @@ +# Verify simple reading of a uniform and output to an image + +[require] +GL = 3.3 +GLSL = 3.30 +GL_ARB_shader_image_load_store +GL_ARB_arrays_of_arrays + +[vertex shader] +#version 130 +in vec4 piglit_vertex; + +void main() +{ + gl_Position = piglit_vertex; +} + +[fragment shader] +#version 330 +#extension GL_ARB_shader_image_load_store: enable +#extension GL_ARB_arrays_of_arrays: require + +uniform vec4 color; +writeonly uniform image2D tex[2][2]; +out vec4 outcolor; + +void main() +{ + imageStore(tex[1][0], ivec2(gl_FragCoord.xy), color); + outcolor = vec4(0.0, 0.0, 0.0, 1.0); +} + +[test] +# Texture 0 is the imageStore output. +uniform int tex[1][0] 0 +texture rgbw 0 (16, 16) +image texture 0 + +# Texture 1 is the rendering output. We don't care about this. +texture rgbw 1 (16, 16) + +# Store red using imageStore +uniform vec4 color 1.0 0.0 0.0 1.0 +fb tex 2d 1 +draw rect -1 -1 2 2 + +# Test the result of imageStore +fb tex 2d 0 +probe all rgba 1.0 0.0 0.0 1.0 + +# Store green using imageStore +uniform vec4 color 0.0 1.0 0.0 1.0 +fb tex 2d 1 +draw rect -1 -1 2 2 + +# Test the result of imageStore +fb tex 2d 0 +probe all rgba 0.0 1.0 0.0 1.0 diff --git a/tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-non-const-uniform-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-non-const-uniform-index.shader_test new file mode 100644 index 000..f5271e6 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-non-const-uniform-index.shader_test @@ -0,0 +1,101 @@ +# Verify simple reading of a uniform and output to an image + +[require] +GL = 3.3 +GLSL = 3.30 +GL_ARB_shader_image_load_store +GL_ARB_arrays_of_arrays + +[vertex shader] +#version 130 +in vec4 piglit_vertex; + +void main() +{ + gl_Position = piglit_vertex; +} + +[fragment shader] +#version 330 +#extension GL_ARB_shader_image_load_store: enable +#extension GL_ARB_arrays_of_arrays: require + +uniform vec4 color; +uniform int n; +uniform int m; +writeonly uniform image2D tex[2][2]; +out vec4 outcolor; + +void main() +{ + imageStore(tex[n][m], ivec2(gl_FragCoord.xy), color); + outcolor = vec4(0.0, 0.0, 0.0, 1.0); +} + +[test] +# Texture 0 is the imageStore output. +uniform int tex[0][0] 0 +texture rgbw 0 (16, 16) +image texture 0 + +# Texture 1 is the imageStore output. +uniform int tex[0][1] 1 +texture rgbw 1 (16, 16) +image texture 1 + +# Texture 2 is the imageStore output. +uniform int tex[1][0] 2 +texture rgbw 2 (16, 16) +image texture 2 + +# Texture 3 is the imageStore output. +uniform int tex[1][1] 3 +texture rgbw 3 (16, 16) +image texture 3 + +# Texture 4 is the rendering output. We don't care about this. +texture rgbw 4 (16, 16) + +# Store red using imageStore +uniform int n 0 +uniform int m 0 +uniform vec4 color 1.0 0.0 0.0 1.0 +fb tex 2d 4 +draw rect -1 -1 2 2 + +# Test the result of imageStore 0 +fb tex 2d 0 +probe all rgba 1.0 0.0 0.0 1.0 + +# Store green using imageStore +uniform int n 0 +uniform int m 1 +uniform vec4 color 0.0 1.0 0.0 1.0 +fb tex 2d 4 +draw rect -1 -1 2 2 + +# Test the result of imageStore 1 +fb tex 2d 1 +probe all rgba 0.0 1.0 0.0 1.0 + +# Store blue using imageStore +uniform int n 1 +uniform int m 0 +uniform vec4 color 0.0 0.0 1.0 1.0 +fb tex 2d 4 +draw rect -1 -1 2 2 + +# Test the result of imageStore 2 +fb tex 2d 2 +probe all rgba 0.0 0.0 1.0 1.0 + +# Store cyan using imageStore +uniform int n 1 +uniform int m 1 +uniform vec4 color 0.0 1.0 1.0 1.0 +fb tex 2d 4 +draw rect -1 -1 2 2 + +# Test the result of imageStore 3 +fb tex 2d 3 +probe all rgba 0.0 1.0 1.0 1.0 -- 2.1.0 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 1/4] arb_arrays_of_arrays: test binding limits for uniforms
Test results: Nvidia GeForce 840M - NVIDIA 346.47: fail --- tests/all.py | 6 + tests/spec/CMakeLists.txt | 1 + tests/spec/arb_arrays_of_arrays/CMakeLists.gl.txt | 15 ++ tests/spec/arb_arrays_of_arrays/CMakeLists.txt| 1 + tests/spec/arb_arrays_of_arrays/max-binding.c | 208 ++ 5 files changed, 231 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/CMakeLists.gl.txt create mode 100644 tests/spec/arb_arrays_of_arrays/CMakeLists.txt create mode 100644 tests/spec/arb_arrays_of_arrays/max-binding.c diff --git a/tests/all.py b/tests/all.py index 6c4742b..49e96ab 100755 --- a/tests/all.py +++ b/tests/all.py @@ -1663,6 +1663,12 @@ with profile.group_manager( g(['amd_performance_monitor_api'], 'api', run_concurrent=False) g(['amd_performance_monitor_measure'], 'measure', run_concurrent=False) +# Group ARB_arrays_of_arrays +with profile.group_manager( +PiglitGLTest, +grouptools.join('spec', 'ARB_arrays_of_arrays')) as g: +g(['arb_arrays_of_arrays-max-binding'], run_concurrent=False) + # Group ARB_point_sprite with profile.group_manager( PiglitGLTest, grouptools.join('spec', 'ARB_point_sprite')) as g: diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt index 2ce4692..c282936 100644 --- a/tests/spec/CMakeLists.txt +++ b/tests/spec/CMakeLists.txt @@ -1,5 +1,6 @@ add_subdirectory (amd_performance_monitor) add_subdirectory (amd_pinned_memory) +add_subdirectory (arb_arrays_of_arrays) add_subdirectory (arb_base_instance) add_subdirectory (arb_buffer_storage) add_subdirectory (arb_clear_buffer_object) diff --git a/tests/spec/arb_arrays_of_arrays/CMakeLists.gl.txt b/tests/spec/arb_arrays_of_arrays/CMakeLists.gl.txt new file mode 100644 index 000..276fa52 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/CMakeLists.gl.txt @@ -0,0 +1,15 @@ +include_directories( + ${GLEXT_INCLUDE_DIR} + ${OPENGL_INCLUDE_PATH} + ${piglit_SOURCE_DIR}/tests/util +) + +link_libraries ( + piglitutil_${piglit_target_api} + ${OPENGL_gl_LIBRARY} + ${OPENGL_glu_LIBRARY} +) + +piglit_add_executable (arb_arrays_of_arrays-max-binding max-binding.c) + +# vim: ft=cmake: diff --git a/tests/spec/arb_arrays_of_arrays/CMakeLists.txt b/tests/spec/arb_arrays_of_arrays/CMakeLists.txt new file mode 100644 index 000..144a306 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/CMakeLists.txt @@ -0,0 +1 @@ +piglit_include_target_api() diff --git a/tests/spec/arb_arrays_of_arrays/max-binding.c b/tests/spec/arb_arrays_of_arrays/max-binding.c new file mode 100644 index 000..0d6d27b --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/max-binding.c @@ -0,0 +1,208 @@ +/* + * Copyright © 2015 Intel Corporation + * + * 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 max-binding.c + * + * Test that using more than the maximum number of suported interface block, + * sampler, or atomic bindings fails with a compile error. + */ + +#include piglit-util-gl.h + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_core_version = 32; + + config.window_width = 1; + config.window_height = 1; + config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA; + +PIGLIT_GL_TEST_CONFIG_END + +static bool +generate_and_compile_shader(GLuint stage, const char *src_template, + unsigned binding) +{ + char *src; + int ret; + + ret = asprintf(src, src_template, binding); + assert(ret); + + ret = piglit_compile_shader_text_nothrow(stage, src); + + free(src); + return ret; +} + +static bool +run_test_sampler_max_bindings(unsigned binding) +{ + const char *src_template = #version 150\n + #extension GL_ARB_arrays_of_arrays : enable\n + #extension
[Piglit] [PATCH 3/4] arb_arrays_of_arrays: add basic linking tests for atomic counters
Test results: Nvidia GeForce 840M - NVIDIA 346.47 vs-to-fs-atomic-counter-mismatch.shader_test - fail vs-to-fs-atomic-counter.shader_test - pass --- .../vs-to-fs-atomic-counter-mismatch.shader_test | 38 ++ .../linker/vs-to-fs-atomic-counter.shader_test | 38 ++ 2 files changed, 76 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-atomic-counter-mismatch.shader_test create mode 100644 tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-atomic-counter.shader_test diff --git a/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-atomic-counter-mismatch.shader_test b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-atomic-counter-mismatch.shader_test new file mode 100644 index 000..6ac6522 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-atomic-counter-mismatch.shader_test @@ -0,0 +1,38 @@ +# Test for linking error between vertex and fragment shaders +# with mismatching AoA atomic counter declorations + +[require] +GLSL = 1.40 +GL_ARB_shader_atomic_counters +GL_ARB_arrays_of_arrays + +[vertex shader] +#version 140 +#extension GL_ARB_arrays_of_arrays: enable +#extension GL_ARB_shader_atomic_counters: enable + +layout(binding = 0) uniform atomic_uint a1[3][2][2]; + +in vec4 piglit_vertex; + +void main() +{ + gl_Position = piglit_vertex; +} + +[fragment shader] +#version 140 +#extension GL_ARB_arrays_of_arrays: enable +#extension GL_ARB_shader_atomic_counters: enable + +layout(binding = 0) uniform atomic_uint a1[2][2][2]; + +out vec4 fcolor; + +void main() +{ + fcolor = vec4(1.0); +} + +[test] +link error diff --git a/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-atomic-counter.shader_test b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-atomic-counter.shader_test new file mode 100644 index 000..2998e25 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/linker/vs-to-fs-atomic-counter.shader_test @@ -0,0 +1,38 @@ +# Test for successful linking between vertex and fragment shaders +# with matching AoA atomic counter declorations + +[require] +GLSL = 1.40 +GL_ARB_shader_atomic_counters +GL_ARB_arrays_of_arrays + +[vertex shader] +#version 140 +#extension GL_ARB_arrays_of_arrays: enable +#extension GL_ARB_shader_atomic_counters: enable + +layout(binding = 0) uniform atomic_uint a1[3][2][2]; + +in vec4 piglit_vertex; + +void main() +{ + gl_Position = piglit_vertex; +} + +[fragment shader] +#version 140 +#extension GL_ARB_arrays_of_arrays: enable +#extension GL_ARB_shader_atomic_counters: enable + +layout(binding = 0) uniform atomic_uint a1[3][2][2]; + +out vec4 fcolor; + +void main() +{ + fcolor = vec4(1.0); +} + +[test] +link success -- 2.1.0 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit