Re: [Piglit] [PATCH V3] arb_separate_shader_objects: test mixed explicit and non-explicit locations
On Wed, 25 Nov 2015 13:45:51 +1100 Timothy Arceri <timothy.arc...@collabora.com> wrote: > From: Timothy Arceri <t_arc...@yahoo.com.au> > > This tests a bug in Mesa where explicit locations are not taken into > account when assigning varying locations which results in two > inputs/outputs being given the same location. > > Test results: > Nvidia GeForce 840M - NVIDIA 352.41: pass > i965 - Mesa 11.1-dev: fail > > V3: > - use helper function to format and link shaders > - add array and arrays of arrays subtests > - allow test to be run concurrently > > V2: use pick_a_glsl_version() helper > > Cc: Gregory Hainaut <gregory.hain...@gmail.com> > --- > tests/all.py | 2 + > .../arb_separate_shader_objects/CMakeLists.gl.txt | 1 + > .../mixed_explicit_and_non_explicit_locations.c| 343 > + > 3 files changed, 346 insertions(+) > create mode 100644 > tests/spec/arb_separate_shader_objects/mixed_explicit_and_non_explicit_locations.c > > diff --git a/tests/all.py b/tests/all.py > index 07e3599..7689796 100644 > --- a/tests/all.py > +++ b/tests/all.py > @@ -2161,6 +2161,8 @@ with profile.group_manager( >'Rendezvous by name') > g(['arb_separate_shader_object-rendezvous_by_name_interpolation'], >'Rendezvous by name with multiple interpolation qualifier') > + > g(['arb_separate_shader_object-mixed_explicit_and_non_explicit_locations'], > + 'Mixed explicit and non-explicit locations') > g(['arb_separate_shader_object-rendezvous_by_location', '-fbo'], >'Rendezvous by location', run_concurrent=False) > g(['arb_separate_shader_object-rendezvous_by_location-5-stages'], > diff --git a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt > b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt > index b4fce73..8e4011f 100644 > --- a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt > +++ b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt > @@ -15,6 +15,7 @@ piglit_add_executable > (arb_separate_shader_object-compat-builtins compat-builtin > piglit_add_executable > (arb_separate_shader_object-explicit_locations_and_transform_feedback > explicit_locations_and_transform_feedback.c) > piglit_add_executable (arb_separate_shader_object-GetProgramPipelineiv > GetProgramPipelineiv.c) > piglit_add_executable (arb_separate_shader_object-IsProgramPipeline > IsProgramPipeline.c) > +piglit_add_executable > (arb_separate_shader_object-mixed_explicit_and_non_explicit_locations > mixed_explicit_and_non_explicit_locations.c sso-common.c) > piglit_add_executable (arb_separate_shader_object-ProgramUniform-coverage > ProgramUniform-coverage.c) > piglit_add_executable (arb_separate_shader_object-rendezvous_by_location > rendezvous_by_location.c sso-common.c) > piglit_add_executable > (arb_separate_shader_object-rendezvous_by_location-3-stages > rendezvous_by_location-3-stages.c) > diff --git > a/tests/spec/arb_separate_shader_objects/mixed_explicit_and_non_explicit_locations.c > > b/tests/spec/arb_separate_shader_objects/mixed_explicit_and_non_explicit_locations.c > new file mode 100644 > index 000..3bca2bc > --- /dev/null > +++ > b/tests/spec/arb_separate_shader_objects/mixed_explicit_and_non_explicit_locations.c > @@ -0,0 +1,343 @@ > +/* > + * 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. > + */ > + > +/** > + * This tests a bug in Mesa where explicit locations are not taken into > + *
[Piglit] [PATCH V5 2/2] SSO: new test to ensure matching with various qualifier
Test is composed of 2 major steps. First part ensure that a matching (same on both VS & FS) qualifier doesn't pertubate the location assignment Second part ensure that a non-matching qualifier also work. Final interpolation qualifier is the one of the FS. Technically it is only allowed from GLSL4.5. However I don't know if any gl implementation really implement this constraint. v5: * rely on pick_a_glsl_version (sso-common) * Update test description v2: add the test to all.py Reviewed-by: Timothy Arceri <timothy.arc...@collabora.com> Signed-off-by: Gregory Hainaut <gregory.hain...@gmail.com> --- tests/all.py | 2 + .../arb_separate_shader_objects/CMakeLists.gl.txt | 1 + .../rendezvous_by_name_interpolation.c | 207 + 3 files changed, 210 insertions(+) create mode 100644 tests/spec/arb_separate_shader_objects/rendezvous_by_name_interpolation.c diff --git a/tests/all.py b/tests/all.py index c9b4ffa..21bee3d 100644 --- a/tests/all.py +++ b/tests/all.py @@ -2152,6 +2152,8 @@ with profile.group_manager( 'ProgramUniform coverage') g(['arb_separate_shader_object-rendezvous_by_name'], 'Rendez vous by name') +g(['arb_separate_shader_object-rendezvous_by_name_interpolation'], + 'Rendez vous by name with multiple interpolation qualifier') g(['arb_separate_shader_object-rendezvous_by_location', '-fbo'], 'Rendezvous by location', run_concurrent=False) g(['arb_separate_shader_object-rendezvous_by_location-5-stages'], diff --git a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt index 3957409..1dc5f14 100644 --- a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt +++ b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt @@ -19,5 +19,6 @@ piglit_add_executable (arb_separate_shader_object-rendezvous_by_location rendezv piglit_add_executable (arb_separate_shader_object-rendezvous_by_location-3-stages rendezvous_by_location-3-stages.c) piglit_add_executable (arb_separate_shader_object-rendezvous_by_location-5-stages rendezvous_by_location-5-stages.c) piglit_add_executable (arb_separate_shader_object-rendezvous_by_name rendezvous_by_name.c sso-common.c) +piglit_add_executable (arb_separate_shader_object-rendezvous_by_name_interpolation rendezvous_by_name_interpolation.c sso-common.c) piglit_add_executable (arb_separate_shader_object-UseProgramStages-non-separable UseProgramStages-non-separable.c) piglit_add_executable (arb_separate_shader_object-ValidateProgramPipeline ValidateProgramPipeline.c) diff --git a/tests/spec/arb_separate_shader_objects/rendezvous_by_name_interpolation.c b/tests/spec/arb_separate_shader_objects/rendezvous_by_name_interpolation.c new file mode 100644 index 000..98d3f43 --- /dev/null +++ b/tests/spec/arb_separate_shader_objects/rendezvous_by_name_interpolation.c @@ -0,0 +1,207 @@ +/* + * Copyright © 2015 Gregory Hainaut <gregory.hain...@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. + */ + +/** + * \file rendezvous_by_name_interpolation.c + * Simple test for separate shader objects that use rendezvous-by-name. + * + * This test ensures that multiple interpolation qualifiers don't break + * interface matching. + * + * We first test matching of a VS and FS with matching interpolation + * qualifiers. Next we ensure that non-matching interpolation qualifiers + * also work. Technically interpolation mismatching is only allowed + * starting with GLSL 4.5 however its unlikely any implementation inforces + * this constraint. + */ +#include "piglit-util-gl.h" +#include "sso-common.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 10; + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
Re: [Piglit] [PATCH] arb_separate_shader_objects: test mixed explicit and non-explicit locations
Hello Timothy, Normally the first of the 2 new SSO tests that I sent a couple of weeks ago cover this case. However my test is limited to the first location. Hopefully my Mesa patches take care of the issue. I will check it with this new test (and rebase my patches) Best regards, Gregory On 11/17/15, Timothy Arceri <t_arc...@yahoo.com.au> wrote: > This tests a bug in Mesa where explicit locations are not taken into > account when assigning varying locations which results in two > inputs/outputs being given the same location. > > Test results: > Nvidia GeForce 840M - NVIDIA 352.41: pass > i965 - Mesa 11.1-dev: fail > > Cc: Ian Romanick <ian.d.roman...@intel.com> > Cc: Gregory Hainaut <gregory.hain...@gmail.com> > --- > tests/all.py | 2 + > .../arb_separate_shader_objects/CMakeLists.gl.txt | 1 + > .../mixed_explicit_and_non_explicit_locations.c| 158 > + > 3 files changed, 161 insertions(+) > create mode 100644 > tests/spec/arb_separate_shader_objects/mixed_explicit_and_non_explicit_locations.c > > diff --git a/tests/all.py b/tests/all.py > index 4d6c781..376cad0 100644 > --- a/tests/all.py > +++ b/tests/all.py > @@ -2150,6 +2150,8 @@ with profile.group_manager( >'UseProgramStages - non-separable program') > g(['arb_separate_shader_object-ProgramUniform-coverage'], >'ProgramUniform coverage') > + > g(['arb_separate_shader_object-mixed_explicit_and_non_explicit_locations', > '-fbo'], > + 'Mixed explicit and non-explicit locations', run_concurrent=False) > g(['arb_separate_shader_object-rendezvous_by_location', '-fbo'], >'Rendezvous by location', run_concurrent=False) > g(['arb_separate_shader_object-rendezvous_by_location-5-stages'], > diff --git a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt > b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt > index f1b15c0..e8311e3 100644 > --- a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt > +++ b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt > @@ -15,6 +15,7 @@ piglit_add_executable > (arb_separate_shader_object-compat-builtins compat-builtin > piglit_add_executable (arb_separate_shader_object-GetProgramPipelineiv > GetProgramPipelineiv.c) > piglit_add_executable (arb_separate_shader_object-IsProgramPipeline > IsProgramPipeline.c) > piglit_add_executable (arb_separate_shader_object-ProgramUniform-coverage > ProgramUniform-coverage.c) > +piglit_add_executable > (arb_separate_shader_object-mixed_explicit_and_non_explicit_locations > mixed_explicit_and_non_explicit_locations.c) > piglit_add_executable (arb_separate_shader_object-rendezvous_by_location > rendezvous_by_location.c) > piglit_add_executable > (arb_separate_shader_object-rendezvous_by_location-3-stages > rendezvous_by_location-3-stages.c) > piglit_add_executable > (arb_separate_shader_object-rendezvous_by_location-5-stages > rendezvous_by_location-5-stages.c) > diff --git > a/tests/spec/arb_separate_shader_objects/mixed_explicit_and_non_explicit_locations.c > b/tests/spec/arb_separate_shader_objects/mixed_explicit_and_non_explicit_locations.c > new file mode 100644 > index 000..d0ad73c > --- /dev/null > +++ > b/tests/spec/arb_separate_shader_objects/mixed_explicit_and_non_explicit_locations.c > @@ -0,0 +1,158 @@ > +/* > + * 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. > + */ > + > +/** > + * This tests a bug in Mesa where explicit locatio
[Piglit] [PATCH 2/2] SSO: new test to ensure matching with various qualifier
Test is composed of 2 major steps. First part ensure that a matching (same on both VS & FS) qualifier doesn't pertubate the location assignment Second part ensure that a non-matching qualifier also work. Final interpolation qualifier is the one of the FS. Technically it is only allowed from GLSL4.5. However I don't know if any gl implementation really implement this constraint. v2: add the test to all.py Signed-off-by: Gregory Hainaut <gregory.hain...@gmail.com> --- tests/all.py | 2 + .../arb_separate_shader_objects/CMakeLists.gl.txt | 1 + .../rendezvous_by_name_interpolation.c | 210 + 3 files changed, 213 insertions(+) create mode 100644 tests/spec/arb_separate_shader_objects/rendezvous_by_name_interpolation.c diff --git a/tests/all.py b/tests/all.py index 35c330b..585e39d 100644 --- a/tests/all.py +++ b/tests/all.py @@ -2147,6 +2147,8 @@ with profile.group_manager( 'ProgramUniform coverage') g(['arb_separate_shader_object-rendezvous_by_name'], 'Rendez vous by name') +g(['arb_separate_shader_object-rendezvous_by_name_interpolation'], + 'Rendez vous by name with multiple interpolation qualifier') g(['arb_separate_shader_object-rendezvous_by_location', '-fbo'], 'Rendezvous by location', run_concurrent=False) g(['arb_separate_shader_object-rendezvous_by_location-5-stages'], diff --git a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt index 9ab6606..22a04b7 100644 --- a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt +++ b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt @@ -19,5 +19,6 @@ piglit_add_executable (arb_separate_shader_object-rendezvous_by_location rendezv piglit_add_executable (arb_separate_shader_object-rendezvous_by_location-3-stages rendezvous_by_location-3-stages.c) piglit_add_executable (arb_separate_shader_object-rendezvous_by_location-5-stages rendezvous_by_location-5-stages.c) piglit_add_executable (arb_separate_shader_object-rendezvous_by_name rendezvous_by_name.c) +piglit_add_executable (arb_separate_shader_object-rendezvous_by_name_interpolation rendezvous_by_name_interpolation.c) piglit_add_executable (arb_separate_shader_object-UseProgramStages-non-separable UseProgramStages-non-separable.c) piglit_add_executable (arb_separate_shader_object-ValidateProgramPipeline ValidateProgramPipeline.c) diff --git a/tests/spec/arb_separate_shader_objects/rendezvous_by_name_interpolation.c b/tests/spec/arb_separate_shader_objects/rendezvous_by_name_interpolation.c new file mode 100644 index 000..5a99871 --- /dev/null +++ b/tests/spec/arb_separate_shader_objects/rendezvous_by_name_interpolation.c @@ -0,0 +1,210 @@ +/* + * Copyright © 2015 Gregory Hainaut <gregory.hain...@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. + */ + +/** + * \file rendezvous_by_name_interpolation.c + * Simple test for separate shader objects that use rendezvous-by-name. + * + * The test ensures that multiple interpolation qualifier doesn't break + * the interface matching. + */ +#include "piglit-util-gl.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 10; + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + +static GLuint pipeline_match[4]; +static GLuint pipeline_unmatch[4]; + +static const char *vs_code_template = + "#version %d\n" + "#extension GL_ARB_separate_shader_objects: require\n" + "#extension GL_ARB_explicit_attrib_location: require\n" + "\n" + "layout(location = 0) in vec4 piglit_vertex;\n" + "\n" + "%s out vec4 blue;\n" + "%s out vec4 green;\n&quo
[Piglit] [PATCH 0/2] V4: SSO: new test to ensure correct deadcode optimization
Related to mesa issue: https://bugs.freedesktop.org/show_bug.cgi?id=79783 Mostly "Validated" on Nvidia driver. Nvidia fails to link vs_fs_prog_separate_inactive on first test v4: * Add both test to all.py v3: * Add a new test to ensure matching with various qualifier To be discussed. I don't know, if behavior is acceptable/legit for version below GLSL4.5 v2: * Test both output and input are still active * Test real interstage variable are still optimized * Mix rendezvous by name and location Gregory Hainaut (2): SSO: new test to ensure correct deadcode optimization SSO: new test to ensure matching with various qualifier tests/all.py | 4 + .../arb_separate_shader_objects/CMakeLists.gl.txt | 2 + .../rendezvous_by_name.c | 358 + .../rendezvous_by_name_interpolation.c | 210 4 files changed, 574 insertions(+) create mode 100644 tests/spec/arb_separate_shader_objects/rendezvous_by_name.c create mode 100644 tests/spec/arb_separate_shader_objects/rendezvous_by_name_interpolation.c -- 2.1.4 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 1/2] SSO: new test to ensure correct deadcode optimization
Related to mesa issue: https://bugs.freedesktop.org/show_bug.cgi?id=79783 Mostly "Validated" on Nvidia driver. Nvidia fails to link vs_fs_prog_separate_inactive v3: add the test to all.py v2: * Test both output and input are still active * Test real interstage variable are still optimized * Mix rendezvous by name and location Signed-off-by: Gregory Hainaut <gregory.hain...@gmail.com> --- tests/all.py | 2 + .../arb_separate_shader_objects/CMakeLists.gl.txt | 1 + .../rendezvous_by_name.c | 358 + 3 files changed, 361 insertions(+) create mode 100644 tests/spec/arb_separate_shader_objects/rendezvous_by_name.c diff --git a/tests/all.py b/tests/all.py index acfc586..35c330b 100644 --- a/tests/all.py +++ b/tests/all.py @@ -2145,6 +2145,8 @@ with profile.group_manager( 'UseProgramStages - non-separable program') g(['arb_separate_shader_object-ProgramUniform-coverage'], 'ProgramUniform coverage') +g(['arb_separate_shader_object-rendezvous_by_name'], + 'Rendez vous by name') g(['arb_separate_shader_object-rendezvous_by_location', '-fbo'], 'Rendezvous by location', run_concurrent=False) g(['arb_separate_shader_object-rendezvous_by_location-5-stages'], diff --git a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt index f1b15c0..9ab6606 100644 --- a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt +++ b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt @@ -18,5 +18,6 @@ piglit_add_executable (arb_separate_shader_object-ProgramUniform-coverage Progra piglit_add_executable (arb_separate_shader_object-rendezvous_by_location rendezvous_by_location.c) piglit_add_executable (arb_separate_shader_object-rendezvous_by_location-3-stages rendezvous_by_location-3-stages.c) piglit_add_executable (arb_separate_shader_object-rendezvous_by_location-5-stages rendezvous_by_location-5-stages.c) +piglit_add_executable (arb_separate_shader_object-rendezvous_by_name rendezvous_by_name.c) piglit_add_executable (arb_separate_shader_object-UseProgramStages-non-separable UseProgramStages-non-separable.c) piglit_add_executable (arb_separate_shader_object-ValidateProgramPipeline ValidateProgramPipeline.c) diff --git a/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c b/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c new file mode 100644 index 000..c8d3b20 --- /dev/null +++ b/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c @@ -0,0 +1,358 @@ +/* + * Copyright © 2015 Gregory Hainaut <gregory.hain...@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. + */ + +/** + * \file rendezvous_by_name.c + * Simple test for separate shader objects that use rendezvous-by-name. + * + * Related to issue: https://bugs.freedesktop.org/show_bug.cgi?id=79783 + * + * The test ensures deadcode optimization of input variables doesn't break + * the rendezvous by name of the variables. + */ +#include "piglit-util-gl.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 10; + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + +static GLuint pipeline_3_out_1_in[2]; +static GLuint pipeline_1_out_3_in[2]; +static GLuint pipeline_inactive; +static GLint vs_fs_prog_inactive; + +static const char *vs_code_3_out_template = + "#version %d\n" + "#extension GL_ARB_separate_shader_objects: require\n" + "#extension GL_ARB_explicit_attrib_location: require\n" + "\n" + "layout(location = 0) in vec4 piglit_vertex;\n" + "\n" + "%s out vec4 blue;\n" + "out vec4 green;\n" + "o
[Piglit] [PATCH 0/2] V3: SSO: new test to ensure correct deadcode optimization
Related to mesa issue: https://bugs.freedesktop.org/show_bug.cgi?id=79783 Mostly "Validated" on Nvidia driver. Nvidia fails to link vs_fs_prog_separate_inactive on first test v3: * Add a new test to ensure matching with various qualifier To be discussed. I don't know, if behavior is acceptable/legit for version below GLSL4.5 v2: * Test both output and input are still active * Test real interstage variable are still optimized * Mix rendezvous by name and location Gregory Hainaut (2): SSO: new test to ensure correct deadcode optimization SSO: new test to ensure matching with various qualifier .../arb_separate_shader_objects/CMakeLists.gl.txt | 2 + .../rendezvous_by_name.c | 358 + .../rendezvous_by_name_interpolation.c | 210 3 files changed, 570 insertions(+) create mode 100644 tests/spec/arb_separate_shader_objects/rendezvous_by_name.c create mode 100644 tests/spec/arb_separate_shader_objects/rendezvous_by_name_interpolation.c -- 2.1.4 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 1/2] SSO: new test to ensure correct deadcode optimization
Related to mesa issue: https://bugs.freedesktop.org/show_bug.cgi?id=79783 Mostly "Validated" on Nvidia driver. Nvidia fails to link vs_fs_prog_separate_inactive v2: * Test both output and input are still active * Test real interstage variable are still optimized * Mix rendezvous by name and location Signed-off-by: Gregory Hainaut <gregory.hain...@gmail.com> --- .../arb_separate_shader_objects/CMakeLists.gl.txt | 1 + .../rendezvous_by_name.c | 358 + 2 files changed, 359 insertions(+) create mode 100644 tests/spec/arb_separate_shader_objects/rendezvous_by_name.c diff --git a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt index f1b15c0..9ab6606 100644 --- a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt +++ b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt @@ -18,5 +18,6 @@ piglit_add_executable (arb_separate_shader_object-ProgramUniform-coverage Progra piglit_add_executable (arb_separate_shader_object-rendezvous_by_location rendezvous_by_location.c) piglit_add_executable (arb_separate_shader_object-rendezvous_by_location-3-stages rendezvous_by_location-3-stages.c) piglit_add_executable (arb_separate_shader_object-rendezvous_by_location-5-stages rendezvous_by_location-5-stages.c) +piglit_add_executable (arb_separate_shader_object-rendezvous_by_name rendezvous_by_name.c) piglit_add_executable (arb_separate_shader_object-UseProgramStages-non-separable UseProgramStages-non-separable.c) piglit_add_executable (arb_separate_shader_object-ValidateProgramPipeline ValidateProgramPipeline.c) diff --git a/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c b/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c new file mode 100644 index 000..c8d3b20 --- /dev/null +++ b/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c @@ -0,0 +1,358 @@ +/* + * Copyright © 2015 Gregory Hainaut <gregory.hain...@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. + */ + +/** + * \file rendezvous_by_name.c + * Simple test for separate shader objects that use rendezvous-by-name. + * + * Related to issue: https://bugs.freedesktop.org/show_bug.cgi?id=79783 + * + * The test ensures deadcode optimization of input variables doesn't break + * the rendezvous by name of the variables. + */ +#include "piglit-util-gl.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 10; + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + +static GLuint pipeline_3_out_1_in[2]; +static GLuint pipeline_1_out_3_in[2]; +static GLuint pipeline_inactive; +static GLint vs_fs_prog_inactive; + +static const char *vs_code_3_out_template = + "#version %d\n" + "#extension GL_ARB_separate_shader_objects: require\n" + "#extension GL_ARB_explicit_attrib_location: require\n" + "\n" + "layout(location = 0) in vec4 piglit_vertex;\n" + "\n" + "%s out vec4 blue;\n" + "out vec4 green;\n" + "out vec4 red;\n" + "\n" + "void main()\n" + "{\n" + "gl_Position = piglit_vertex;\n" + "red = vec4(1, 0, 0, 0);\n" + "green = vec4(0, 1, 0, 0);\n" + "blue = vec4(0, 0, 1, 0);\n" + "}\n" + ; + +static const char *vs_code_1_out_template = + "#version %d\n" + "#extension GL_ARB_separate_shader_objects: require\n" + "#extension GL_ARB_explicit_attrib_location: require\n" + "\n" + "layout(location = 0) in vec4 piglit_vertex;\n" +
[Piglit] [PATCH] SSO: new test to ensure correct deadcode optimization
Related to mesa issue: https://bugs.freedesktop.org/show_bug.cgi?id=79783 Mostly "Validated" on Nvidia driver. Nvidia fails to link vs_fs_prog_separate_inactive v2: * Test both output and input are still active * Test real interstage variable are still optimized * Mix rendezvous by name and location --- .../arb_separate_shader_objects/CMakeLists.gl.txt | 1 + .../rendezvous_by_name.c | 358 + 2 files changed, 359 insertions(+) create mode 100644 tests/spec/arb_separate_shader_objects/rendezvous_by_name.c diff --git a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt index f1b15c0..9ab6606 100644 --- a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt +++ b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt @@ -18,5 +18,6 @@ piglit_add_executable (arb_separate_shader_object-ProgramUniform-coverage Progra piglit_add_executable (arb_separate_shader_object-rendezvous_by_location rendezvous_by_location.c) piglit_add_executable (arb_separate_shader_object-rendezvous_by_location-3-stages rendezvous_by_location-3-stages.c) piglit_add_executable (arb_separate_shader_object-rendezvous_by_location-5-stages rendezvous_by_location-5-stages.c) +piglit_add_executable (arb_separate_shader_object-rendezvous_by_name rendezvous_by_name.c) piglit_add_executable (arb_separate_shader_object-UseProgramStages-non-separable UseProgramStages-non-separable.c) piglit_add_executable (arb_separate_shader_object-ValidateProgramPipeline ValidateProgramPipeline.c) diff --git a/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c b/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c new file mode 100644 index 000..c8d3b20 --- /dev/null +++ b/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c @@ -0,0 +1,358 @@ +/* + * Copyright © 2015 Gregory Hainaut <gregory.hain...@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. + */ + +/** + * \file rendezvous_by_name.c + * Simple test for separate shader objects that use rendezvous-by-name. + * + * Related to issue: https://bugs.freedesktop.org/show_bug.cgi?id=79783 + * + * The test ensures deadcode optimization of input variables doesn't break + * the rendezvous by name of the variables. + */ +#include "piglit-util-gl.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 10; + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + +static GLuint pipeline_3_out_1_in[2]; +static GLuint pipeline_1_out_3_in[2]; +static GLuint pipeline_inactive; +static GLint vs_fs_prog_inactive; + +static const char *vs_code_3_out_template = + "#version %d\n" + "#extension GL_ARB_separate_shader_objects: require\n" + "#extension GL_ARB_explicit_attrib_location: require\n" + "\n" + "layout(location = 0) in vec4 piglit_vertex;\n" + "\n" + "%s out vec4 blue;\n" + "out vec4 green;\n" + "out vec4 red;\n" + "\n" + "void main()\n" + "{\n" + "gl_Position = piglit_vertex;\n" + "red = vec4(1, 0, 0, 0);\n" + "green = vec4(0, 1, 0, 0);\n" + "blue = vec4(0, 0, 1, 0);\n" + "}\n" + ; + +static const char *vs_code_1_out_template = + "#version %d\n" + "#extension GL_ARB_separate_shader_objects: require\n" + "#extension GL_ARB_explicit_attrib_location: require\n" + "\n" + "layout(location = 0) in vec4 piglit_vertex;\n" + "\n" + "%s out vec4 blue;\n" +
Re: [Piglit] [PATCH] SSO: new test to ensure correct deadcode optimization
On Fri, 25 Sep 2015 21:21:58 +0200 Gregory Hainaut <gregory.hain...@gmail.com> wrote: > Related to mesa issue: https://bugs.freedesktop.org/show_bug.cgi?id=79783 > > "Validated" on Nvidia driver > --- > .../arb_separate_shader_objects/CMakeLists.gl.txt | 1 + > .../rendezvous_by_name.c | 219 > + > 2 files changed, 220 insertions(+) > create mode 100644 > tests/spec/arb_separate_shader_objects/rendezvous_by_name.c > > diff --git a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt > b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt > index b596f67..a835187 100644 > --- a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt > +++ b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt > @@ -19,5 +19,6 @@ piglit_add_executable > (arb_separate_shader_object-ProgramUniform-coverage Progra > piglit_add_executable (arb_separate_shader_object-rendezvous_by_location > rendezvous_by_location.c) > piglit_add_executable > (arb_separate_shader_object-rendezvous_by_location-3-stages > rendezvous_by_location-3-stages.c) > piglit_add_executable > (arb_separate_shader_object-rendezvous_by_location-5-stages > rendezvous_by_location-5-stages.c) > +piglit_add_executable (arb_separate_shader_object-rendezvous_by_name > rendezvous_by_name.c) > piglit_add_executable > (arb_separate_shader_object-UseProgramStages-non-separable > UseProgramStages-non-separable.c) > piglit_add_executable (arb_separate_shader_object-ValidateProgramPipeline > ValidateProgramPipeline.c) > diff --git a/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c > b/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c > new file mode 100644 > index 000..2248f16 > --- /dev/null > +++ b/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c > @@ -0,0 +1,219 @@ > +/* > + * Copyright © 2015 Gregory Hainaut <gregory.hain...@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. > + */ > + > +/** > + * \file rendezvous_by_name.c > + * Simple test for separate shader objects that use rendezvous-by-name. > + * > + * Related to issue: https://bugs.freedesktop.org/show_bug.cgi?id=79783 > + * > + * The test ensures deadcode optimization of input variables doesn't break > + * the rendezvous by name of the variables. > + */ > +#include "piglit-util-gl.h" > + > +PIGLIT_GL_TEST_CONFIG_BEGIN > + > + config.supports_gl_compat_version = 10; > + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; > + > +PIGLIT_GL_TEST_CONFIG_END > + > +static GLuint pipeline_deadcode_name; > +static GLuint pipeline_deadcode_location; > + > +static const char *vs_code_deadcode_name_template = > + "#version %d\n" > + "#extension GL_ARB_separate_shader_objects: require\n" > + "#extension GL_ARB_explicit_attrib_location: require\n" > + "\n" > + "layout(location = 0) in vec4 piglit_vertex;\n" > + "\n" > + "out vec3 a;\n" > + "out vec3 b;\n" > + "\n" > + "void main()\n" > + "{\n" > + "gl_Position = piglit_vertex;\n" > + "a = vec3(0, 0, 1);\n" > + "b = vec3(1, 0, 0);\n" > + "}\n" > + ; > + > +static const char *vs_code_deadcode_location_template = > + "#version %d\n" > + "#extension GL_ARB_separate_shader_objects: require\n" >
[Piglit] [PATCH] SSO: new test to ensure correct deadcode optimization
Related to mesa issue: https://bugs.freedesktop.org/show_bug.cgi?id=79783 "Validated" on Nvidia driver --- .../arb_separate_shader_objects/CMakeLists.gl.txt | 1 + .../rendezvous_by_name.c | 219 + 2 files changed, 220 insertions(+) create mode 100644 tests/spec/arb_separate_shader_objects/rendezvous_by_name.c diff --git a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt index b596f67..a835187 100644 --- a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt +++ b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt @@ -19,5 +19,6 @@ piglit_add_executable (arb_separate_shader_object-ProgramUniform-coverage Progra piglit_add_executable (arb_separate_shader_object-rendezvous_by_location rendezvous_by_location.c) piglit_add_executable (arb_separate_shader_object-rendezvous_by_location-3-stages rendezvous_by_location-3-stages.c) piglit_add_executable (arb_separate_shader_object-rendezvous_by_location-5-stages rendezvous_by_location-5-stages.c) +piglit_add_executable (arb_separate_shader_object-rendezvous_by_name rendezvous_by_name.c) piglit_add_executable (arb_separate_shader_object-UseProgramStages-non-separable UseProgramStages-non-separable.c) piglit_add_executable (arb_separate_shader_object-ValidateProgramPipeline ValidateProgramPipeline.c) diff --git a/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c b/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c new file mode 100644 index 000..2248f16 --- /dev/null +++ b/tests/spec/arb_separate_shader_objects/rendezvous_by_name.c @@ -0,0 +1,219 @@ +/* + * Copyright © 2015 Gregory Hainaut <gregory.hain...@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. + */ + +/** + * \file rendezvous_by_name.c + * Simple test for separate shader objects that use rendezvous-by-name. + * + * Related to issue: https://bugs.freedesktop.org/show_bug.cgi?id=79783 + * + * The test ensures deadcode optimization of input variables doesn't break + * the rendezvous by name of the variables. + */ +#include "piglit-util-gl.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 10; + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + +static GLuint pipeline_deadcode_name; +static GLuint pipeline_deadcode_location; + +static const char *vs_code_deadcode_name_template = + "#version %d\n" + "#extension GL_ARB_separate_shader_objects: require\n" + "#extension GL_ARB_explicit_attrib_location: require\n" + "\n" + "layout(location = 0) in vec4 piglit_vertex;\n" + "\n" + "out vec3 a;\n" + "out vec3 b;\n" + "\n" + "void main()\n" + "{\n" + "gl_Position = piglit_vertex;\n" + "a = vec3(0, 0, 1);\n" + "b = vec3(1, 0, 0);\n" + "}\n" + ; + +static const char *vs_code_deadcode_location_template = + "#version %d\n" + "#extension GL_ARB_separate_shader_objects: require\n" + "#extension GL_ARB_explicit_attrib_location: require\n" + "\n" + "layout(location = 0) in vec4 piglit_vertex;\n" + "\n" + "out vec3 a;\n" + "out vec3 b;\n" + "layout(location = 0) out vec3 c;\n" + "\n" + "void main()\n" + "{\n" + "gl_Position = piglit_vertex;\n" + "a = vec3(0, 0, 1);\n" + "b = vec3(1, 0, 0);\n" + "c = vec3(0, 1, 0);\n" + "}\n&
[Piglit] [PATCH 6/6] SSO: new test ValidateProgramPipeline
Catalyst status: Part 11 12 failed V4: * Use standard piglit_report_subtest_result (with basic test number) * use standard bool versus GLBoolean * Merge VS shader with the help of __VERSION__ * asprintf shader with a common GLSL version --- tests/all.tests|1 + .../arb_separate_shader_objects/CMakeLists.gl.txt |3 + .../ValidateProgramPipeline.c | 437 3 files changed, 441 insertions(+) create mode 100644 tests/spec/arb_separate_shader_objects/ValidateProgramPipeline.c diff --git a/tests/all.tests b/tests/all.tests index ce5e260..4e2c541 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -1106,6 +1106,7 @@ spec['ARB_separate_shader_objects'] = arb_separate_shader_objects arb_separate_shader_objects['sso-GetProgramPipelineiv'] = concurrent_test('arb_separate_shader_object-GetProgramPipelineiv') arb_separate_shader_objects['sso-IsProgramPipeline'] = concurrent_test('arb_separate_shader_object-IsProgramPipeline') arb_separate_shader_objects['sso-mix_pipeline_useprogram'] = concurrent_test('arb_separate_shader_object-mix_pipeline_useprogram') +arb_separate_shader_objects['sso-ValidateProgramPipeline'] = concurrent_test('arb_separate_shader_object-ValidateProgramPipeline') # Group ARB_sampler_objects arb_sampler_objects = Group() diff --git a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt index e651956..f0f8864 100644 --- a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt +++ b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt @@ -12,3 +12,6 @@ link_libraries ( piglit_add_executable (arb_separate_shader_object-IsProgramPipeline IsProgramPipeline.c) piglit_add_executable (arb_separate_shader_object-GetProgramPipelineiv GetProgramPipelineiv.c) piglit_add_executable (arb_separate_shader_object-mix_pipeline_useprogram mix_pipeline_useprogram.c) +piglit_add_executable (arb_separate_shader_object-ValidateProgramPipeline ValidateProgramPipeline.c) + +# vim: ft=cmake: diff --git a/tests/spec/arb_separate_shader_objects/ValidateProgramPipeline.c b/tests/spec/arb_separate_shader_objects/ValidateProgramPipeline.c new file mode 100644 index 000..142988e --- /dev/null +++ b/tests/spec/arb_separate_shader_objects/ValidateProgramPipeline.c @@ -0,0 +1,437 @@ +/* + * Copyright © 2013 Gregory Hainaut gregory.hain...@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. + */ + + +/* INVALID_OPERATION: + * + * • A program object is active for at least one, but not all of the shader stages + * that were present when the program was linked. + * • One program object is active for at least two shader stages and a second + * program is active for a shader stage between two stages for which the first + * program was active. The active compute shader is ignored for the purposes + * of this test. + * • There is an active program for tessellation control, tessellation evaluation, or + * geometry stages with corresponding executable shader, but there is no active + * program with executable vertex shader. + * • There is no current program object specified by UseProgram, there is a cur- + * rent program pipeline object, and the current program for any shader stage + * has been relinked since being applied to the pipeline object via UsePro- + * gramStages with the PROGRAM_SEPARABLE parameter set to FALSE. + */ + +#define _GNU_SOURCE +#include piglit-util-gl-common.h + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 21; + + config.window_width = 32; + config.window_height = 32; + +PIGLIT_GL_TEST_CONFIG_END + +static bool pass; + +enum piglit_result +piglit_display(void) +{ + /* UNREACHED */ + return PIGLIT_FAIL; +} + +static void +validate_pipe(GLuint pipe, bool expected, char* msg) +{ + GLint status; + + pass
[Piglit] [PATCH 1/6] piglit util: new functions piglit_program_pipeline_check_status/quiet
Equivalent to piglit_link_check_status/quiet but with program object pipeline V4: move function in piglit-shader-gl.c (not supported on GLES*) --- tests/util/piglit-shader-gl.c| 51 ++ tests/util/piglit-shader-gles1.c |6 + tests/util/piglit-shader-gles2.c |2 ++ tests/util/piglit-shader.h |3 +++ 4 files changed, 62 insertions(+) diff --git a/tests/util/piglit-shader-gl.c b/tests/util/piglit-shader-gl.c index 33735cc..94f997a 100644 --- a/tests/util/piglit-shader-gl.c +++ b/tests/util/piglit-shader-gl.c @@ -84,3 +84,54 @@ piglit_require_fragment_shader(void) exit(1); } } + +/* Same function as link_check_status but for program pipeline */ +static GLboolean +program_pipeline_check_status(GLuint pipeline, FILE *output) +{ + GLchar *info = NULL; + GLint size; + GLint ok; + + piglit_require_extension(GL_ARB_separate_shader_objects); + + glValidateProgramPipeline(pipeline); + glGetProgramPipelineiv(pipeline, GL_VALIDATE_STATUS, ok); + + /* Some drivers return a size of 1 for an empty log. This is the size +* of a log that contains only a terminating NUL character. +*/ + glGetProgramPipelineiv(pipeline, GL_INFO_LOG_LENGTH, size); + if (size 1) { + info = malloc(size); + glGetProgramPipelineInfoLog(pipeline, size, NULL, info); + } + + if (!ok) { + fprintf(output, Failed to validate the pipeline: %s\n, + (info != NULL) ? info : empty log); + } + else if (0 info != NULL) { + /* Enable this to get extra linking info. +* Even if there's no link errors, the info log may +* have some remarks. +*/ + printf(Pipeline validataion warning: %s\n, info); + } + + free(info); + + return ok; +} + +GLboolean +piglit_program_pipeline_check_status(GLuint pipeline) +{ + return program_pipeline_check_status(pipeline, stderr); +} + +GLboolean +piglit_program_pipeline_check_status_quiet(GLuint pipeline) +{ + return program_pipeline_check_status(pipeline, stdout); +} diff --git a/tests/util/piglit-shader-gles1.c b/tests/util/piglit-shader-gles1.c index 4902ba9..5d1c5b0 100644 --- a/tests/util/piglit-shader-gles1.c +++ b/tests/util/piglit-shader-gles1.c @@ -47,3 +47,9 @@ piglit_require_fragment_shader(void) printf(GLES1 lacks GLSL\n); piglit_report_result(PIGLIT_SKIP); } + +GLboolean +piglit_program_pipeline_check_status(GLuint pipeline) {} + +GLboolean +piglit_program_pipeline_check_status_quiet(GLuint pipeline) {} diff --git a/tests/util/piglit-shader-gles2.c b/tests/util/piglit-shader-gles2.c index 09ed61f..85c7699 100644 --- a/tests/util/piglit-shader-gles2.c +++ b/tests/util/piglit-shader-gles2.c @@ -26,3 +26,5 @@ void piglit_require_GLSL(void) {} void piglit_require_vertex_shader(void) {} void piglit_require_fragment_shader(void) {} +GLboolean piglit_program_pipeline_check_status(GLuint pipeline) {} +GLboolean piglit_program_pipeline_check_status_quiet(GLuint pipeline) {} diff --git a/tests/util/piglit-shader.h b/tests/util/piglit-shader.h index 425eab3..25f1bbd 100644 --- a/tests/util/piglit-shader.h +++ b/tests/util/piglit-shader.h @@ -37,6 +37,9 @@ GLboolean piglit_link_check_status_quiet(GLint prog); GLint piglit_link_simple_program(GLint vs, GLint fs); GLint piglit_build_simple_program(const char *vs_source, const char *fs_source); +extern GLboolean piglit_program_pipeline_check_status(GLuint pipeline); +extern GLboolean piglit_program_pipeline_check_status_quiet(GLuint pipeline); + #if defined(PIGLIT_USE_OPENGL_ES1) #define glAttachShader assert(!glAttachShader does not exist in ES1) #define glBindAttribLocation assert(!glBindAttribLocation does not exist in ES1) -- 1.7.10.4 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 2/6] sso: new test GetProgramPipelineiv:
bind various stages (including geometry and tesselation to the pipeline and check the result with GetProgramPipelineiv. I take also the opportunity to use glCreateShaderProgramv. Note: I got an GL_INVALID_VALUE when glActiveShaderProgram is called with a program that isn't bound to any stage to the pipeline. For me there isn't such limitation in the spec but I could be wrong. Spec quote: An INVALID_VALUE error is generated if program is not the name of ei- ther a program or shader object. An INVALID_OPERATION error is generated if program is the name of a shader object. V4: * split new test in a separate commit * Merge the 2 vertex shaders with the help of the __VERSION__ macro * Properly set shader version with asprintf --- tests/all.tests|5 + tests/spec/CMakeLists.txt |1 + .../arb_separate_shader_objects/CMakeLists.gl.txt | 14 + .../arb_separate_shader_objects/CMakeLists.txt |1 + .../GetProgramPipelineiv.c | 277 5 files changed, 298 insertions(+) create mode 100644 tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt create mode 100644 tests/spec/arb_separate_shader_objects/CMakeLists.txt create mode 100644 tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c diff --git a/tests/all.tests b/tests/all.tests index 0f80e0b..8047cd1 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -1100,6 +1100,11 @@ add_concurrent_test(arb_occlusion_query, 'occlusion_query_meta_fragments') add_concurrent_test(arb_occlusion_query, 'occlusion_query_meta_no_fragments') add_concurrent_test(arb_occlusion_query, 'occlusion_query_order') +# Group ARB_separate_shader_objects +arb_separate_shader_objects = Group() +spec['ARB_separate_shader_objects'] = arb_separate_shader_objects +arb_separate_shader_objects['sso-GetProgramPipelineiv'] = concurrent_test('arb_separate_shader_object-GetProgramPipelineiv') + # Group ARB_sampler_objects arb_sampler_objects = Group() spec['ARB_sampler_objects'] = arb_sampler_objects diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt index a1492cc..e98107b 100644 --- a/tests/spec/CMakeLists.txt +++ b/tests/spec/CMakeLists.txt @@ -16,6 +16,7 @@ add_subdirectory (arb_robustness) add_subdirectory (arb_sampler_objects) add_subdirectory (arb_seamless_cube_map) add_subdirectory (amd_seamless_cubemap_per_texture) +add_subdirectory (arb_separate_shader_objects) add_subdirectory (arb_shader_texture_lod/execution) add_subdirectory (arb_shader_objects) add_subdirectory (arb_sync) diff --git a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt new file mode 100644 index 000..e651956 --- /dev/null +++ b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt @@ -0,0 +1,14 @@ +include_directories( + ${GLEXT_INCLUDE_DIR} + ${OPENGL_INCLUDE_PATH} +) + +link_libraries ( + piglitutil_${piglit_target_api} + ${OPENGL_gl_LIBRARY} + ${OPENGL_glu_LIBRARY} +) + +piglit_add_executable (arb_separate_shader_object-IsProgramPipeline IsProgramPipeline.c) +piglit_add_executable (arb_separate_shader_object-GetProgramPipelineiv GetProgramPipelineiv.c) +piglit_add_executable (arb_separate_shader_object-mix_pipeline_useprogram mix_pipeline_useprogram.c) diff --git a/tests/spec/arb_separate_shader_objects/CMakeLists.txt b/tests/spec/arb_separate_shader_objects/CMakeLists.txt new file mode 100644 index 000..144a306 --- /dev/null +++ b/tests/spec/arb_separate_shader_objects/CMakeLists.txt @@ -0,0 +1 @@ +piglit_include_target_api() diff --git a/tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c b/tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c new file mode 100644 index 000..8ce8b72 --- /dev/null +++ b/tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c @@ -0,0 +1,277 @@ +/* + * Copyright © 2013 Gregory Hainaut gregory.hain...@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
[Piglit] [PATCH 0/4] ARB_separate_shader_objects V3
TEST status: IsProgramPipeline: * neither AMD/NVIDIA follow the spec... * Crash on AMD: because of -1 of glGenProgramPipelines( -1, id) * Crash on Nvidia: glGetProgramPipelineiv(4, GL_VERTEX_SHADER, value). GetProgramPipelineiv: * working on nvidia * FGLRX only accept as Active Program, program that was previously attached to the pipeline. No mention in the spec mix_pipeline_useprogram: * working on nvidia * FGLRX doesn't restore the pipeline when single program is unattached (glUseProgram(0)) ValidateProgramPipeline: * PART 6 is bad on nvidia only (good on FGLRX) * PART 11 is bad on FGLRX only (good on nvidia) * PART 12 are bad on both drivers. Technically the spec said that the pipeline must be bound and current to check the GL_PROGRAM_SEPARABLE flags. But it doesn't make any sense on a bindless free api... I try to bind it on FGLRX but I didn't see any change. Don't know on nvidia side. api-errors: * working on nvidia * FGLRX doesn't report any error * V3: * Fix all test on Nvidia GPU. * Add a new test ValidateProgramPipeline V2: * split the patch properly with git :) * sso-GetProgramPipelineiv: fix a VS linker error. Print current test step. * sso-mix_pipeline_useprogram: fix a wrong expected. Now the test must work on nvidia :) * sso-IsProgramPipeline: Print more current test step = my guess is nvidia choke on glDeleteProgramPipelines( -1, id); = Nvidia as AMD doesn't follow the spec (not very serious) ** gregory (4): piglit util: new functions piglit_program_pipeline_check_status/quiet add 3 news tests for arb_separate_shader_objects update EXT_transform_feedback error detection SSO: new test ValidateProgramPipeline tests/all.tests| 12 +- tests/spec/CMakeLists.txt |1 + .../arb_separate_shader_objects/CMakeLists.gl.txt | 17 + .../arb_separate_shader_objects/CMakeLists.txt |1 + .../GetProgramPipelineiv.c | 281 ++ .../IsProgramPipeline.c| 113 ++ .../ValidateProgramPipeline.c | 403 .../mix_pipeline_useprogram.c | 363 ++ tests/spec/ext_transform_feedback/api-errors.c | 84 +++- tests/util/piglit-shader.c | 50 +++ tests/util/piglit-shader.h |2 + 11 files changed, 1324 insertions(+), 3 deletions(-) create mode 100644 tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt create mode 100644 tests/spec/arb_separate_shader_objects/CMakeLists.txt create mode 100644 tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c create mode 100644 tests/spec/arb_separate_shader_objects/IsProgramPipeline.c create mode 100644 tests/spec/arb_separate_shader_objects/ValidateProgramPipeline.c create mode 100644 tests/spec/arb_separate_shader_objects/mix_pipeline_useprogram.c -- 1.7.10.4 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 1/4] piglit util: new functions piglit_program_pipeline_check_status/quiet
Equivalent to piglit_link_check_status/quiet but with program object pipeline --- tests/util/piglit-shader.c | 50 tests/util/piglit-shader.h |2 ++ 2 files changed, 52 insertions(+) diff --git a/tests/util/piglit-shader.c b/tests/util/piglit-shader.c index c67e58a..d7a0266 100644 --- a/tests/util/piglit-shader.c +++ b/tests/util/piglit-shader.c @@ -213,6 +213,45 @@ link_check_status(GLint prog, FILE *output) return ok; } +/* Same function as above but for program pipeline */ +static GLboolean +program_pipeline_check_status(GLuint pipeline, FILE *output) +{ + GLchar *info = NULL; + GLint size; + GLint ok; + + piglit_require_extension(GL_ARB_separate_shader_objects); + + glValidateProgramPipeline(pipeline); + glGetProgramPipelineiv(pipeline, GL_VALIDATE_STATUS, ok); + + /* Some drivers return a size of 1 for an empty log. This is the size +* of a log that contains only a terminating NUL character. +*/ + glGetProgramPipelineiv(pipeline, GL_INFO_LOG_LENGTH, size); + if (size 1) { + info = malloc(size); + glGetProgramPipelineInfoLog(pipeline, size, NULL, info); + } + + if (!ok) { + fprintf(output, Failed to validate the pipeline: %s\n, + (info != NULL) ? info : empty log); + } + else if (0 info != NULL) { + /* Enable this to get extra linking info. +* Even if there's no link errors, the info log may +* have some remarks. +*/ + printf(Pipeline validataion warning: %s\n, info); + } + + free(info); + + return ok; +} + GLboolean piglit_link_check_status(GLint prog) { @@ -234,6 +273,17 @@ piglit_link_check_status_quiet(GLint prog) return link_check_status(prog, stdout); } +GLboolean +piglit_program_pipeline_check_status(GLuint pipeline) +{ + return program_pipeline_check_status(pipeline, stderr); +} + +GLboolean +piglit_program_pipeline_check_status_quiet(GLuint pipeline) +{ + return program_pipeline_check_status(pipeline, stdout); +} GLint piglit_link_simple_program(GLint vs, GLint fs) { diff --git a/tests/util/piglit-shader.h b/tests/util/piglit-shader.h index 12cf731..0bb7792 100644 --- a/tests/util/piglit-shader.h +++ b/tests/util/piglit-shader.h @@ -34,6 +34,8 @@ GLuint piglit_compile_shader(GLenum target, const char *filename); GLuint piglit_compile_shader_text(GLenum target, const char *text); GLboolean piglit_link_check_status(GLint prog); GLboolean piglit_link_check_status_quiet(GLint prog); +GLboolean piglit_program_pipeline_check_status(GLuint pipeline); +GLboolean piglit_program_pipeline_check_status_quiet(GLuint pipeline); GLint piglit_link_simple_program(GLint vs, GLint fs); #if defined(PIGLIT_USE_OPENGL_ES1) -- 1.7.10.4 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 1/3] piglit util: new functions piglit_program_pipeline_check_status/quiet
Equivalent to piglit_link_check_status/quiet but with program object pipeline --- tests/util/piglit-shader.c | 50 tests/util/piglit-shader.h |2 ++ 2 files changed, 52 insertions(+) diff --git a/tests/util/piglit-shader.c b/tests/util/piglit-shader.c index c67e58a..d7a0266 100644 --- a/tests/util/piglit-shader.c +++ b/tests/util/piglit-shader.c @@ -213,6 +213,45 @@ link_check_status(GLint prog, FILE *output) return ok; } +/* Same function as above but for program pipeline */ +static GLboolean +program_pipeline_check_status(GLuint pipeline, FILE *output) +{ + GLchar *info = NULL; + GLint size; + GLint ok; + + piglit_require_extension(GL_ARB_separate_shader_objects); + + glValidateProgramPipeline(pipeline); + glGetProgramPipelineiv(pipeline, GL_VALIDATE_STATUS, ok); + + /* Some drivers return a size of 1 for an empty log. This is the size +* of a log that contains only a terminating NUL character. +*/ + glGetProgramPipelineiv(pipeline, GL_INFO_LOG_LENGTH, size); + if (size 1) { + info = malloc(size); + glGetProgramPipelineInfoLog(pipeline, size, NULL, info); + } + + if (!ok) { + fprintf(output, Failed to validate the pipeline: %s\n, + (info != NULL) ? info : empty log); + } + else if (0 info != NULL) { + /* Enable this to get extra linking info. +* Even if there's no link errors, the info log may +* have some remarks. +*/ + printf(Pipeline validataion warning: %s\n, info); + } + + free(info); + + return ok; +} + GLboolean piglit_link_check_status(GLint prog) { @@ -234,6 +273,17 @@ piglit_link_check_status_quiet(GLint prog) return link_check_status(prog, stdout); } +GLboolean +piglit_program_pipeline_check_status(GLuint pipeline) +{ + return program_pipeline_check_status(pipeline, stderr); +} + +GLboolean +piglit_program_pipeline_check_status_quiet(GLuint pipeline) +{ + return program_pipeline_check_status(pipeline, stdout); +} GLint piglit_link_simple_program(GLint vs, GLint fs) { diff --git a/tests/util/piglit-shader.h b/tests/util/piglit-shader.h index 12cf731..0bb7792 100644 --- a/tests/util/piglit-shader.h +++ b/tests/util/piglit-shader.h @@ -34,6 +34,8 @@ GLuint piglit_compile_shader(GLenum target, const char *filename); GLuint piglit_compile_shader_text(GLenum target, const char *text); GLboolean piglit_link_check_status(GLint prog); GLboolean piglit_link_check_status_quiet(GLint prog); +GLboolean piglit_program_pipeline_check_status(GLuint pipeline); +GLboolean piglit_program_pipeline_check_status_quiet(GLuint pipeline); GLint piglit_link_simple_program(GLint vs, GLint fs); #if defined(PIGLIT_USE_OPENGL_ES1) -- 1.7.10.4 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 1/3] piglit util: new functions piglit_program_pipeline_check_status/quiet
Equivalent to piglit_link_check_status/quiet but with program object pipeline --- tests/util/piglit-shader.c | 50 tests/util/piglit-shader.h |2 ++ 2 files changed, 52 insertions(+) diff --git a/tests/util/piglit-shader.c b/tests/util/piglit-shader.c index c67e58a..d7a0266 100644 --- a/tests/util/piglit-shader.c +++ b/tests/util/piglit-shader.c @@ -213,6 +213,45 @@ link_check_status(GLint prog, FILE *output) return ok; } +/* Same function as above but for program pipeline */ +static GLboolean +program_pipeline_check_status(GLuint pipeline, FILE *output) +{ + GLchar *info = NULL; + GLint size; + GLint ok; + + piglit_require_extension(GL_ARB_separate_shader_objects); + + glValidateProgramPipeline(pipeline); + glGetProgramPipelineiv(pipeline, GL_VALIDATE_STATUS, ok); + + /* Some drivers return a size of 1 for an empty log. This is the size +* of a log that contains only a terminating NUL character. +*/ + glGetProgramPipelineiv(pipeline, GL_INFO_LOG_LENGTH, size); + if (size 1) { + info = malloc(size); + glGetProgramPipelineInfoLog(pipeline, size, NULL, info); + } + + if (!ok) { + fprintf(output, Failed to validate the pipeline: %s\n, + (info != NULL) ? info : empty log); + } + else if (0 info != NULL) { + /* Enable this to get extra linking info. +* Even if there's no link errors, the info log may +* have some remarks. +*/ + printf(Pipeline validataion warning: %s\n, info); + } + + free(info); + + return ok; +} + GLboolean piglit_link_check_status(GLint prog) { @@ -234,6 +273,17 @@ piglit_link_check_status_quiet(GLint prog) return link_check_status(prog, stdout); } +GLboolean +piglit_program_pipeline_check_status(GLuint pipeline) +{ + return program_pipeline_check_status(pipeline, stderr); +} + +GLboolean +piglit_program_pipeline_check_status_quiet(GLuint pipeline) +{ + return program_pipeline_check_status(pipeline, stdout); +} GLint piglit_link_simple_program(GLint vs, GLint fs) { diff --git a/tests/util/piglit-shader.h b/tests/util/piglit-shader.h index 12cf731..0bb7792 100644 --- a/tests/util/piglit-shader.h +++ b/tests/util/piglit-shader.h @@ -34,6 +34,8 @@ GLuint piglit_compile_shader(GLenum target, const char *filename); GLuint piglit_compile_shader_text(GLenum target, const char *text); GLboolean piglit_link_check_status(GLint prog); GLboolean piglit_link_check_status_quiet(GLint prog); +GLboolean piglit_program_pipeline_check_status(GLuint pipeline); +GLboolean piglit_program_pipeline_check_status_quiet(GLuint pipeline); GLint piglit_link_simple_program(GLint vs, GLint fs); #if defined(PIGLIT_USE_OPENGL_ES1) -- 1.7.10.4 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 2/3] add 3 news tests for arb_separate_shader_objects
/CMakeLists.txt b/tests/spec/arb_separate_shader_objects/CMakeLists.txt new file mode 100644 index 000..144a306 --- /dev/null +++ b/tests/spec/arb_separate_shader_objects/CMakeLists.txt @@ -0,0 +1 @@ +piglit_include_target_api() diff --git a/tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c b/tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c new file mode 100644 index 000..81f6978 --- /dev/null +++ b/tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c @@ -0,0 +1,279 @@ +/* + * Copyright © 2013 Gregory Hainaut gregory.hain...@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. + */ + +#include piglit-util-gl-common.h + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 10; + + config.window_width = 32; + config.window_height = 32; + +PIGLIT_GL_TEST_CONFIG_END + +static GLboolean pass; + +enum piglit_result +piglit_display(void) +{ + /* UNREACHED */ + return PIGLIT_FAIL; +} + +static GLint +stage2bitfield(GLint stage) { + switch(stage) { + case GL_VERTEX_SHADER: return GL_VERTEX_SHADER_BIT; + case GL_FRAGMENT_SHADER: return GL_FRAGMENT_SHADER_BIT; + case GL_GEOMETRY_SHADER: return GL_GEOMETRY_SHADER_BIT; + case GL_TESS_CONTROL_SHADER: return GL_TESS_CONTROL_SHADER_BIT; + case GL_TESS_EVALUATION_SHADER:return GL_TESS_EVALUATION_SHADER_BIT; + case GL_COMPUTE_SHADER: return GL_COMPUTE_SHADER_BIT; + default:return 0; + } + return 0; +} + +static void +check_stage(GLint pipe, GLint expected, GLint stage, GLboolean supported) { + GLint param = 0; + glGetProgramPipelineiv(pipe, stage, param); + + if (!supported) { + pass = piglit_check_gl_error(GL_INVALID_ENUM); + } else if (param != expected) { + fprintf(stderr, Failed to get program of stage %s.\n, piglit_get_gl_enum_name(stage)); + pass = GL_FALSE; + } +} + +static void +use_stage_and_check(GLint pipe, GLint program, GLint stage, GLboolean supported) { + printf(Attach program (%d) to stage (%s). Expected to be supported: %s\n, program, + piglit_get_gl_enum_name(stage), supported ? yes : no); + glUseProgramStages(pipe, stage2bitfield(stage), program); + if (!supported) { + pass = piglit_check_gl_error(GL_INVALID_VALUE); + } else { + pass = piglit_check_gl_error(GL_NO_ERROR); + } + + check_stage(pipe, program, stage, supported); +} + +void +piglit_init(int argc, char **argv) +{ + GLint vs, fs, gs, tcs, tes; + GLint ver; + GLuint pipe = 0; + GLint param = 0; + char version[100]; + const char *shader_source[2]; + + const char *vs_source_150 = + out gl_PerVertex {\n + vec4 gl_Position;\n + };\n + \n + in vec4 position;\n + \n + void main()\n + {\n + gl_Position = position;\n + }\n; + const char *vs_source_140 = + void main()\n + {\n + gl_Position = gl_Vertex;\n + }\n; + const char *fs_source = + void main()\n + {\n + gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0);\n + }\n; + const char *gs_source = + in gl_PerVertex {\n + vec4 gl_Position;\n + float gl_PointSize;\n + float gl_ClipDistance[];\n + } gl_in[];\n + \n + out gl_PerVertex {\n + vec4 gl_Position;\n + float gl_PointSize;\n + float gl_ClipDistance[];\n + };\n + \n
[Piglit] [PATCH 3/3] update EXT_transform_feedback error detection
program pipeline add new INVALID_OPERATION (spec chapter 13.2.2) Note: FGLRX don't report any of the expected errors... --- tests/all.tests|4 +- tests/spec/ext_transform_feedback/api-errors.c | 84 +++- 2 files changed, 85 insertions(+), 3 deletions(-) diff --git a/tests/all.tests b/tests/all.tests index 2cbf3c4..cd759b5 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -1906,7 +1906,9 @@ for mode in ['interleaved_ok_base', 'interleaved_ok_range', 'bind_range_offset_2', 'bind_range_offset_3', 'bind_range_offset_5', 'bind_offset_offset_1', 'bind_offset_offset_2', 'bind_offset_offset_3', - 'bind_offset_offset_5', 'not_a_program']: + 'bind_offset_offset_5', 'not_a_program', + 'useprogstage_noactive', 'useprogstage_active', + 'bind_pipeline']: test_name = 'api-errors {0}'.format(mode) ext_transform_feedback[test_name] = concurrent_test( 'ext_transform_feedback-{0}'.format(test_name)) diff --git a/tests/spec/ext_transform_feedback/api-errors.c b/tests/spec/ext_transform_feedback/api-errors.c index 04470b2..ba4fff8 100644 --- a/tests/spec/ext_transform_feedback/api-errors.c +++ b/tests/spec/ext_transform_feedback/api-errors.c @@ -78,6 +78,9 @@ enum test_mode { BIND_BAD_SIZE, BIND_BAD_OFFSET, NOT_A_PROGRAM, + USEPROGSTAGE_ACTIVE, + USEPROGSTAGE_NOACTIVE, + BIND_PIPELINE }; enum bind_mode { @@ -97,6 +100,32 @@ static const char *vstext = gl_Position = vec4(1.0);\n }\n; +static const char *vstext_sep_150 = + #extension GL_ARB_separate_shader_objects : enable\n + out gl_PerVertex {\n + vec4 gl_Position;\n + };\n + varying vec4 foo;\n + varying vec4 bar;\n + \n + void main()\n + {\n + foo = vec4(1.0);\n + bar = vec4(1.0);\n + gl_Position = vec4(1.0);\n + }\n; +static const char *vstext_sep_140 = + #extension GL_ARB_separate_shader_objects : enable\n + varying vec4 foo;\n + varying vec4 bar;\n + \n + void main()\n + {\n + foo = vec4(1.0);\n + bar = vec4(1.0);\n + gl_Position = vec4(1.0);\n + }\n; + static const char *varyings[] = { foo, bar }; static struct test_desc @@ -151,6 +180,10 @@ static struct test_desc { bind_offset_offset_3,BIND_BAD_OFFSET, 3, OFFSET, GL_INTERLEAVED_ATTRIBS, 1 }, { bind_offset_offset_5,BIND_BAD_OFFSET, 5, OFFSET, GL_INTERLEAVED_ATTRIBS, 1 }, { not_a_program, NOT_A_PROGRAM,0, BASE, GL_INTERLEAVED_ATTRIBS, 1 }, + { useprogstage_noactive, USEPROGSTAGE_NOACTIVE,0, BASE, GL_INTERLEAVED_ATTRIBS, 1 }, + { useprogstage_active, USEPROGSTAGE_ACTIVE, 0, BASE, GL_INTERLEAVED_ATTRIBS, 1 }, + { bind_pipeline, BIND_PIPELINE,0, BASE, GL_INTERLEAVED_ATTRIBS, 1 }, + }; static void @@ -186,6 +219,7 @@ do_test(const struct test_desc *test) { GLuint vs; GLuint progs[2]; + GLuint pipes[2]; GLuint bufs[NUM_BUFFERS]; float initial_xfb_buffer_contents[XFB_BUFFER_SIZE]; GLboolean pass = GL_TRUE; @@ -193,6 +227,10 @@ do_test(const struct test_desc *test) int num_varyings = test-mode == NO_VARYINGS ? 0 : test-num_buffers; GLint max_separate_attribs; + if (test-mode == USEPROGSTAGE_ACTIVE || test-mode == USEPROGSTAGE_NOACTIVE || test-mode == BIND_PIPELINE) { + piglit_require_extension(GL_ARB_separate_shader_objects); + } + glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, max_separate_attribs); printf(MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTIBS=%i\n, @@ -200,7 +238,19 @@ do_test(const struct test_desc *test) printf(Compile vertex shader\n); vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vstext); - if (test-mode == NOT_A_PROGRAM) { + if (test-mode == USEPROGSTAGE_ACTIVE || test-mode == USEPROGSTAGE_NOACTIVE || test-mode == BIND_PIPELINE) { + /* Note, we can't use glCreateShaderProgramv because the setup of transform feedback +* must be done before linking +*/ + if (piglit_get_gl_version() = 32) + vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vstext_sep_150); + else + vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vstext_sep_140); + progs[0] = glCreateProgram(); + glProgramParameteri(progs[0], GL_PROGRAM_SEPARABLE, GL_TRUE); + glAttachShader(progs[0], vs); + + } else if (test-mode == NOT_A_PROGRAM) { printf(Create a program and then delete it\n); progs[0] = glCreateProgram(); glDeleteProgram(progs[0]); @@
Re: [Piglit] [PATCH 1/3] piglit util: new functions piglit_program_pipeline_check_status/quiet
Sorry I did a forward which wrap my line. I resend it but it appears before... Discard this patch please. On Thu, 28 Mar 2013 18:45:33 +0100 gregory hainaut gregory.hain...@gmail.com wrote: Equivalent to piglit_link_check_status/quiet but with program object pipeline --- tests/util/piglit-shader.c | 50 tests/util/piglit-shader.h |2 ++ 2 files changed, 52 insertions(+) diff --git a/tests/util/piglit-shader.c b/tests/util/piglit-shader.c index c67e58a..d7a0266 100644 --- a/tests/util/piglit-shader.c +++ b/tests/util/piglit-shader.c @@ -213,6 +213,45 @@ link_check_status(GLint prog, FILE *output) return ok; } +/* Same function as above but for program pipeline */ +static GLboolean +program_pipeline_check_status(GLuint pipeline, FILE *output) +{ + GLchar *info = NULL; + GLint size; + GLint ok; + + piglit_require_extension(GL_ARB_separate_shader_objects); + + glValidateProgramPipeline(pipeline); + glGetProgramPipelineiv(pipeline, GL_VALIDATE_STATUS, ok); + + /* Some drivers return a size of 1 for an empty log. This is the size + * of a log that contains only a terminating NUL character. + */ + glGetProgramPipelineiv(pipeline, GL_INFO_LOG_LENGTH, size); + if (size 1) { + info = malloc(size); + glGetProgramPipelineInfoLog(pipeline, size, NULL, info); + } + + if (!ok) { + fprintf(output, Failed to validate the pipeline: %s\n, + (info != NULL) ? info : empty log); + } + else if (0 info != NULL) { + /* Enable this to get extra linking info. + * Even if there's no link errors, the info log may + * have some remarks. + */ + printf(Pipeline validataion warning: %s\n, info); + } + + free(info); + + return ok; +} + GLboolean piglit_link_check_status(GLint prog) { @@ -234,6 +273,17 @@ piglit_link_check_status_quiet(GLint prog) return link_check_status(prog, stdout); } +GLboolean +piglit_program_pipeline_check_status(GLuint pipeline) +{ + return program_pipeline_check_status(pipeline, stderr); +} + +GLboolean +piglit_program_pipeline_check_status_quiet(GLuint pipeline) +{ + return program_pipeline_check_status(pipeline, stdout); +} GLint piglit_link_simple_program(GLint vs, GLint fs) { diff --git a/tests/util/piglit-shader.h b/tests/util/piglit-shader.h index 12cf731..0bb7792 100644 --- a/tests/util/piglit-shader.h +++ b/tests/util/piglit-shader.h @@ -34,6 +34,8 @@ GLuint piglit_compile_shader(GLenum target, const char *filename); GLuint piglit_compile_shader_text(GLenum target, const char *text); GLboolean piglit_link_check_status(GLint prog); GLboolean piglit_link_check_status_quiet(GLint prog); +GLboolean piglit_program_pipeline_check_status(GLuint pipeline); +GLboolean piglit_program_pipeline_check_status_quiet(GLuint pipeline); GLint piglit_link_simple_program(GLint vs, GLint fs); #if defined(PIGLIT_USE_OPENGL_ES1) ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit