Re: [Piglit] [PATCH v2] arb_program_interface_query: GetProgramResourceLocation test
On 02/25/2015 10:20 PM, Ilia Mirkin wrote: On Wed, Feb 25, 2015 at 2:18 AM, Tapani Pälli wrote: On 02/19/2015 08:33 PM, Ilia Mirkin wrote: On Thu, Feb 19, 2015 at 7:54 AM, Tapani Pälli wrote: +static const char gs_subroutine_text[] = + "#version 150\n" + "#extension GL_ARB_explicit_attrib_location : require\n" + "#extension GL_ARB_explicit_uniform_location : require\n" + "#extension GL_ARB_shader_subroutine : require\n" + "#extension GL_EXT_geometry_shader4 : require\n" oops? You're requiring GLSL 1.50, no need for EXT_geometry_shader4, right? True, I'll chop it away, does it otherwise look fine? I think there was another instance of you checking for ARB_geometry_shader4. As for the rest of it, I haven't read the spec in enough detail to really tell. You'll need someone more familiar with this than myself to go over it. (Or just push unreviewed as a lot of piglit tends to be due to lack of reviewers.) OK, that's fine, thanks! ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [v2 PATCH] util: Use posix_memalign for all non-Windows platforms.
glibc < 2.16 does not have aligned_alloc. Suggested-by: Jose Fonseca Signed-off-by: Vinson Lee --- tests/util/piglit-util.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/util/piglit-util.c b/tests/util/piglit-util.c index b094625..743373a 100644 --- a/tests/util/piglit-util.c +++ b/tests/util/piglit-util.c @@ -829,14 +829,12 @@ piglit_alloc_aligned(size_t alignment, size_t size) { #if defined(_WIN32) return _aligned_malloc(size, alignment); -#elif defined(__APPLE__) +#else void *p; if (posix_memalign(&p, alignment, size) != 0) { return NULL; } return p; -#else - return aligned_alloc(alignment, size); #endif } -- 2.3.0 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] cmake: Require Python six >= 1.4.0.
six.PY2 was added in 1.4.0. Signed-off-by: Vinson Lee --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a81eed..b1d4e5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -192,7 +192,7 @@ ENDIF() find_package(PythonInterp 2.7 REQUIRED) find_package(PythonNumpy 1.6.2 REQUIRED) find_package(PythonMako 0.7.3 REQUIRED) -find_package(PythonSix REQUIRED) +find_package(PythonSix 1.4.0 REQUIRED) # Default to compiling with debug information (`gcc -g`): if(NOT CMAKE_BUILD_TYPE) -- 2.1.0 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [Bug 89329] glsl-deriv-varyings regression
https://bugs.freedesktop.org/show_bug.cgi?id=89329 Ian Romanick changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |DUPLICATE --- Comment #1 from Ian Romanick --- I believe we know the cause of the problem, but I don't know whether or not Andrés is fixing it... *** This bug has been marked as a duplicate of bug 87407 *** -- You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug. ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [Bug 89329] New: glsl-deriv-varyings regression
https://bugs.freedesktop.org/show_bug.cgi?id=89329 Bug ID: 89329 Summary: glsl-deriv-varyings regression Product: piglit Version: unspecified Hardware: x86-64 (AMD64) OS: All Status: NEW Keywords: bisected, regression Severity: normal Priority: medium Component: tests Assignee: piglit@lists.freedesktop.org Reporter: v...@freedesktop.org QA Contact: piglit@lists.freedesktop.org CC: ago...@igalia.com, i...@freedesktop.org piglit: 10d692dfbe0d1cab7c63116169402f2862e2c869 (master) $ ./bin/glsl-deriv-varyings -auto Probe color at (355,125) Expected: 0.80 0.40 0.00 Observed: 0.80 0.00 0.00 PIGLIT: {"result": "fail" } cd62eff8e5925efa56778d7a103402e96d19a794 is the first bad commit commit cd62eff8e5925efa56778d7a103402e96d19a794 Author: Andres Gomez Date: Tue Dec 16 18:01:42 2014 +0100 glsl-deriv-varyings: Fix some typos 1. Compile the correct shaders for fs4 and fs5. 2. Add a missing ) in fragShaderText5. Reviewed-by: Ian Romanick :04 04 b53d55bd3a7d6fadefafc71bf56e91705471e1bf 179471cdc12d9c055c3a23961e0176296292fe63 Mtests bisect run success -- You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug. ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] arb_direct_state_access: Test errors thrown by CopyTex[ture]SubImage*D.
--- .../spec/arb_direct_state_access/texture-errors.c | 48 ++ 1 file changed, 48 insertions(+) diff --git a/tests/spec/arb_direct_state_access/texture-errors.c b/tests/spec/arb_direct_state_access/texture-errors.c index 438d5c3..cf2772f 100644 --- a/tests/spec/arb_direct_state_access/texture-errors.c +++ b/tests/spec/arb_direct_state_access/texture-errors.c @@ -525,6 +525,53 @@ test_compressed_tex_subimage(void) return pass_tex && pass_texture_rect && pass_texture_bad_target; } +static bool +test_copy_tex_subimage(void) +{ + bool pass_tex = true; + bool pass_texture = true; + GLuint tex_3D, tex_2D; + + /* Call glCopyTexSubImage*D with target = 0. +* In Mesa Bug 89312, a dEQP test made similar calls and failed to +* receive GL_INVALID_ENUM. This checks to see if the situation was +* remedied properly. +*/ + glCopyTexSubImage1D(0, 0, 0, 0, 0, 32); + pass_tex = piglit_check_gl_error(GL_INVALID_ENUM) && pass_tex; + + glCopyTexSubImage2D(0, 0, 0, 0, 0, 0, 32, 32); + pass_tex = piglit_check_gl_error(GL_INVALID_ENUM) && pass_tex; + + glCopyTexSubImage3D(0, 0, 0, 0, 0, 0, 0, 32, 32); + pass_tex = piglit_check_gl_error(GL_INVALID_ENUM) && pass_tex; + + piglit_report_subtest_result(pass_tex ? PIGLIT_PASS : PIGLIT_FAIL, + "glCopyTexSubImage*D: GL_INVALID_ENUM for target = 0"); + + /* Check to make sure that the behavior of +* glCopyTextureSubImage*D is also correct. +*/ + glCreateTextures(GL_TEXTURE_2D, 1, &tex_2D); + glCreateTextures(GL_TEXTURE_3D, 1, &tex_3D); + + glCopyTextureSubImage1D(tex_2D, 0, 0, 0, 0, 32); + pass_texture = piglit_check_gl_error(GL_INVALID_ENUM) && pass_texture; + + glCopyTextureSubImage2D(tex_3D, 0, 0, 0, 0, 0, 32, 32); + pass_texture = piglit_check_gl_error(GL_INVALID_ENUM) && pass_texture; + + glCopyTextureSubImage3D(tex_2D, 0, 0, 0, 0, 0, 0, 32, 32); + pass_texture = piglit_check_gl_error(GL_INVALID_ENUM) && pass_texture; + + + piglit_report_subtest_result(pass_texture ? PIGLIT_PASS : +PIGLIT_FAIL, + "glCopyTextureSubImage*D: GL_INVALID_ENUM for bad targets"); + + return pass_tex && pass_texture; +} + enum piglit_result piglit_display(void) { @@ -547,6 +594,7 @@ piglit_display(void) } pass = test_compressed_tex_subimage() && pass; + pass = test_copy_tex_subimage() && pass; return pass ? PIGLIT_PASS : PIGLIT_FAIL; } -- 2.1.0 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] arb_direct_state_access: Test errors thrown by CompressedTex[ture]SubImage*D.
--- .../spec/arb_direct_state_access/texture-errors.c | 80 ++ 1 file changed, 80 insertions(+) diff --git a/tests/spec/arb_direct_state_access/texture-errors.c b/tests/spec/arb_direct_state_access/texture-errors.c index c79fbc4..438d5c3 100644 --- a/tests/spec/arb_direct_state_access/texture-errors.c +++ b/tests/spec/arb_direct_state_access/texture-errors.c @@ -447,6 +447,84 @@ test_texture_level_negative(void) return pass; } +static bool +test_compressed_tex_subimage(void) +{ + bool pass_tex = true; + bool pass_texture_rect = true; + bool pass_texture_bad_target = true; + GLuint tex_rect, tex_3D, tex_2D; + + /* Call glCompressedTexSubImage*D with target = 0. +* In Mesa Bug 89311, a dEQP test made similar calls and failed to +* receive GL_INVALID_ENUM. This checks to see if the situation was +* remedied properly. +*/ + glCompressedTexSubImage1D(0, 0, 0, 32, GL_RGBA8, 128, NULL); + pass_tex = piglit_check_gl_error(GL_INVALID_ENUM) && pass_tex; + + glCompressedTexSubImage2D(0, 0, 0, 0, 32, 32, GL_RGBA8, 4096, NULL); + pass_tex = piglit_check_gl_error(GL_INVALID_ENUM) && pass_tex; + + glCompressedTexSubImage3D(0, 0, 0, 0, 0, 32, 32, 3, GL_RGBA8, 12288, + NULL); + pass_tex = piglit_check_gl_error(GL_INVALID_ENUM) && pass_tex; + + piglit_report_subtest_result(pass_tex ? PIGLIT_PASS : PIGLIT_FAIL, + "glCompressedTexSubImage*D: GL_INVALID_ENUM for target = 0"); + + /* Check to make sure that the behavior of +* glCompressedTextureSubImage*D is also correct. +*/ + glCreateTextures(GL_TEXTURE_2D, 1, &tex_2D); + glCreateTextures(GL_TEXTURE_RECTANGLE, 1, &tex_rect); + glCreateTextures(GL_TEXTURE_3D, 1, &tex_3D); + + /* Rectangle checks: look for invalid operation */ + glCompressedTextureSubImage1D(tex_rect, 0, 0, 32, GL_RGBA8, 128, + NULL); + pass_texture_rect = piglit_check_gl_error(GL_INVALID_OPERATION) && + pass_texture_rect; + + glCompressedTextureSubImage2D(tex_rect, 0, 0, 0, 32, 32, GL_RGBA8, + 4096, NULL); + pass_texture_rect = piglit_check_gl_error(GL_INVALID_OPERATION) && + pass_texture_rect; + + glCompressedTextureSubImage3D(tex_rect, 0, 0, 0, 0, 32, 32, 3, + GL_RGBA8, 12288, NULL); + pass_texture_rect = piglit_check_gl_error(GL_INVALID_OPERATION) && + pass_texture_rect; + + piglit_report_subtest_result(pass_texture_rect ? PIGLIT_PASS : +PIGLIT_FAIL, + "glCompressedTextureSubImage*D: GL_INVALID_OPERATION " + "for target = TEXTURE_RECTANGLE"); + + /* Other texture checks: look for invalid enum */ + glCompressedTextureSubImage1D(tex_2D, 0, 0, 32, GL_RGBA8, 128, + NULL); + pass_texture_bad_target = piglit_check_gl_error(GL_INVALID_ENUM) && + pass_texture_bad_target; + + glCompressedTextureSubImage2D(tex_3D, 0, 0, 0, 32, 32, GL_RGBA8, + 4096, NULL); + pass_texture_bad_target = piglit_check_gl_error(GL_INVALID_ENUM) && + pass_texture_bad_target; + + glCompressedTextureSubImage3D(tex_2D, 0, 0, 0, 0, 32, 32, 3, + GL_RGBA8, 12288, NULL); + pass_texture_bad_target = piglit_check_gl_error(GL_INVALID_ENUM) && + pass_texture_bad_target; + + piglit_report_subtest_result(pass_texture_bad_target ? PIGLIT_PASS : +PIGLIT_FAIL, + "glCompressedTextureSubImage*D: GL_INVALID_ENUM for " + "bad targets"); + + return pass_tex && pass_texture_rect && pass_texture_bad_target; +} + enum piglit_result piglit_display(void) { @@ -468,6 +546,8 @@ piglit_display(void) pass &= test_texture_rec_texture_base(); } + pass = test_compressed_tex_subimage() && pass; + return pass ? PIGLIT_PASS : PIGLIT_FAIL; } -- 2.1.0 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH v2] arb_program_interface_query: GetProgramResourceLocation test
On Wed, Feb 25, 2015 at 2:18 AM, Tapani Pälli wrote: > > > On 02/19/2015 08:33 PM, Ilia Mirkin wrote: >> >> On Thu, Feb 19, 2015 at 7:54 AM, Tapani Pälli >> wrote: >>> >>> +static const char gs_subroutine_text[] = >>> + "#version 150\n" >>> + "#extension GL_ARB_explicit_attrib_location : require\n" >>> + "#extension GL_ARB_explicit_uniform_location : require\n" >>> + "#extension GL_ARB_shader_subroutine : require\n" >>> + "#extension GL_EXT_geometry_shader4 : require\n" >> >> >> oops? You're requiring GLSL 1.50, no need for EXT_geometry_shader4, right? >> > > True, I'll chop it away, does it otherwise look fine? I think there was another instance of you checking for ARB_geometry_shader4. As for the rest of it, I haven't read the spec in enough detail to really tell. You'll need someone more familiar with this than myself to go over it. (Or just push unreviewed as a lot of piglit tends to be due to lack of reviewers.) -ilia ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 0/9] Direct State Access tests series
I'm curious. Which NVIDIA driver did you use? I installed 340.23 in the fall and its coverage of DSA was not great. It didn't support ARB_texture_storage, which is kind of essential for taking advantage of DSA textures. I'm not surprised if that driver fails tests. Sorry about the lack of reviews. There has been a lot on my plate recently, and it doesn't show any signs of letting up. On Wed, Feb 25, 2015 at 4:30 AM, Martin Peres wrote: > On 16/02/15 15:12, Martin Peres wrote: > >> Here are the tests I have been working on while implementing the following >> parts of the DSA extension: >> - Transform Feedback object >> - Renderbuffer object >> - Sampler object >> - Program Pipeline object >> - Query object >> >> This series adds 115 tests and requires patches I am about to send to the >> mesa-dev ML, the MESA_EXTENSION_OVERRIDE=GL_ARB_direct_state_access env >> variable and i915.enable_ppgtt=2 in order to all be run successfully on >> Haswell (only platform tested). >> >> Please test and review. >> > > I ran those tests on NVIDIA and only three fail: > - create-queries "invalid target" : nvidia does not check the target as it > should > - namedrenderbuffer "invalid format" : nvidia does not check the required > format > (it accepts GL_TRUE instead of a valid format such as GL_RGBA) > - transformfeedback-bufferrange "bind a non-existing output BO" : > Apparently, > binding an invalid BO id is legal with nvidia :o At least, it produces no > error > > Could I get more reviews please? I would like to push those on Friday! > > Martin > > > ___ > Piglit mailing list > Piglit@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/piglit > ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 2/2] shaders: add test to check (x+y cmp 0) optimization
--- tests/all.py | 1 + tests/shaders/CMakeLists.gl.txt | 1 + tests/shaders/glsl-opt-xy-cmp-0.c | 130 ++ 3 files changed, 132 insertions(+) create mode 100644 tests/shaders/glsl-opt-xy-cmp-0.c diff --git a/tests/all.py b/tests/all.py index d07ae35..7797756 100644 --- a/tests/all.py +++ b/tests/all.py @@ -507,6 +507,7 @@ add_concurrent_test(shaders, ['glsl-link-bug38015']) add_concurrent_test(shaders, ['glsl-link-empty-prog-01']) add_concurrent_test(shaders, ['glsl-link-empty-prog-02']) add_concurrent_test(shaders, ['glsl-opt-0-cmp-xy']) +add_concurrent_test(shaders, ['glsl-opt-xy-cmp-0']) shaders['GLSL link single global initializer, 2 shaders'] = \ PiglitGLTest(['glsl-link-test', os.path.join('shaders', 'glsl-link-initializer-01a.vert'), diff --git a/tests/shaders/CMakeLists.gl.txt b/tests/shaders/CMakeLists.gl.txt index 521282b..11e5f20 100644 --- a/tests/shaders/CMakeLists.gl.txt +++ b/tests/shaders/CMakeLists.gl.txt @@ -146,6 +146,7 @@ piglit_add_executable (shader_runner shader_runner.c parser_utils.c) piglit_add_executable (glsl-vs-point-size glsl-vs-point-size.c) piglit_add_executable (glsl-sin glsl-sin.c) piglit_add_executable (glsl-opt-0-cmp-xy glsl-opt-0-cmp-xy.c) +piglit_add_executable (glsl-opt-xy-cmp-0 glsl-opt-xy-cmp-0.c) IF (UNIX) target_link_libraries(glsl-sin m) ENDIF (UNIX) diff --git a/tests/shaders/glsl-opt-xy-cmp-0.c b/tests/shaders/glsl-opt-xy-cmp-0.c new file mode 100644 index 000..c48bb7d --- /dev/null +++ b/tests/shaders/glsl-opt-xy-cmp-0.c @@ -0,0 +1,130 @@ +/* + * 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. + * + * Authors: + *Samuel Iglesias Gonsalvez + * + */ + +/** @file glsl-opt-xy-cmp-0.c + * + * It checks (x+y cmp 0) optimization (if any) works fine. + * + * Test renders two rectangles: left rect's color is red, right rect's color + * is green. Left rectangle's width is one pixel larger than right rectangle's. + * + */ + +#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; +config.window_width = 50; +config.window_height = 50; + +PIGLIT_GL_TEST_CONFIG_END + +static char vs_code[] = +"uniform float a;\n" + +"void main()\n" +"{\n" +"gl_Position = ftransform();\n" +"}\n"; + +static char fs_code[] = +"uniform float a;\n" + +"void main()\n" +"{\n" +"if ((a - 1.0) >= 0.0)\n" +"gl_FragColor = vec4(0, 1, 0, 1);\n" +"else\n" +"gl_FragColor = vec4(1, 0, 0, 1);\n" +"}\n"; + +static GLuint setup_shaders() +{ +GLuint vs, fs, prog; + +vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vs_code); +fs = piglit_compile_shader_text(GL_FRAGMENT_SHADER, fs_code); +prog = piglit_link_simple_program(vs, fs); + +glUseProgram(prog); +return prog; +} + +static GLboolean test() +{ +GLint prog, location; +GLboolean pass = GL_TRUE; +int i; +float color[4] = {0, 0, 0, 1}; + +prog = setup_shaders(); +location = glGetUniformLocation(prog, "a"); + +for (i = 0; i < 49; i++) { +glUniform1f(location, (i - 25)); +piglit_draw_rect(i, 0, i+1, 50); +} +if (!piglit_check_gl_error(GL_NO_ERROR)) +piglit_report_result(PIGLIT_FAIL); + +for (i = 0; i < 50; i++) { +float val = i - 25; +if ((val - 1.0) >= 0.0f) { +color[1] = 1.0f; +color[0] = color[2] = 0.0f; +} else { +color[0] = 1.0f; +color[1] = color[2] = 0.0f; +} +pass = piglit_probe_pixel_rgb(i, 0, color) && pass; +} + +return pass; +} + +enum piglit_result piglit_display(void) +{ +GLboolean pass; + +piglit_ortho_projection(pigl
[Piglit] [PATCH 1/2] shaders: add test to check (0 cmp x+y) optimization
--- tests/all.py | 1 + tests/shaders/CMakeLists.gl.txt | 1 + tests/shaders/glsl-opt-0-cmp-xy.c | 130 ++ 3 files changed, 132 insertions(+) create mode 100644 tests/shaders/glsl-opt-0-cmp-xy.c diff --git a/tests/all.py b/tests/all.py index 40f38cf..d07ae35 100644 --- a/tests/all.py +++ b/tests/all.py @@ -506,6 +506,7 @@ add_concurrent_test(shaders, ['glsl-link-bug30552']) add_concurrent_test(shaders, ['glsl-link-bug38015']) add_concurrent_test(shaders, ['glsl-link-empty-prog-01']) add_concurrent_test(shaders, ['glsl-link-empty-prog-02']) +add_concurrent_test(shaders, ['glsl-opt-0-cmp-xy']) shaders['GLSL link single global initializer, 2 shaders'] = \ PiglitGLTest(['glsl-link-test', os.path.join('shaders', 'glsl-link-initializer-01a.vert'), diff --git a/tests/shaders/CMakeLists.gl.txt b/tests/shaders/CMakeLists.gl.txt index 3efc6bf..521282b 100644 --- a/tests/shaders/CMakeLists.gl.txt +++ b/tests/shaders/CMakeLists.gl.txt @@ -145,6 +145,7 @@ piglit_add_executable (glsl-routing glsl-routing.c) piglit_add_executable (shader_runner shader_runner.c parser_utils.c) piglit_add_executable (glsl-vs-point-size glsl-vs-point-size.c) piglit_add_executable (glsl-sin glsl-sin.c) +piglit_add_executable (glsl-opt-0-cmp-xy glsl-opt-0-cmp-xy.c) IF (UNIX) target_link_libraries(glsl-sin m) ENDIF (UNIX) diff --git a/tests/shaders/glsl-opt-0-cmp-xy.c b/tests/shaders/glsl-opt-0-cmp-xy.c new file mode 100644 index 000..65cb555 --- /dev/null +++ b/tests/shaders/glsl-opt-0-cmp-xy.c @@ -0,0 +1,130 @@ +/* + * 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. + * + * Authors: + *Samuel Iglesias Gonsalvez + * + */ + +/** @file glsl-opt-0-cmp-xy.c + * + * It checks (0 cmp x+y) optimization (if any) works fine. + * + * Test renders two rectangles: left rect's color is green, right rect's color + * is red. Left rectangle's width is one pixel larger than right rectangle's. + * + */ + +#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; +config.window_width = 50; +config.window_height = 50; + +PIGLIT_GL_TEST_CONFIG_END + +static char vs_code[] = +"uniform float a;\n" + +"void main()\n" +"{\n" +"gl_Position = ftransform();\n" +"}\n"; + +static char fs_code[] = +"uniform float a;\n" + +"void main()\n" +"{\n" +"if (0.0 >= (a - 1.0))\n" +"gl_FragColor = vec4(0, 1, 0, 1);\n" +"else\n" +"gl_FragColor = vec4(1, 0, 0, 1);\n" +"}\n"; + +static GLuint setup_shaders() +{ +GLuint vs, fs, prog; + +vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vs_code); +fs = piglit_compile_shader_text(GL_FRAGMENT_SHADER, fs_code); +prog = piglit_link_simple_program(vs, fs); + +glUseProgram(prog); +return prog; +} + +static GLboolean test() +{ +GLint prog, location; +GLboolean pass = GL_TRUE; +int i; +float color[4] = {0, 0, 0, 1}; + +prog = setup_shaders(); +location = glGetUniformLocation(prog, "a"); + +for (i = 0; i < 49; i++) { +glUniform1f(location, (i - 25)); +piglit_draw_rect(i, 0, i+1, 50); +} +if (!piglit_check_gl_error(GL_NO_ERROR)) +piglit_report_result(PIGLIT_FAIL); + +for (i = 0; i < 50; i++) { +float val = i - 25; +if (0.0f >= (val - 1.0)) { +color[1] = 1.0f; +color[0] = color[2] = 0.0f; +} else { +color[0] = 1.0f; +color[1] = color[2] = 0.0f; +} +pass = piglit_probe_pixel_rgb(i, 0, color) && pass; +} + +return pass; +} + +enum piglit_result piglit_display(void) +{ +GLboolean pass; + +piglit_ortho_projection(piglit_width, pigl
Re: [Piglit] [PATCH 0/9] Direct State Access tests series
On 16/02/15 15:12, Martin Peres wrote: Here are the tests I have been working on while implementing the following parts of the DSA extension: - Transform Feedback object - Renderbuffer object - Sampler object - Program Pipeline object - Query object This series adds 115 tests and requires patches I am about to send to the mesa-dev ML, the MESA_EXTENSION_OVERRIDE=GL_ARB_direct_state_access env variable and i915.enable_ppgtt=2 in order to all be run successfully on Haswell (only platform tested). Please test and review. I ran those tests on NVIDIA and only three fail: - create-queries "invalid target" : nvidia does not check the target as it should - namedrenderbuffer "invalid format" : nvidia does not check the required format (it accepts GL_TRUE instead of a valid format such as GL_RGBA) - transformfeedback-bufferrange "bind a non-existing output BO" : Apparently, binding an invalid BO id is legal with nvidia :o At least, it produces no error Could I get more reviews please? I would like to push those on Friday! Martin ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] utils: Write event loop for Waffle+WGL
On 23/02/15 21:00, Emil Velikov wrote: On 20 February 2015 at 23:38, Jose Fonseca wrote: Without this it is not really possible to see test rendering interactively. I'm a bit low on experience wrt Windows input code, but this looks great afaict. Fwiw Reviewed-by: Emil Velikov --- .../piglit-framework-gl/piglit_wgl_framework.c | 72 +++--- 1 file changed, 64 insertions(+), 8 deletions(-) diff --git a/tests/util/piglit-framework-gl/piglit_wgl_framework.c b/tests/util/piglit-framework-gl/piglit_wgl_framework.c index 4df2eb6..1cce4b2 100644 --- a/tests/util/piglit-framework-gl/piglit_wgl_framework.c +++ b/tests/util/piglit-framework-gl/piglit_wgl_framework.c @@ -29,16 +29,72 @@ #include "piglit_wl_framework.h" static void -enter_event_loop(struct piglit_winsys_framework *winsys_fw) +process_next_event(struct piglit_winsys_framework *winsys_fw) { + const struct piglit_gl_test_config *test_config = winsys_fw->wfl_fw.gl_fw.test_config; + + BOOL bRet; + MSG msg; + + bRet = GetMessage(&msg, NULL, 0, 0 ); + if (bRet <= 0) { + return; + } + + switch (msg.message) { + case WM_PAINT: + winsys_fw->need_redisplay = true; + break; + case WM_SIZE: + if (winsys_fw->user_reshape_func) { + RECT rect; + if (GetClientRect(msg.hwnd, &rect)) { + int width = rect.right - rect.left; + int height = rect.bottom - rect.top; + winsys_fw->user_reshape_func(width, height); + } + } + winsys_fw->need_redisplay = true; + break; + case WM_KEYDOWN: + switch (msg.wParam) { + case VK_ESCAPE: + PostMessage(msg.hwnd, WM_CLOSE, 0, 0); + break; + } + break; + case WM_CHAR: + if (winsys_fw->user_keyboard_func) { + winsys_fw->user_keyboard_func(msg.wParam, 0, 0); Just a question - some tests actually set the keyboard_func. Do those work under Windows ? I confess I haven't tried them yet. It should in theory -- the code is there. But looking at tests/texturing/lodbias.c, I don't think the escape key will ever reach the key handler function, as it is intercepted. Maybe I should only handle the escape key when there is no user_keyboard_func . That might be more helpful. There's a power outage here affecting many of my development machines, so I can't try it now, but I'll give it a try when I can, and maybe polish things a bit in a follow on commmit. + } + winsys_fw->need_redisplay = true; + break; + case WM_CLOSE: + exit(0); + case WM_QUIT: + exit(0); As a future work we might want to clean/teardown things here (also in piglit_x11_framework), but until then this will do just fine. Feel free to add a comment if you have a second. I'll add a comment to that effect. Thanks Jose! -Emil Thanks for the review Emil. Jose ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit