[Piglit] [PATCH v2] spec/arb_blend_func_extended: Add test for SIMD16 dual source blending
On Intel hardware at least, SIMD16 dual source rendering requires handling pixel data in two sets of 8 pixels each. Incorrect implementations may fail to map correct colors for each pixel group (for example by using the color for the first group as the color for the second group or viceversa). However, tests that render using solid colors across the entire polygon won't catch these cases (since in that case the color is the same for boths groups of pixels). This test blends using a checker board pattern where each cell is 10px wide and 10px tall. This makes it so that the two sets of 8 pixels issued during SIMD16 operation pack different color data for the pixels involved, enabling testing of correct behavior in that case. v2 (Matt Turner) - Make the test render to a window if -fbo or -auto are not present. --- tests/all.py | 2 + .../execution/CMakeLists.gl.txt| 1 + .../execution/fbo-extended-blend-pattern.c | 154 + 3 files changed, 157 insertions(+) create mode 100644 tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c diff --git a/tests/all.py b/tests/all.py index dc73c77..de08ea7 100644 --- a/tests/all.py +++ b/tests/all.py @@ -3847,6 +3847,8 @@ with profile.group_manager( g(['arb_blend_func_extended-fbo-extended-blend'], run_concurrent=False) g(['arb_blend_func_extended-fbo-extended-blend-explicit'], run_concurrent=False) +g(['arb_blend_func_extended-fbo-extended-blend-pattern'], + run_concurrent=False) with profile.group_manager( PiglitGLTest, diff --git a/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt b/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt index ebe0fa0..1db7fa1 100644 --- a/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt +++ b/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt @@ -12,4 +12,5 @@ link_libraries ( piglit_add_executable (arb_blend_func_extended-fbo-extended-blend fbo-extended-blend.c) piglit_add_executable (arb_blend_func_extended-fbo-extended-blend-explicit fbo-extended-blend-explicit.c) +piglit_add_executable (arb_blend_func_extended-fbo-extended-blend-pattern fbo-extended-blend-pattern.c) # vim: ft=cmake: diff --git a/tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c b/tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c new file mode 100644 index 000..201adfa --- /dev/null +++ b/tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2014 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/** + * @file fbo-extended-blend-pattern.c + * @author Iago Toral Quiroga + * + * On Intel hardware at least, SIMD16 dual source rendering requires handling + * pixel data in two sets of 8 pixels each. Incorrect implementations may fail + * to map correct colors for each pixel group (for example by using the color + * for the first group as the color for the second group or viceversa). However, + * tests that render using solid colors across the entire polygon won't catch + * these cases (since in that case the color is the same for boths groups of + * pixels). + * + * This test blends using a checker board pattern where each cell is + * 10px wide and 10px tall. This makes it so that the two sets of 8 pixels + * issued during SIMD16 operation pack different color data for the pixels + * involved, enabling testing of correct behavior in that case. + * + * This only tests with one specific blend mode. There is no need to test + * others, since the details of SIMD16 operation are independent of the + * specific blend mode we use and general testing of the multiple blend modes + * and parameters is already covered by the tests in fbo-extended-blend.c. + */ + +#include "piglit-
[Piglit] [PATCH] Delete redundant condition-07.vert test.
This test is redundant with: glsl-1.20/compiler/structure-and-array-operations/array-selection.vert Both contain the same shader code and the same spec citation - the only difference is variable names and the exact portion of the text quoted. The other one has a better name, so keep it and delete condition-07. --- tests/glslparsertest/glsl2/condition-07.vert | 26 -- 1 file changed, 26 deletions(-) delete mode 100644 tests/glslparsertest/glsl2/condition-07.vert diff --git a/tests/glslparsertest/glsl2/condition-07.vert b/tests/glslparsertest/glsl2/condition-07.vert deleted file mode 100644 index 189c493..000 --- a/tests/glslparsertest/glsl2/condition-07.vert +++ /dev/null @@ -1,26 +0,0 @@ -// [config] -// expect_result: pass -// glsl_version: 1.20 -// -// [end config] - -/* PASS - * - * From page 38 (page 44 of the PDF) of the GLSL 1.20 spec: - * - *"The second and third expressions can be any type, as long their types - *match, or there is a conversion in Section 4.1.10 "Implicit Conversions" - *that can be applied to one of the expressions to make their types - *match." - */ -#version 120 - -uniform bool selector; -uniform vec4 a[2]; -uniform vec4 b[2]; -uniform int idx; - -void main() -{ - gl_Position = (selector ? a : b)[idx]; -} -- 2.2.2 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH v2 1/2] shaders: add test to check (0 cmp x+y) optimization
Hello, I plan to push these two patches next week, just in case someone wants to review them in the coming days. Thanks, Sam On Mon, 2015-03-02 at 08:31 +0100, Samuel Iglesias Gonsalvez wrote: > Signed-off-by: Samuel Iglesias Gonsalvez > --- > > v2: > * Implement it as shader_runner test > > tests/shaders/glsl-opt-0-cmp-xy.shader_test | 33 > + > 1 file changed, 33 insertions(+) > create mode 100644 tests/shaders/glsl-opt-0-cmp-xy.shader_test > > diff --git a/tests/shaders/glsl-opt-0-cmp-xy.shader_test > b/tests/shaders/glsl-opt-0-cmp-xy.shader_test > new file mode 100644 > index 000..57c5716 > --- /dev/null > +++ b/tests/shaders/glsl-opt-0-cmp-xy.shader_test > @@ -0,0 +1,33 @@ > +/* Test (0 cmp x+y) optimization. */ > + > +[require] > +GLSL >= 1.10 > + > +[vertex shader] > + > +void main() > +{ > + gl_Position = ftransform(); > +} > + > +[fragment shader] > + > +uniform float a; > + > +void main() > +{ > + if (0.0 >= (a - 1.0)) > + gl_FragColor = vec4(0, 1, 0, 1); > + else > + gl_FragColor = vec4(1, 0, 0, 1); > +} > + > +[test] > +clear color 0.5 0.5 0.5 0.5 > +clear > +uniform float a 0 > +draw rect -1 -1 1 2 > +uniform float a 2 > +draw rect 0 -1 1 2 > +probe rgb 125 0 1.0 0.0 0.0 > +probe rgb 0 0 0.0 1.0 0.0 signature.asc Description: This is a digitally signed message part ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] Some glean test names broken in HTML summary since "all.py: Convert all.py to use TestProfile.group_manager"
Hi Dylan, your commit b799e8c57ec77c4cfbabb165dcd45294d80e9f6c broke the names of some glean tests in the HTML summary for me. They now have a space between every character, e.g. "a p i 2" instead of "api2". -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 04/15] arb_direct_state_access: Test NamedFramebufferTexture[Layer].
--- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + .../spec/arb_direct_state_access/framebufferblit.c | 326 + 3 files changed, 328 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/framebufferblit.c diff --git a/tests/all.py b/tests/all.py index 8e45442..71b4498 100644 --- a/tests/all.py +++ b/tests/all.py @@ -4029,6 +4029,7 @@ spec['ARB_direct_state_access']['flushmappednamedbufferrange'] = PiglitGLTest([' spec['ARB_direct_state_access']['getnamedbufferparameter'] = PiglitGLTest(['arb_direct_state_access-getnamedbufferparameter'], run_concurrent=True) spec['ARB_direct_state_access']['getnamedbuffersubdata'] = PiglitGLTest(['arb_direct_state_access-getnamedbuffersubdata'], run_concurrent=True) spec['ARB_direct_state_access']['namedframebufferrenderbuffer'] = PiglitGLTest(['arb_direct_state_access-namedframebufferrenderbuffer'], run_concurrent=True) +spec['ARB_direct_state_access']['framebufferblit'] = PiglitGLTest(['arb_direct_state_access-framebufferblit'], run_concurrent=True) arb_shader_image_load_store = spec['ARB_shader_image_load_store'] arb_shader_image_load_store['atomicity'] = PiglitGLTest(['arb_shader_image_load_store-atomicity'], run_concurrent=True) diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index 488ca18..727acc2 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -26,6 +26,7 @@ piglit_add_executable (arb_direct_state_access-flushmappednamedbufferrange flush piglit_add_executable (arb_direct_state_access-getnamedbufferparameter getnamedbufferparameter.c) piglit_add_executable (arb_direct_state_access-getnamedbuffersubdata getnamedbuffersubdata.c) piglit_add_executable (arb_direct_state_access-namedframebufferrenderbuffer namedframebufferrenderbuffer.c) +piglit_add_executable (arb_direct_state_access-framebufferblit framebufferblit.c) piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-texturesubimage texturesubimage.c) piglit_add_executable (arb_direct_state_access-bind-texture-unit bind-texture-unit.c) diff --git a/tests/spec/arb_direct_state_access/framebufferblit.c b/tests/spec/arb_direct_state_access/framebufferblit.c new file mode 100644 index 000..e405dec --- /dev/null +++ b/tests/spec/arb_direct_state_access/framebufferblit.c @@ -0,0 +1,326 @@ +/* + * Copyright © 2013, 2015 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + + +/** @file framebufferblit.c + * + * Section 4.3.2(Reading and Copying Pixels) From GL spec 3.2 core: + * If the read framebuffer is layered (see section 4.4.7), pixel values are + * read from layer zero. If the draw framebuffer is layered, pixel values are + * written to layer zero. If both read and draw framebuffers are layered, the + * blit operation is still performed only on layer zero. + * + * Test Layout + * *---*---*test1: + * | | | Source tex is layered, destination tex is layered + * | test3 | test4 |test2: + * | | | Source tex is layered, destination tex is not layered + * *---*---*test3: + * | | | Source tex is not layered, destination tex is layered + * | test1 | test2 |test4: + * | | | Source tex is not layered, destination tex is not layered + * *---*---* + * + *src dst Each Test + * *---*---* Display source tex layers on left + * | | | layer 1 Blit source tex to destination tex + * *---*---* Display resulting layers + * | | | layer 2 + * *---*---* + * + * Based on tests/spec/gl-3.2/layered-rendering/blit.c + * This file
[Piglit] [PATCH 08/15] arb_direct_state_access: Testing BlitNamedFramebuffers.
--- .../spec/arb_direct_state_access/framebufferblit.c | 37 ++ 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/tests/spec/arb_direct_state_access/framebufferblit.c b/tests/spec/arb_direct_state_access/framebufferblit.c index 2866c78..fb746d1 100644 --- a/tests/spec/arb_direct_state_access/framebufferblit.c +++ b/tests/spec/arb_direct_state_access/framebufferblit.c @@ -94,11 +94,11 @@ display_texture(int x, int y, GLuint tex, int layers) tex, 0); /* Blit layer to screen */ - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo); - glBindFramebuffer(GL_READ_FRAMEBUFFER, tempFBO); - glBlitFramebuffer(0, 0, texWidth, texHeight, - x, y, x + texWidth, y + texDepth * texHeight, - GL_COLOR_BUFFER_BIT, GL_NEAREST); + glBlitNamedFramebuffer(tempFBO, piglit_winsys_fbo, + 0, 0, texWidth, texHeight, + x, y, x + texWidth, + y + texDepth * texHeight, + GL_COLOR_BUFFER_BIT, GL_NEAREST); } else { int i; @@ -118,19 +118,18 @@ display_texture(int x, int y, GLuint tex, int layers) } /* Blit layer to screen */ - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo); - glBindFramebuffer(GL_READ_FRAMEBUFFER, tempFBO); - glBlitFramebuffer(0, 0, texWidth, texHeight, - x, - y + i * texHeight, - x + texWidth, - y + (i + 1) * texHeight, - GL_COLOR_BUFFER_BIT, GL_NEAREST); + glBlitNamedFramebuffer(tempFBO, piglit_winsys_fbo, + 0, 0, texWidth, texHeight, + x, + y + i * texHeight, + x + texWidth, + y + (i + 1) * texHeight, + GL_COLOR_BUFFER_BIT, + GL_NEAREST); } } /* Cleanup temp fbo */ - glBindFramebuffer(GL_FRAMEBUFFER, piglit_winsys_fbo); glDeleteFramebuffers(1, &tempFBO); return piglit_check_gl_error(GL_NO_ERROR); @@ -249,11 +248,9 @@ testFramebufferBlitLayered(int x, int y, bool srcLayered, bool dstLayered) } /* Blit from source to destination framebuffers */ - glBindFramebuffer(GL_READ_FRAMEBUFFER, srcFBO); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, dstFBO); - glBlitFramebuffer(0, 0, texWidth, texHeight, - 0, 0, texWidth, texHeight, - GL_COLOR_BUFFER_BIT, GL_LINEAR); + glBlitNamedFramebuffer(srcFBO, dstFBO, 0, 0, texWidth, texHeight, + 0, 0, texWidth, texHeight, + GL_COLOR_BUFFER_BIT, GL_LINEAR); /* Display the results */ display_texture(x, y, srcTex, srcLayered ? texDepth : 1); @@ -271,7 +268,6 @@ testFramebufferBlitLayered(int x, int y, bool srcLayered, bool dstLayered) } /* Clean up */ - glBindFramebuffer(GL_FRAMEBUFFER, piglit_winsys_fbo); glDeleteFramebuffers(1, &srcFBO); glDeleteFramebuffers(1, &dstFBO); glDeleteTextures(1, &srcTex); @@ -297,7 +293,6 @@ piglit_display(void) { bool pass = true; - glBindFramebuffer(GL_FRAMEBUFFER, piglit_winsys_fbo); glClearColor(1,1,1,1); glClear(GL_COLOR_BUFFER_BIT); -- 2.1.0 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 06/15] arb_direct_state_access: Testing CheckNamedFramebufferStatus errors.
--- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + .../arb_direct_state_access/checkfbstatus-errors.c | 117 + 3 files changed, 119 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/checkfbstatus-errors.c diff --git a/tests/all.py b/tests/all.py index 71b4498..3015857 100644 --- a/tests/all.py +++ b/tests/all.py @@ -4030,6 +4030,7 @@ spec['ARB_direct_state_access']['getnamedbufferparameter'] = PiglitGLTest(['arb_ spec['ARB_direct_state_access']['getnamedbuffersubdata'] = PiglitGLTest(['arb_direct_state_access-getnamedbuffersubdata'], run_concurrent=True) spec['ARB_direct_state_access']['namedframebufferrenderbuffer'] = PiglitGLTest(['arb_direct_state_access-namedframebufferrenderbuffer'], run_concurrent=True) spec['ARB_direct_state_access']['framebufferblit'] = PiglitGLTest(['arb_direct_state_access-framebufferblit'], run_concurrent=True) +spec['ARB_direct_state_access']['checkfbstatus-errors'] = PiglitGLTest(['arb_direct_state_access-checkfbstatus-errors'], run_concurrent=True) arb_shader_image_load_store = spec['ARB_shader_image_load_store'] arb_shader_image_load_store['atomicity'] = PiglitGLTest(['arb_shader_image_load_store-atomicity'], run_concurrent=True) diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index 727acc2..744735a 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -27,6 +27,7 @@ piglit_add_executable (arb_direct_state_access-getnamedbufferparameter getnamedb piglit_add_executable (arb_direct_state_access-getnamedbuffersubdata getnamedbuffersubdata.c) piglit_add_executable (arb_direct_state_access-namedframebufferrenderbuffer namedframebufferrenderbuffer.c) piglit_add_executable (arb_direct_state_access-framebufferblit framebufferblit.c) +piglit_add_executable (arb_direct_state_access-checkfbstatus-errors checkfbstatus-errors.c) piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-texturesubimage texturesubimage.c) piglit_add_executable (arb_direct_state_access-bind-texture-unit bind-texture-unit.c) diff --git a/tests/spec/arb_direct_state_access/checkfbstatus-errors.c b/tests/spec/arb_direct_state_access/checkfbstatus-errors.c new file mode 100644 index 000..e8a8323 --- /dev/null +++ b/tests/spec/arb_direct_state_access/checkfbstatus-errors.c @@ -0,0 +1,117 @@ +/* + * Copyright © 2015 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/** @file checkfbstatus-errors.c + * + * Make sure that glCheckNamedFramebufferStatus behaves according to the + * OpenGL 4.5 spec (30.10.2014). + * + * Section 9.4 Framebuffer Completeness of the OpenGL 4.5 core spec + * (30.10.2014, PDF page 336) says: + *"If framebuffer is zero, then the status of the default read or + *draw framebuffer (as determined by target) is returned." + */ + +#include "piglit-util-gl.h" +#include "dsa-utils.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_core_version = 32; + +PIGLIT_GL_TEST_CONFIG_END + +void +piglit_init(int argc, char **argv) +{ + piglit_require_extension("GL_ARB_direct_state_access"); +} + +static bool +check_fbo_status(GLuint fbo, GLenum target, GLenum expected_status) +{ + GLenum fbstatus; + fbstatus = glCheckNamedFramebufferStatus(fbo, target); + if (fbstatus != expected_status) { + printf("fbo=%u, target=%s status: got %s, expected %s\n", + fbo, piglit_get_gl_enum_name(target), + piglit_get_gl_enum_name(fbstatus), + piglit_get_gl_enum_name(expected_status)); + return false; + } + + return true; +} + +enum pi
[Piglit] [PATCH 02/15] arb_direct_state_access: Testing glCreateFramebuffers "in the wild."
--- tests/spec/arb_direct_state_access/gettextureimage-formats.c | 2 +- tests/spec/arb_direct_state_access/gettextureimage-luminance.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/spec/arb_direct_state_access/gettextureimage-formats.c b/tests/spec/arb_direct_state_access/gettextureimage-formats.c index e2d637c..f00726c 100644 --- a/tests/spec/arb_direct_state_access/gettextureimage-formats.c +++ b/tests/spec/arb_direct_state_access/gettextureimage-formats.c @@ -95,7 +95,7 @@ make_texture_image(GLenum intFormat, GLubyte upperRightTexel[4]) } /* Initialize the texture with glDrawPixels. */ - glGenFramebuffers(1, &fb); + glCreateFramebuffers(1, &fb); glBindFramebuffer(GL_FRAMEBUFFER, fb); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture_id, 0); diff --git a/tests/spec/arb_direct_state_access/gettextureimage-luminance.c b/tests/spec/arb_direct_state_access/gettextureimage-luminance.c index 3add1d7..ec6a2cc 100644 --- a/tests/spec/arb_direct_state_access/gettextureimage-luminance.c +++ b/tests/spec/arb_direct_state_access/gettextureimage-luminance.c @@ -158,7 +158,7 @@ test_fbo_readpixels_lum_as_rgba(void) /* create an FBO to wrap the texture so we can read it back * with glReadPixels */ - glGenFramebuffers(1, &fbo); + glCreateFramebuffers(1, &fbo); glBindFramebuffer(GL_FRAMEBUFFER, fbo); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, tex, 0); @@ -211,7 +211,7 @@ test_fbo_readpixels_rgba_as_lum(void) /* create an FBO to wrap the texture so we can read it back * with glReadPixels */ - glGenFramebuffers(1, &fbo); + glCreateFramebuffers(1, &fbo); glBindFramebuffer(GL_FRAMEBUFFER, fbo); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, tex, 0); -- 2.1.0 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 11/15] arb_direct_state_access: Add test for glDrawBuffer/glReadBuffer.
This lays the groundwork for testing NamedFramebufferDrawBuffer, NamedFramebufferDrawBuffers, and NamedFramebufferReadBuffer. --- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + tests/spec/arb_direct_state_access/drawbuffers.c | 110 + 3 files changed, 112 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/drawbuffers.c diff --git a/tests/all.py b/tests/all.py index ffa5b2e..0ed7cfb 100644 --- a/tests/all.py +++ b/tests/all.py @@ -4034,6 +4034,7 @@ spec['ARB_direct_state_access']['checkfbstatus-errors'] = PiglitGLTest(['arb_dir spec['ARB_direct_state_access']['fbattachmentparam-errors'] = PiglitGLTest(['arb_direct_state_access-fbattachmentparam-errors'], run_concurrent=True) spec['ARB_direct_state_access']['invalidateframebuffer'] = PiglitGLTest(['arb_direct_state_access-invalidateframebuffer'], run_concurrent=True) spec['ARB_direct_state_access']['clearnamedframebuffer'] = PiglitGLTest(['arb_direct_state_access-clearnamedframebuffer'], run_concurrent=True) +spec['ARB_direct_state_access']['drawbuffers'] = PiglitGLTest(['arb_direct_state_access-drawbuffers'], run_concurrent=True) arb_shader_image_load_store = spec['ARB_shader_image_load_store'] arb_shader_image_load_store['atomicity'] = PiglitGLTest(['arb_shader_image_load_store-atomicity'], run_concurrent=True) diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index f83dc01..c283321 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -31,6 +31,7 @@ piglit_add_executable (arb_direct_state_access-checkfbstatus-errors checkfbstatu piglit_add_executable (arb_direct_state_access-fbattachmentparam-errors fbattachmentparam-errors.c) piglit_add_executable (arb_direct_state_access-invalidateframebuffer invalidateframebuffer.c) piglit_add_executable (arb_direct_state_access-clearnamedframebuffer clearnamedframebuffer.c) +piglit_add_executable (arb_direct_state_access-drawbuffers drawbuffers.c) piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-texturesubimage texturesubimage.c) piglit_add_executable (arb_direct_state_access-bind-texture-unit bind-texture-unit.c) diff --git a/tests/spec/arb_direct_state_access/drawbuffers.c b/tests/spec/arb_direct_state_access/drawbuffers.c new file mode 100644 index 000..6e7ecf5 --- /dev/null +++ b/tests/spec/arb_direct_state_access/drawbuffers.c @@ -0,0 +1,110 @@ +/* + * Copyright © 2015 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/** @file drawbuffers.c + * + * Tests explicitly setting the read and draw framebuffers. + * + * Somewhat inspired by tests/general/read-front.c. + */ + +#include "piglit-util-gl.h" +#include "dsa-utils.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 32; + + config.window_visual = PIGLIT_GL_VISUAL_RGBA | + PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + +static bool pass = true; + +void +piglit_init(int argc, char **argv) +{ + piglit_require_extension("GL_ARB_direct_state_access"); +} + +static GLuint fbo; + +static void +clear_to_color(float color[4], int att) +{ + glClearColor(color[0], color[1], color[2], color[3]); + glDrawBuffer(GL_COLOR_ATTACHMENT0 + att); + glClear(GL_COLOR_BUFFER_BIT); +} + +static void +clear_subtest(float color[4], int att, const char *test_name) +{ + glReadBuffer(GL_COLOR_ATTACHMENT0 + att); + piglit_check_gl_error(GL_NO_ERROR); + SUBTESTCONDITION(piglit_probe_rect_rgb(0, 0, piglit_width, +piglit_height, color), pass, test_name); +} + +enum piglit_result +piglit_display(void)
[Piglit] [PATCH 10/15] arb_direct_state_access: Testing glClearNamedFramebuffer*.
--- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + .../clearnamedframebuffer.c| 115 + 3 files changed, 117 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/clearnamedframebuffer.c diff --git a/tests/all.py b/tests/all.py index d03f661..ffa5b2e 100644 --- a/tests/all.py +++ b/tests/all.py @@ -4033,6 +4033,7 @@ spec['ARB_direct_state_access']['framebufferblit'] = PiglitGLTest(['arb_direct_s spec['ARB_direct_state_access']['checkfbstatus-errors'] = PiglitGLTest(['arb_direct_state_access-checkfbstatus-errors'], run_concurrent=True) spec['ARB_direct_state_access']['fbattachmentparam-errors'] = PiglitGLTest(['arb_direct_state_access-fbattachmentparam-errors'], run_concurrent=True) spec['ARB_direct_state_access']['invalidateframebuffer'] = PiglitGLTest(['arb_direct_state_access-invalidateframebuffer'], run_concurrent=True) +spec['ARB_direct_state_access']['clearnamedframebuffer'] = PiglitGLTest(['arb_direct_state_access-clearnamedframebuffer'], run_concurrent=True) arb_shader_image_load_store = spec['ARB_shader_image_load_store'] arb_shader_image_load_store['atomicity'] = PiglitGLTest(['arb_shader_image_load_store-atomicity'], run_concurrent=True) diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index 3c09c21..f83dc01 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -30,6 +30,7 @@ piglit_add_executable (arb_direct_state_access-framebufferblit framebufferblit.c piglit_add_executable (arb_direct_state_access-checkfbstatus-errors checkfbstatus-errors.c) piglit_add_executable (arb_direct_state_access-fbattachmentparam-errors fbattachmentparam-errors.c) piglit_add_executable (arb_direct_state_access-invalidateframebuffer invalidateframebuffer.c) +piglit_add_executable (arb_direct_state_access-clearnamedframebuffer clearnamedframebuffer.c) piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-texturesubimage texturesubimage.c) piglit_add_executable (arb_direct_state_access-bind-texture-unit bind-texture-unit.c) diff --git a/tests/spec/arb_direct_state_access/clearnamedframebuffer.c b/tests/spec/arb_direct_state_access/clearnamedframebuffer.c new file mode 100644 index 000..25d705e --- /dev/null +++ b/tests/spec/arb_direct_state_access/clearnamedframebuffer.c @@ -0,0 +1,115 @@ +/* + * Copyright 2015 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** @file clearnamedframebuffer.c + * + * Fairly trivial tests for glClearNamedFramebuffer* functions. + */ + +#include "piglit-util-gl.h" +#include "dsa-utils.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_core_version = 32; + + config.window_visual = PIGLIT_GL_VISUAL_RGBA | + PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + +void +piglit_init(int argc, char **argv) +{ + piglit_require_extension("GL_ARB_direct_state_access"); +} + +enum piglit_result +piglit_display(void) +{ + bool pass = true; + GLint darkbrown[4] = {128, 102, 76, 255}; + GLuint almostblack[4] = {128, 102, 76, 255}; + GLfloat brown[4] = {0.5f, 0.4f, 0.3f, 1.0f}; + GLfloat black[4] = {0.0f, 0.0f, 0.0f, 0.0f}; + GLfloat cyan[4] = {0.0f, 0.9f, 0.8f, 1.0f}; + GLfloat clearcolor[4]; + int i; + GLuint fbo, texture; + + /* Non-generated names */ + glClearNamedFramebufferiv(1337, GL_COLOR, 0, darkbrown); + SUBTEST(GL_INVALID_OPERATION, pass, "bad name: iv"); + + glClearNamedFramebufferuiv(1337, GL_COLOR, 0, almostblack); + SUBTEST(GL_INVALID_OPERATION, pass, "bad name: uiv"); + + glClearNamedFr
[Piglit] [PATCH 03/15] arb_direct_state_access: Testing NamedFramebufferRenderbuffer.
--- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + .../namedframebufferrenderbuffer.c | 159 + 3 files changed, 161 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/namedframebufferrenderbuffer.c diff --git a/tests/all.py b/tests/all.py index cd85fc5..8e45442 100644 --- a/tests/all.py +++ b/tests/all.py @@ -4028,6 +4028,7 @@ spec['ARB_direct_state_access']['unmapnamedbuffer-vbo'] = PiglitGLTest(['arb_dir spec['ARB_direct_state_access']['flushmappednamedbufferrange'] = PiglitGLTest(['arb_direct_state_access-flushmappednamedbufferrange'], run_concurrent=True) spec['ARB_direct_state_access']['getnamedbufferparameter'] = PiglitGLTest(['arb_direct_state_access-getnamedbufferparameter'], run_concurrent=True) spec['ARB_direct_state_access']['getnamedbuffersubdata'] = PiglitGLTest(['arb_direct_state_access-getnamedbuffersubdata'], run_concurrent=True) +spec['ARB_direct_state_access']['namedframebufferrenderbuffer'] = PiglitGLTest(['arb_direct_state_access-namedframebufferrenderbuffer'], run_concurrent=True) arb_shader_image_load_store = spec['ARB_shader_image_load_store'] arb_shader_image_load_store['atomicity'] = PiglitGLTest(['arb_shader_image_load_store-atomicity'], run_concurrent=True) diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index a9b82eb..488ca18 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -25,6 +25,7 @@ piglit_add_executable (arb_direct_state_access-unmapnamedbuffer-vbo unmapnamedbu piglit_add_executable (arb_direct_state_access-flushmappednamedbufferrange flushmappednamedbufferrange.c) piglit_add_executable (arb_direct_state_access-getnamedbufferparameter getnamedbufferparameter.c) piglit_add_executable (arb_direct_state_access-getnamedbuffersubdata getnamedbuffersubdata.c) +piglit_add_executable (arb_direct_state_access-namedframebufferrenderbuffer namedframebufferrenderbuffer.c) piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-texturesubimage texturesubimage.c) piglit_add_executable (arb_direct_state_access-bind-texture-unit bind-texture-unit.c) diff --git a/tests/spec/arb_direct_state_access/namedframebufferrenderbuffer.c b/tests/spec/arb_direct_state_access/namedframebufferrenderbuffer.c new file mode 100644 index 000..df82400 --- /dev/null +++ b/tests/spec/arb_direct_state_access/namedframebufferrenderbuffer.c @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2012 VMware, Inc. + * 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. + */ + +/** + * Test glViewport w/ FBOs. + * In Mesa, on-screen windows and user-created FBOs are stored differently + * (inverted). Make sure viewports are handled properly. + * Draw a test pattern (with many viewports) into the window, then draw the + * same thing into an FBO. Compare the images. They should be the same. + */ + +#include "piglit-util-gl.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 10; + + config.window_width = 500; + config.window_height = 500; + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + +/** + * Draw an rgbw texture in a bunch of viewports which tile the window. + * Note that viewports extend beyond the edges of the window too. + */ +static void +draw_test_image(void) +{ + int vx, vy, vw = 200, vh = 200; + GLuint texture; + + texture = piglit_rgbw_texture(GL_RGBA8, 32, 32, GL_FALSE, GL_FALSE, + GL_UNSIGNED_BYTE); + glBindTextureUnit(0, texture); + + glClear(GL_COLOR_BUFFER_BIT); + +
[Piglit] [PATCH 01/15] arb_direct_state_access: Test for CreateFramebuffers.
--- .../arb_direct_state_access/create-framebuffers.c | 76 ++ 1 file changed, 76 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/create-framebuffers.c diff --git a/tests/spec/arb_direct_state_access/create-framebuffers.c b/tests/spec/arb_direct_state_access/create-framebuffers.c new file mode 100644 index 000..97ba454 --- /dev/null +++ b/tests/spec/arb_direct_state_access/create-framebuffers.c @@ -0,0 +1,76 @@ +/* + * Copyright 2015 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** @file create_framebuffers.c + * + * Tests glCreateFramebuffers to see if it behaves in the expected way, + * throwing the correct errors, etc. + */ + +#include "piglit-util-gl.h" +#include "dsa-utils.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_core_version = 32; + + config.window_visual = PIGLIT_GL_VISUAL_RGBA | + PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + +void +piglit_init(int argc, char **argv) +{ + piglit_require_extension("GL_ARB_direct_state_access"); +} + +enum piglit_result +piglit_display(void) +{ + bool pass = true; + GLuint name; + + /* Throw some invalid inputs at glCreateFramebuffers. */ + + /* n is negative */ + glCreateFramebuffers(-1, &name); + SUBTEST(GL_INVALID_VALUE, pass, "n < 0"); + + /* name is not a valid pointer */ + glCreateFramebuffers(1, NULL); + SUBTEST(GL_NO_ERROR, pass, "framebuffers = NULL"); + + + /* Check if it actually generates a real framebuffer object */ + + glCreateFramebuffers(1, &name); + pass = piglit_check_gl_error(GL_NO_ERROR) && pass; + SUBTESTCONDITION((bool) glIsFramebuffer(name), pass, +"IsFramebuffer()"); + + glDeleteFramebuffers(1, &name); + + 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 00/15] Tests for DSA Framebuffers
A few notes: - You should ignore the support_[core|compat]_context = * statements at the top of the files for now. Please do not bikeshed on these commits. This issue should be decided definitively on a separate thread on the mesa-dev mailing list. - Some of these tests were tricky, so they are a commit series, starting with a non-DSA test and followed by several refactors. - The Invalidate*Framebuffer* functions in Mesa do nothing but throw errors, so the test for those functions tests errors and trivial calls. If you would like to test these functions on a driver other than Mesa, feel free to submit a more thorough test to the Piglit ML at a future time. Laura Ekstrand (15): arb_direct_state_access: Test for CreateFramebuffers. arb_direct_state_access: Testing glCreateFramebuffers "in the wild." arb_direct_state_access: Testing NamedFramebufferRenderbuffer. arb_direct_state_access: Test NamedFramebufferTexture[Layer]. arb_direct_state_access: Testing glCheckNamedFramebufferStatus. arb_direct_state_access: Testing CheckNamedFramebufferStatus errors. arb_direct_state_access: Testing GetNamedFramebufferAttachmentParameteriv. arb_direct_state_access: Testing BlitNamedFramebuffers. arb_direct_state_access: Testing Invalidate*Framebuffer*. arb_direct_state_access: Testing glClearNamedFramebuffer*. arb_direct_state_access: Add test for glDrawBuffer/glReadBuffer. arb_direct_state_access: Testing glNamedFramebufferDrawBuffer. arb_direct_state_access: Testing NamedFramebufferReadBuffer. arb_direct_state_access: Add non-DSA test for DrawBuffers. arb_direct_state_access: Testing NamedFramebufferDrawBuffers. tests/all.py | 8 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 8 + .../arb_direct_state_access/checkfbstatus-errors.c | 117 .../clearnamedframebuffer.c| 115 .../arb_direct_state_access/create-framebuffers.c | 76 + .../arb_direct_state_access/drawbuffers-multi.c| 160 +++ tests/spec/arb_direct_state_access/drawbuffers.c | 117 .../fbattachmentparam-errors.c | 117 .../spec/arb_direct_state_access/framebufferblit.c | 319 + .../gettextureimage-formats.c | 2 +- .../gettextureimage-luminance.c| 4 +- .../invalidateframebuffer.c| 120 .../namedframebufferrenderbuffer.c | 159 ++ 13 files changed, 1319 insertions(+), 3 deletions(-) create mode 100644 tests/spec/arb_direct_state_access/checkfbstatus-errors.c create mode 100644 tests/spec/arb_direct_state_access/clearnamedframebuffer.c create mode 100644 tests/spec/arb_direct_state_access/create-framebuffers.c create mode 100644 tests/spec/arb_direct_state_access/drawbuffers-multi.c create mode 100644 tests/spec/arb_direct_state_access/drawbuffers.c create mode 100644 tests/spec/arb_direct_state_access/fbattachmentparam-errors.c create mode 100644 tests/spec/arb_direct_state_access/framebufferblit.c create mode 100644 tests/spec/arb_direct_state_access/invalidateframebuffer.c create mode 100644 tests/spec/arb_direct_state_access/namedframebufferrenderbuffer.c -- 2.1.0 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 05/15] arb_direct_state_access: Testing glCheckNamedFramebufferStatus.
--- tests/spec/arb_direct_state_access/framebufferblit.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/spec/arb_direct_state_access/framebufferblit.c b/tests/spec/arb_direct_state_access/framebufferblit.c index e405dec..2866c78 100644 --- a/tests/spec/arb_direct_state_access/framebufferblit.c +++ b/tests/spec/arb_direct_state_access/framebufferblit.c @@ -109,8 +109,8 @@ display_texture(int x, int y, GLuint tex, int layers) GL_COLOR_ATTACHMENT0, tex, 0, i); - glBindFramebuffer(GL_FRAMEBUFFER, tempFBO); - fbStatus = glCheckFramebufferStatus(GL_FRAMEBUFFER); + fbStatus = glCheckNamedFramebufferStatus(tempFBO, + GL_FRAMEBUFFER); if (fbStatus != GL_FRAMEBUFFER_COMPLETE) { printf("Framebuffer Status: %s\n", piglit_get_gl_enum_name(fbStatus)); @@ -219,8 +219,7 @@ testFramebufferBlitLayered(int x, int y, bool srcLayered, bool dstLayered) glNamedFramebufferTexture(srcFBO, GL_COLOR_ATTACHMENT0, srcTex, 0); /* Check source framebuffer status */ - glBindFramebuffer(GL_FRAMEBUFFER, srcFBO); - fbStatus = glCheckFramebufferStatus(GL_FRAMEBUFFER); + fbStatus = glCheckNamedFramebufferStatus(srcFBO, GL_FRAMEBUFFER); if (fbStatus != GL_FRAMEBUFFER_COMPLETE) { printf("testFramebufferBlitLayered srcFBO Status: %s\n", piglit_get_gl_enum_name(fbStatus)); @@ -236,8 +235,7 @@ testFramebufferBlitLayered(int x, int y, bool srcLayered, bool dstLayered) glNamedFramebufferTexture(dstFBO, GL_COLOR_ATTACHMENT0, dstTex, 0); /* Check destination framebuffer status */ - glBindFramebuffer(GL_FRAMEBUFFER, dstFBO); - fbStatus = glCheckFramebufferStatus(GL_FRAMEBUFFER); + fbStatus = glCheckNamedFramebufferStatus(dstFBO, GL_FRAMEBUFFER); if (fbStatus != GL_FRAMEBUFFER_COMPLETE) { printf("testFramebufferBlitLayered dstFBO Status: %s\n", piglit_get_gl_enum_name(fbStatus)); -- 2.1.0 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 14/15] arb_direct_state_access: Add non-DSA test for DrawBuffers.
--- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + .../arb_direct_state_access/drawbuffers-multi.c| 160 + 3 files changed, 162 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/drawbuffers-multi.c diff --git a/tests/all.py b/tests/all.py index 0ed7cfb..9b7f989 100644 --- a/tests/all.py +++ b/tests/all.py @@ -4035,6 +4035,7 @@ spec['ARB_direct_state_access']['fbattachmentparam-errors'] = PiglitGLTest(['arb spec['ARB_direct_state_access']['invalidateframebuffer'] = PiglitGLTest(['arb_direct_state_access-invalidateframebuffer'], run_concurrent=True) spec['ARB_direct_state_access']['clearnamedframebuffer'] = PiglitGLTest(['arb_direct_state_access-clearnamedframebuffer'], run_concurrent=True) spec['ARB_direct_state_access']['drawbuffers'] = PiglitGLTest(['arb_direct_state_access-drawbuffers'], run_concurrent=True) +spec['ARB_direct_state_access']['drawbuffers-multi'] = PiglitGLTest(['arb_direct_state_access-drawbuffers-multi'], run_concurrent=True) arb_shader_image_load_store = spec['ARB_shader_image_load_store'] arb_shader_image_load_store['atomicity'] = PiglitGLTest(['arb_shader_image_load_store-atomicity'], run_concurrent=True) diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index c283321..0bc7364 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -32,6 +32,7 @@ piglit_add_executable (arb_direct_state_access-fbattachmentparam-errors fbattach piglit_add_executable (arb_direct_state_access-invalidateframebuffer invalidateframebuffer.c) piglit_add_executable (arb_direct_state_access-clearnamedframebuffer clearnamedframebuffer.c) piglit_add_executable (arb_direct_state_access-drawbuffers drawbuffers.c) +piglit_add_executable (arb_direct_state_access-drawbuffers-multi drawbuffers-multi.c) piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-texturesubimage texturesubimage.c) piglit_add_executable (arb_direct_state_access-bind-texture-unit bind-texture-unit.c) diff --git a/tests/spec/arb_direct_state_access/drawbuffers-multi.c b/tests/spec/arb_direct_state_access/drawbuffers-multi.c new file mode 100644 index 000..06740b6 --- /dev/null +++ b/tests/spec/arb_direct_state_access/drawbuffers-multi.c @@ -0,0 +1,160 @@ +/* + * Copyright © 2015 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/** @file drawbuffers-multi.c + * + * Tests explicitly setting the read and draw framebuffers. Tests drawing + * multiple fragments at the same time. + * + * Somewhat inspired by tests/general/read-front.c. + * Adapted from tests/spec/arb_direct_state_access/drawbuffers.c. + */ + +#include "piglit-util-gl.h" +#include "piglit-shader.h" +#include "dsa-utils.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 32; + + config.window_visual = PIGLIT_GL_VISUAL_RGBA | + PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + +/* + * You must use shaders in order to render to multiple buffers at once. + * These duplicate fixed-function gl 1.0 pipeline shading. + * Adapted from arb_clear_texture/3d.c. + */ +static const char vs_source[] = + "#version 140\n" + "in vec4 piglit_vertex;\n" + "uniform mat4 proj;\n" + "\n" + "void main()\n" + "{\n" + "gl_Position = proj * piglit_vertex;\n" + "}\n"; + +static const char fs_source[] = + "#version 140\n" + "uniform vec4 red;\n" + "uniform vec4 green;\n" + "uniform vec4 blue;\n" + "\n" + "void main()\n" + "{\n" + "gl_FragData[0] = red;\n" + "gl_FragData[
[Piglit] [PATCH 12/15] arb_direct_state_access: Testing glNamedFramebufferDrawBuffer.
--- tests/spec/arb_direct_state_access/drawbuffers.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/spec/arb_direct_state_access/drawbuffers.c b/tests/spec/arb_direct_state_access/drawbuffers.c index 6e7ecf5..99ebf06 100644 --- a/tests/spec/arb_direct_state_access/drawbuffers.c +++ b/tests/spec/arb_direct_state_access/drawbuffers.c @@ -54,7 +54,11 @@ static void clear_to_color(float color[4], int att) { glClearColor(color[0], color[1], color[2], color[3]); - glDrawBuffer(GL_COLOR_ATTACHMENT0 + att); + + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); + glNamedFramebufferDrawBuffer(fbo, GL_COLOR_ATTACHMENT0 + att); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo); + glClear(GL_COLOR_BUFFER_BIT); } -- 2.1.0 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 07/15] arb_direct_state_access: Testing GetNamedFramebufferAttachmentParameteriv.
--- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + .../fbattachmentparam-errors.c | 117 + 3 files changed, 119 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/fbattachmentparam-errors.c diff --git a/tests/all.py b/tests/all.py index 3015857..8c23e7c 100644 --- a/tests/all.py +++ b/tests/all.py @@ -4031,6 +4031,7 @@ spec['ARB_direct_state_access']['getnamedbuffersubdata'] = PiglitGLTest(['arb_di spec['ARB_direct_state_access']['namedframebufferrenderbuffer'] = PiglitGLTest(['arb_direct_state_access-namedframebufferrenderbuffer'], run_concurrent=True) spec['ARB_direct_state_access']['framebufferblit'] = PiglitGLTest(['arb_direct_state_access-framebufferblit'], run_concurrent=True) spec['ARB_direct_state_access']['checkfbstatus-errors'] = PiglitGLTest(['arb_direct_state_access-checkfbstatus-errors'], run_concurrent=True) +spec['ARB_direct_state_access']['fbattachmentparam-errors'] = PiglitGLTest(['arb_direct_state_access-fbattachmentparam-errors'], run_concurrent=True) arb_shader_image_load_store = spec['ARB_shader_image_load_store'] arb_shader_image_load_store['atomicity'] = PiglitGLTest(['arb_shader_image_load_store-atomicity'], run_concurrent=True) diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index 744735a..8ecb1ce 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -28,6 +28,7 @@ piglit_add_executable (arb_direct_state_access-getnamedbuffersubdata getnamedbuf piglit_add_executable (arb_direct_state_access-namedframebufferrenderbuffer namedframebufferrenderbuffer.c) piglit_add_executable (arb_direct_state_access-framebufferblit framebufferblit.c) piglit_add_executable (arb_direct_state_access-checkfbstatus-errors checkfbstatus-errors.c) +piglit_add_executable (arb_direct_state_access-fbattachmentparam-errors fbattachmentparam-errors.c) piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-texturesubimage texturesubimage.c) piglit_add_executable (arb_direct_state_access-bind-texture-unit bind-texture-unit.c) diff --git a/tests/spec/arb_direct_state_access/fbattachmentparam-errors.c b/tests/spec/arb_direct_state_access/fbattachmentparam-errors.c new file mode 100644 index 000..3d6670b --- /dev/null +++ b/tests/spec/arb_direct_state_access/fbattachmentparam-errors.c @@ -0,0 +1,117 @@ +/* + * Copyright © 2015 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/** @file fbattachmentparam-errors.c + * + * Make sure that glGetNamedFramebufferAttachmentParameteriv behaves + * according to the OpenGL 4.5 spec (30.10.2014). + * + * Section 9.2 Binding and Managing Framebuffer Objects of the OpenGL + * 4.5 core spec (30.10.2014, PDF page 314): + *"If framebuffer is zero, then the default draw framebuffer is + *queried." + */ + +#include "piglit-util-gl.h" +#include "dsa-utils.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_core_version = 32; + +PIGLIT_GL_TEST_CONFIG_END + +void +piglit_init(int argc, char **argv) +{ + piglit_require_extension("GL_ARB_direct_state_access"); +} + +static bool +get_param(GLuint fbo, GLenum att, GLenum pname, GLint expected_param, + bool expect_fail) +{ + GLint param; + + glGetNamedFramebufferAttachmentParameteriv(fbo, att, pname, ¶m); + if (!expect_fail && (param != expected_param)) { + printf("fbo=%u, att=%s, pname=%s status:" + " got %d, expected %d\n", + fbo, piglit_get_gl_enum_name(att), + piglit_get_gl_enum_name(pname), param, expected_param); + return false;
[Piglit] [PATCH 09/15] arb_direct_state_access: Testing Invalidate*Framebuffer*.
This is just some trivial error testing, because apparently Mesa doesn't actually implement the glInvalidate*Framebuffer* functionality. Testers of other drivers are welcome to submit a less trivial test at a future date. --- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + .../invalidateframebuffer.c| 120 + 3 files changed, 122 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/invalidateframebuffer.c diff --git a/tests/all.py b/tests/all.py index 8c23e7c..d03f661 100644 --- a/tests/all.py +++ b/tests/all.py @@ -4032,6 +4032,7 @@ spec['ARB_direct_state_access']['namedframebufferrenderbuffer'] = PiglitGLTest([ spec['ARB_direct_state_access']['framebufferblit'] = PiglitGLTest(['arb_direct_state_access-framebufferblit'], run_concurrent=True) spec['ARB_direct_state_access']['checkfbstatus-errors'] = PiglitGLTest(['arb_direct_state_access-checkfbstatus-errors'], run_concurrent=True) spec['ARB_direct_state_access']['fbattachmentparam-errors'] = PiglitGLTest(['arb_direct_state_access-fbattachmentparam-errors'], run_concurrent=True) +spec['ARB_direct_state_access']['invalidateframebuffer'] = PiglitGLTest(['arb_direct_state_access-invalidateframebuffer'], run_concurrent=True) arb_shader_image_load_store = spec['ARB_shader_image_load_store'] arb_shader_image_load_store['atomicity'] = PiglitGLTest(['arb_shader_image_load_store-atomicity'], run_concurrent=True) diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index 8ecb1ce..3c09c21 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -29,6 +29,7 @@ piglit_add_executable (arb_direct_state_access-namedframebufferrenderbuffer name piglit_add_executable (arb_direct_state_access-framebufferblit framebufferblit.c) piglit_add_executable (arb_direct_state_access-checkfbstatus-errors checkfbstatus-errors.c) piglit_add_executable (arb_direct_state_access-fbattachmentparam-errors fbattachmentparam-errors.c) +piglit_add_executable (arb_direct_state_access-invalidateframebuffer invalidateframebuffer.c) piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-texturesubimage texturesubimage.c) piglit_add_executable (arb_direct_state_access-bind-texture-unit bind-texture-unit.c) diff --git a/tests/spec/arb_direct_state_access/invalidateframebuffer.c b/tests/spec/arb_direct_state_access/invalidateframebuffer.c new file mode 100644 index 000..30daee1 --- /dev/null +++ b/tests/spec/arb_direct_state_access/invalidateframebuffer.c @@ -0,0 +1,120 @@ +/* + * Copyright 2015 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** @file invalidateframebuffer.c + * + * Trivial tests for glInvalidate*Framebuffer* functions. + */ + +#include "piglit-util-gl.h" +#include "dsa-utils.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_core_version = 32; + + config.window_visual = PIGLIT_GL_VISUAL_RGBA | + PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + +void +piglit_init(int argc, char **argv) +{ + piglit_require_extension("GL_ARB_direct_state_access"); + piglit_require_extension("GL_ARB_invalidate_subdata"); +} + +enum piglit_result +piglit_display(void) +{ + bool pass = true; + GLuint fbo, texture[2]; + GLenum attachments[2] = {GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1}; + GLenum winsysatt[2] = {GL_FRONT_LEFT, GL_COLOR}; + + glCreateFramebuffers(1, &fbo); + glCreateTextures(GL_TEXTURE_2D, 2, texture); + glNamedFramebufferTexture(fbo, attachments[0], texture[0], 0); + glNamedFramebufferTexture(fbo, attachments[1], texture[1], 0
[Piglit] [PATCH 13/15] arb_direct_state_access: Testing NamedFramebufferReadBuffer.
--- tests/spec/arb_direct_state_access/drawbuffers.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/spec/arb_direct_state_access/drawbuffers.c b/tests/spec/arb_direct_state_access/drawbuffers.c index 99ebf06..840a39f 100644 --- a/tests/spec/arb_direct_state_access/drawbuffers.c +++ b/tests/spec/arb_direct_state_access/drawbuffers.c @@ -65,7 +65,10 @@ clear_to_color(float color[4], int att) static void clear_subtest(float color[4], int att, const char *test_name) { - glReadBuffer(GL_COLOR_ATTACHMENT0 + att); + glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); + glNamedFramebufferReadBuffer(fbo, GL_COLOR_ATTACHMENT0 + att); + glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo); + piglit_check_gl_error(GL_NO_ERROR); SUBTESTCONDITION(piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height, color), pass, test_name); -- 2.1.0 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 15/15] arb_direct_state_access: Testing NamedFramebufferDrawBuffers.
--- tests/spec/arb_direct_state_access/drawbuffers-multi.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/spec/arb_direct_state_access/drawbuffers-multi.c b/tests/spec/arb_direct_state_access/drawbuffers-multi.c index 06740b6..d4aa57e 100644 --- a/tests/spec/arb_direct_state_access/drawbuffers-multi.c +++ b/tests/spec/arb_direct_state_access/drawbuffers-multi.c @@ -85,13 +85,13 @@ piglit_init(int argc, char **argv) static void clear_subtest(float color[4], int att, const char *test_name) { - glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); glNamedFramebufferReadBuffer(fbo, GL_COLOR_ATTACHMENT0 + att); - glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo); + glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo); piglit_check_gl_error(GL_NO_ERROR); SUBTESTCONDITION(piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height, color), pass, test_name); + glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); } enum piglit_result @@ -127,15 +127,14 @@ piglit_display(void) textures[i], 0); } - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo); - glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo); - piglit_check_gl_error(GL_NO_ERROR); - /* Set the draw buffers */ - glDrawBuffers(3, bufs); + glNamedFramebufferDrawBuffers(fbo, 3, bufs); /* Draw the pretty colors. */ + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo); piglit_draw_rect(0, 0, piglit_width, piglit_height); + piglit_check_gl_error(GL_NO_ERROR); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); /* Make sure the correct colors were drawn */ clear_subtest(blue, 2, "Clear 2 to blue"); @@ -144,6 +143,7 @@ piglit_display(void) /* Show the results of the last subtest on the screen */ if (!piglit_automatic) { + glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo); glBlitFramebuffer(0, 0, piglit_width, piglit_height, 0, 0, piglit_width, piglit_height, -- 2.1.0 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] tests/all.py: Fix typo that switched arb with ext
Reviewed-by: Mark Janes Dylan Baker writes: > This fixes several tests on platforms that support > arb_transform_feedback3. > > Signed-off-by: Dylan Baker > --- > tests/all.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/all.py b/tests/all.py > index dc73c77..42fc826 100644 > --- a/tests/all.py > +++ b/tests/all.py > @@ -3316,7 +3316,7 @@ with profile.group_manager( >'draw-auto instanced', run_concurrent=False) > > with profile.group_manager( > -PiglitGLTest, grouptools.join('spec', 'ext_transform_feedback3')) as > g: > +PiglitGLTest, grouptools.join('spec', 'arb_transform_feedback3')) as > g: > g(['arb_transform_feedback3-bind_buffer_invalid_index'], >'arb_transform_feedback3-bind_buffer_invalid_index', > run_concurrent=False) > g(['arb_transform_feedback3-query_with_invalid_index'], > -- > 2.3.1 > > ___ > 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] tests/all.py: Fix typo that switched arb with ext
This fixes several tests on platforms that support arb_transform_feedback3. Signed-off-by: Dylan Baker --- tests/all.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/all.py b/tests/all.py index dc73c77..42fc826 100644 --- a/tests/all.py +++ b/tests/all.py @@ -3316,7 +3316,7 @@ with profile.group_manager( 'draw-auto instanced', run_concurrent=False) with profile.group_manager( -PiglitGLTest, grouptools.join('spec', 'ext_transform_feedback3')) as g: +PiglitGLTest, grouptools.join('spec', 'arb_transform_feedback3')) as g: g(['arb_transform_feedback3-bind_buffer_invalid_index'], 'arb_transform_feedback3-bind_buffer_invalid_index', run_concurrent=False) g(['arb_transform_feedback3-query_with_invalid_index'], -- 2.3.1 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 1/3] framework: Port framework to python3
This is a pretty substantial patch, but it would be a lot of work to port this incrementally with a lot of code churn, much of which wouldn't receive thorough testing. And honestly, while it touches every python file in the tree, it doesn't touch them substantially. Due to a lot of work put in in the last few months/years the code base is pretty modern, and most of what needs to be changed are intentional changes to language form upstream: dicts don't have iter* methods, more functions return iterators so they need to be wrapped in list() if they need to be accessed by index or walked multiple times. __future__ imports are removed, and the largest change is the transition from str -> bytes and unicode -> str. This also changes the shbang lines in the scripts, and a small updated to cmake to search for python3 instead of python2. Signed-off-by: Dylan Baker --- CMakeLists.txt| 2 +- framework/backends/__init__.py| 9 +-- framework/backends/abstract.py| 5 +- framework/backends/json.py| 4 +- framework/backends/junit.py | 13 ++-- framework/core.py | 8 +-- framework/dmesg.py| 6 +- framework/grouptools.py | 8 +-- framework/log.py | 9 ++- framework/profile.py | 25 --- framework/programs/run.py | 10 +-- framework/programs/summary.py | 2 +- framework/results.py | 16 ++--- framework/status.py | 17 ++--- framework/summary.py | 64 + framework/test/__init__.py| 2 +- framework/test/base.py| 40 --- framework/test/gleantest.py | 2 +- framework/test/glsl_parser_test.py| 4 +- framework/test/gtest.py | 2 +- framework/test/oclconform.py | 2 +- framework/test/opencv.py | 2 +- framework/test/piglit_test.py | 2 +- framework/tests/backends_tests.py | 4 +- framework/tests/base_tests.py | 2 +- framework/tests/core_tests.py | 16 ++--- framework/tests/dmesg_tests.py| 16 ++--- framework/tests/gleantest_tests.py| 2 +- framework/tests/glsl_parser_test_tests.py | 115 +++--- framework/tests/grouptools_tests.py | 6 +- framework/tests/gtest_tests.py| 2 +- framework/tests/integration_tests.py | 8 +-- framework/tests/json_tests.py | 2 +- framework/tests/log_tests.py | 4 +- framework/tests/opencv_tests.py | 2 +- framework/tests/piglit_test_tests.py | 2 +- framework/tests/results_tests.py | 4 +- framework/tests/results_v0_tests.py | 14 ++-- framework/tests/results_v1_tests.py | 6 +- framework/tests/results_v2_tests.py | 2 +- framework/tests/results_v3_tests.py | 2 +- framework/tests/run_parser_tests.py | 6 +- framework/tests/shader_test_tests.py | 18 ++--- framework/tests/status_tests.py | 8 +-- framework/tests/summary_tests.py | 8 +-- framework/tests/test_lists.py | 2 +- framework/tests/utils.py | 4 +- piglit| 2 +- piglit-print-commands.py | 4 +- piglit-resume.py | 2 +- piglit-run.py | 2 +- piglit-summary-html.py| 2 +- piglit-summary.py | 2 +- templates/index.mako | 2 +- templates/testrun_info.mako | 4 +- tests/all.py | 2 +- tests/cl.py | 2 +- tests/deqp_gles3.py | 8 +-- tests/igt.py | 12 ++-- tests/xts.py | 2 +- 60 files changed, 267 insertions(+), 288 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index db922d8..69802b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -189,7 +189,7 @@ IF(PIGLIT_BUILD_GLX_TESTS) pkg_check_modules(GLPROTO REQUIRED glproto) ENDIF() -find_package(PythonInterp 2.7 REQUIRED) +find_package(PythonInterp 3.3 REQUIRED) find_package(PythonNumpy 1.6.2 REQUIRED) find_package(PythonMako 0.8.0 REQUIRED) find_package(PythonSix 1.4.0 REQUIRED) diff --git a/framework/backends/__init__.py b/framework/backends/__init__.py index 257bba9..d3b08ed 100644 --- a/framework/backends/__init__.py +++ b/framework/backends/__init__.py @@ -25,8 +25,8 @@ from .json import * from .junit import * -# A list of available backends -BACKENDS = ['json', 'junit'] +# A set of available backends +BACKENDS = set(['json', 'junit']) def get_backend(backend): @@ -37,6 +37,7 @@ def g
[Piglit] [PATCH 3/3] framework/test: allow tests to set per instance timeouts from initializer
This allows tests to set a per instance timeout in the class initializer, which means it can be done in all.py from the adder function by specifying a timeout value. If the timeout value is not set then it falls back to the class value, which is either None (from the base Test class) or a value set in one of Test's Children. This fixes fp-indirections and max-varyings on my haswell (which take longer than the 30 seconds provided by PiglitGLTest) Signed-off-by: Dylan Baker --- framework/test/base.py| 7 ++- framework/tests/base_tests.py | 15 +++ tests/all.py | 4 ++-- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/framework/test/base.py b/framework/test/base.py index f06fb99..460ad99 100644 --- a/framework/test/base.py +++ b/framework/test/base.py @@ -67,7 +67,7 @@ class Test(object, metaclass=abc.ABCMeta): '_test_hook_execute_run'] timeout = None -def __init__(self, command, run_concurrent=False): +def __init__(self, command, run_concurrent=False, timeout=None): assert isinstance(command, list), command self.run_concurrent = run_concurrent @@ -75,6 +75,11 @@ class Test(object, metaclass=abc.ABCMeta): self.env = {} self.result = TestResult({'result': 'fail'}) self.cwd = None +if timeout is not None: +# If no timeout is specified this will fallback to the class value +# XXX: can this actually be a float? +assert isinstance(timeout, (int, float)) +self.timeout = timeout # pylint: disable=assigning-non-slot # This is a hook for doing some testing on execute right before # self.run is called. diff --git a/framework/tests/base_tests.py b/framework/tests/base_tests.py index 6d99a76..9fa9e65 100644 --- a/framework/tests/base_tests.py +++ b/framework/tests/base_tests.py @@ -36,6 +36,7 @@ class TestTest(Test): self.test_interpret_result name """ +timeout = 120 test_interpret_result = lambda: None def interpret_result(self): @@ -155,3 +156,17 @@ def test_mutation(): _Test(args) nt.assert_list_equal(args, ['a', 'b']) + + +@nt.timed(3) +def test_override_timeout(): +"""Test: overriding timeout on a per instance basis works. + +Since TestTest has a timeout of 120 seconds, and the test defined here +should run 60 seconds, and we set a timeout of 1 second we expect this test +to take less than 3 seconds (to give some setup flexability) if it goes +over that it is a failure. + +""" +test = TestTest(['sleep', '60'], timeout=1) +test.run() diff --git a/tests/all.py b/tests/all.py index 0cfcd8e..ffc0015 100644 --- a/tests/all.py +++ b/tests/all.py @@ -1838,7 +1838,7 @@ with profile.group_manager( g(['fp-formats'], run_concurrent=False) g(['fp-fragment-position'], run_concurrent=False) g(['fp-incomplete-tex'], run_concurrent=False) -g(['fp-indirections'], run_concurrent=False) +g(['fp-indirections'], run_concurrent=False, timeout=60) g(['fp-indirections2'], run_concurrent=False) g(['fp-kil'], run_concurrent=False) g(['fp-lit-mask'], run_concurrent=False) @@ -3227,7 +3227,7 @@ with profile.group_manager( 'immediate-reuse-index-buffer') g(['ext_transform_feedback-immediate-reuse-uniform-buffer'], 'immediate-reuse-uniform-buffer') -g(['ext_transform_feedback-max-varyings'], 'max-varyings') +g(['ext_transform_feedback-max-varyings'], 'max-varyings', timeout=60) g(['ext_transform_feedback-nonflat-integral'], 'nonflat-integral') g(['ext_transform_feedback-overflow-edge-cases'], 'overflow-edge-cases') g(['ext_transform_feedback-overflow-edge-cases', 'use_gs'], -- 2.3.1 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] Port piglit framework to python3, round 2
This is a proposal for another go at moving to python3 for the framework. Due to the amount of work that's gone into piglit over the last few months and years the codebase is very modern, and the transition is pretty straightforward, the only major change is the bytes/unicode/str conversion, which isn't that hard for us since we've already relied on the unicode class for a number of our string interfaces. So why python3, and why now? The first argument for python3 is features. Feature work is ongoing in python3, while python2 is in long term maintenance mode, and there are features landing in python3 that will either allow us to simplify the piglit code, or to enable useful features with minimal effort. Patch 2 provides a sane, portable timeout implementation for piglit to demonstrate this. The second argument I can offer is that linux distributions are starting to make the transition to python3 as their default python version. Arch and Fedora have already made this jump. For windows and OSX the python foundation provides pre compiled binaries. But what about platforms that don't have python3.3+ available? Well, the goal of recently landed changes to the generators was to hybridize the generators to work under either python2.7 or python 3.3+, with the same code base, and this series doesn't change that, nor do I have any plans to do so while there are still python2 consumers. The goal being that tests (including generated tests) should be backportable to the python2 branch without any changes being necessary. The idea then is that directly before landing this code a python2 branch of piglit would be forked and pushed to the upstream repository. Those that need python2 would be able to use the python2 branch for testing, while upstream development would continue on master, which used python3. Any changes that were strictly necessary to keep the python2 branch working with the python3 branch would be backported, presumably by myself, but the goal would be to minimize the number of python changes backported. The one drawback here would be that if the summary format of master (python3) changed it's unlikely that would be backported to python2. Master would still be able to understand python2 generated results, but not vice versa. So, to sum up: 1) branch a python2 branch, tests should be able to cherry-picked/merged cleanly 2) python changes necessary to keep the python2 branch running would be backported 3) When python2 is no longer necessary for anyone the branch could be dropped. ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 2/3] framework: Add test timeouts
This implements a test timeout that works on windows and *nix, and can be used with concurrent test execution (unlike the currently implemented timeouts which only work on *nix and are not safe to use with concurrent tests). This is not only possible but trivially easy because python3.3 adds a timeout parameter to subprocess.Popen.join, which means all that is needed is to add the timeout attribute to the class, set it, and handle the exception that is raised if the timeout is exceeded. Signed-off-by: Dylan Baker --- framework/test/base.py | 114 +++-- framework/test/gleantest.py| 4 ++ framework/test/glsl_parser_test.py | 1 + framework/test/piglit_test.py | 8 ++- tests/quick.py | 1 + 5 files changed, 34 insertions(+), 94 deletions(-) diff --git a/framework/test/base.py b/framework/test/base.py index 23fd522..f06fb99 100644 --- a/framework/test/base.py +++ b/framework/test/base.py @@ -29,9 +29,6 @@ import subprocess import time import sys import traceback -from datetime import datetime -import threading -import signal import itertools import abc import copy @@ -46,56 +43,6 @@ __all__ = [ ] -class ProcessTimeout(threading.Thread): -""" Timeout class for test processes - -This class is for terminating tests that run for longer than a certain -amount of time. Create an instance by passing it a timeout in seconds -and the Popen object that is running your test. Then call the start -method (inherited from Thread) to start the timer. The Popen object is -killed if the timeout is reached and it has not completed. Wait for the -outcome by calling the join() method from the parent. - -""" - -def __init__(self, timeout, proc): -threading.Thread.__init__(self) -self.proc = proc -self.timeout = timeout -self.status = 0 - -def run(self): -start_time = datetime.now() -delta = 0 - -# poll() returns the returncode attribute, which is either the return -# code of the child process (which could be zero), or None if the -# process has not yet terminated. - -while delta < self.timeout and self.proc.poll() is None: -time.sleep(1) -delta = (datetime.now() - start_time).total_seconds() - -# if the test is not finished after timeout, first try to terminate it -# and if that fails, send SIGKILL to all processes in the test's -# process group - -if self.proc.poll() is None: -self.status = 1 -self.proc.terminate() -time.sleep(5) - -if self.proc.poll() is None: -self.status = 2 -if hasattr(os, 'killpg'): -os.killpg(self.proc.pid, signal.SIGKILL) -self.proc.wait() - -def join(self): -threading.Thread.join(self) -return self.status - - class Test(object, metaclass=abc.ABCMeta): """ Abstract base class for Test classes @@ -117,8 +64,8 @@ class Test(object, metaclass=abc.ABCMeta): """ OPTS = Options() __slots__ = ['run_concurrent', 'env', 'result', 'cwd', '_command', - '_test_hook_execute_run', '__proc_timeout'] -timeout = 0 + '_test_hook_execute_run'] +timeout = None def __init__(self, command, run_concurrent=False): assert isinstance(command, list), command @@ -128,7 +75,6 @@ class Test(object, metaclass=abc.ABCMeta): self.env = {} self.result = TestResult({'result': 'fail'}) self.cwd = None -self.__proc_timeout = None # This is a hook for doing some testing on execute right before # self.run is called. @@ -213,11 +159,7 @@ class Test(object, metaclass=abc.ABCMeta): self.interpret_result() if self.result['returncode'] is not None and self.result['returncode'] < 0: -# check if the process was terminated by the timeout -if self.timeout > 0 and self.__proc_timeout.join() > 0: -self.result['result'] = 'timeout' -else: -self.result['result'] = 'crash' +self.result['result'] = 'crash' elif self.result['returncode'] != 0 and self.result['result'] == 'pass': self.result['result'] = 'warn' @@ -242,10 +184,6 @@ class Test(object, metaclass=abc.ABCMeta): """ return False -def __set_process_group(self): -if hasattr(os, 'setpgrp'): -os.setpgrp() - def _run_command(self): """ Run the test command and get the result @@ -253,10 +191,9 @@ class Test(object, metaclass=abc.ABCMeta): executable isn't found it sets the result to skip. """ -# if there is an error in run command this will be set to True, if this -# is True then the run test method will return early. If this is set to -# True then self.result shou
Re: [Piglit] [PATCH] main: Test for CreateBuffers.
Well, you're just going to be stuck excluding any hardware that supports core profiles all over the place, which won't be fun. You can certainly make the tests exclude that hw, but making the actual impl exclude it will be quite annoying. On Thu, Mar 5, 2015 at 4:19 PM, Laura Ekstrand wrote: > It sounds like I'm not the person to make this decision. > > On Thu, Mar 5, 2015 at 1:17 PM, Ilia Mirkin wrote: >> >> You're going to be in a world of hurt if you don't :) >> >> On Thu, Mar 5, 2015 at 4:17 PM, Laura Ekstrand >> wrote: >> > I guess the question is then, "Do we want DSA to work on hardware >> > without >> > Geometry Shaders?" >> > >> > On Thu, Mar 5, 2015 at 12:26 PM, Ilia Mirkin >> > wrote: >> >> >> >> On Thu, Mar 5, 2015 at 3:22 PM, Laura Ekstrand >> >> wrote: >> >> > Oddly enough, there is no "core context" for 3.1. It's not a thing. >> >> > 31 >> >> > is >> >> > strange like that. Core contexts start at 3.2. The reason why your >> >> > tests >> >> > work with core_compat = 31 is because Piglit jumps through some >> >> > hoops, >> >> > often >> >> > promoting the user automatically to 32 or above behind the scenes. >> >> > If >> >> > we >> >> > are going to only test on core contexts, then we should probably >> >> > start >> >> > at 32 >> >> > since 31 is such a strange beast. >> >> >> >> With mesa, a driver that only supports GL 3.1 will still be recognized >> >> as a core context. It has to jump through hoops on, say, NVIDIA >> >> though, since that returns a context that has ARB_compatibility >> >> exposed and so it goes back and requests a GL3.2 core context. At >> >> least one piece of hardware I semi-care about (Adreno A3XX) will >> >> likely have GL 3.1, but never get GL 3.2 due to lack of GS. >> >> >> >> -ilia >> > >> > > > ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] main: Test for CreateBuffers.
It sounds like I'm not the person to make this decision. On Thu, Mar 5, 2015 at 1:17 PM, Ilia Mirkin wrote: > You're going to be in a world of hurt if you don't :) > > On Thu, Mar 5, 2015 at 4:17 PM, Laura Ekstrand > wrote: > > I guess the question is then, "Do we want DSA to work on hardware without > > Geometry Shaders?" > > > > On Thu, Mar 5, 2015 at 12:26 PM, Ilia Mirkin > wrote: > >> > >> On Thu, Mar 5, 2015 at 3:22 PM, Laura Ekstrand > >> wrote: > >> > Oddly enough, there is no "core context" for 3.1. It's not a thing. > 31 > >> > is > >> > strange like that. Core contexts start at 3.2. The reason why your > >> > tests > >> > work with core_compat = 31 is because Piglit jumps through some hoops, > >> > often > >> > promoting the user automatically to 32 or above behind the scenes. If > >> > we > >> > are going to only test on core contexts, then we should probably start > >> > at 32 > >> > since 31 is such a strange beast. > >> > >> With mesa, a driver that only supports GL 3.1 will still be recognized > >> as a core context. It has to jump through hoops on, say, NVIDIA > >> though, since that returns a context that has ARB_compatibility > >> exposed and so it goes back and requests a GL3.2 core context. At > >> least one piece of hardware I semi-care about (Adreno A3XX) will > >> likely have GL 3.1, but never get GL 3.2 due to lack of GS. > >> > >> -ilia > > > > > ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] main: Test for CreateBuffers.
I guess the question is then, "Do we want DSA to work on hardware without Geometry Shaders?" On Thu, Mar 5, 2015 at 12:26 PM, Ilia Mirkin wrote: > On Thu, Mar 5, 2015 at 3:22 PM, Laura Ekstrand > wrote: > > Oddly enough, there is no "core context" for 3.1. It's not a thing. 31 > is > > strange like that. Core contexts start at 3.2. The reason why your > tests > > work with core_compat = 31 is because Piglit jumps through some hoops, > often > > promoting the user automatically to 32 or above behind the scenes. If we > > are going to only test on core contexts, then we should probably start > at 32 > > since 31 is such a strange beast. > > With mesa, a driver that only supports GL 3.1 will still be recognized > as a core context. It has to jump through hoops on, say, NVIDIA > though, since that returns a context that has ARB_compatibility > exposed and so it goes back and requests a GL3.2 core context. At > least one piece of hardware I semi-care about (Adreno A3XX) will > likely have GL 3.1, but never get GL 3.2 due to lack of GS. > > -ilia > ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] main: Test for CreateBuffers.
You're going to be in a world of hurt if you don't :) On Thu, Mar 5, 2015 at 4:17 PM, Laura Ekstrand wrote: > I guess the question is then, "Do we want DSA to work on hardware without > Geometry Shaders?" > > On Thu, Mar 5, 2015 at 12:26 PM, Ilia Mirkin wrote: >> >> On Thu, Mar 5, 2015 at 3:22 PM, Laura Ekstrand >> wrote: >> > Oddly enough, there is no "core context" for 3.1. It's not a thing. 31 >> > is >> > strange like that. Core contexts start at 3.2. The reason why your >> > tests >> > work with core_compat = 31 is because Piglit jumps through some hoops, >> > often >> > promoting the user automatically to 32 or above behind the scenes. If >> > we >> > are going to only test on core contexts, then we should probably start >> > at 32 >> > since 31 is such a strange beast. >> >> With mesa, a driver that only supports GL 3.1 will still be recognized >> as a core context. It has to jump through hoops on, say, NVIDIA >> though, since that returns a context that has ARB_compatibility >> exposed and so it goes back and requests a GL3.2 core context. At >> least one piece of hardware I semi-care about (Adreno A3XX) will >> likely have GL 3.1, but never get GL 3.2 due to lack of GS. >> >> -ilia > > ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] main: Test for CreateBuffers.
On Thu, Mar 5, 2015 at 3:22 PM, Laura Ekstrand wrote: > Oddly enough, there is no "core context" for 3.1. It's not a thing. 31 is > strange like that. Core contexts start at 3.2. The reason why your tests > work with core_compat = 31 is because Piglit jumps through some hoops, often > promoting the user automatically to 32 or above behind the scenes. If we > are going to only test on core contexts, then we should probably start at 32 > since 31 is such a strange beast. With mesa, a driver that only supports GL 3.1 will still be recognized as a core context. It has to jump through hoops on, say, NVIDIA though, since that returns a context that has ARB_compatibility exposed and so it goes back and requests a GL3.2 core context. At least one piece of hardware I semi-care about (Adreno A3XX) will likely have GL 3.1, but never get GL 3.2 due to lack of GS. -ilia ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] main: Test for CreateBuffers.
On Thu, Mar 5, 2015 at 12:49 AM, Martin Peres wrote: > On 05/03/15 03:48, Ilia Mirkin wrote: > >> On Wed, Mar 4, 2015 at 8:38 PM, Laura Ekstrand >> wrote: >> >>> --- >>> tests/all.py | 1 + >>> .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + >>> .../spec/arb_direct_state_access/create-buffers.c | 78 >>> ++ >>> 3 files changed, 80 insertions(+) >>> create mode 100644 tests/spec/arb_direct_state_access/create-buffers.c >>> >>> diff --git a/tests/all.py b/tests/all.py >>> index 0f07105..e60a02c 100644 >>> --- a/tests/all.py >>> +++ b/tests/all.py >>> @@ -4006,6 +4006,7 @@ >>> spec['ARB_direct_state_access']['compressedtexturesubimage'] >>> = PiglitGLTest(['ar >>> spec['ARB_direct_state_access']['texture-storage-multisample'] = >>> PiglitGLTest(['arb_direct_state_access-texture-storage-multisample'], >>> run_concurrent=True) >>> spec['ARB_direct_state_access']['texture-buffer'] = >>> PiglitGLTest(['arb_direct_state_access-texture-buffer'], >>> run_concurrent=True) >>> spec['ARB_direct_state_access']['texture-buffer-range'] = >>> PiglitGLTest(['arb_direct_state_access-texture-buffer-range'], >>> run_concurrent=True) >>> +spec['ARB_direct_state_access']['create-buffers'] = >>> PiglitGLTest(['arb_direct_state_access-create-buffers'], >>> run_concurrent=True) >>> spec['ARB_direct_state_access']['namedbufferstorage-persistent'] = >>> PiglitGLTest(['arb_direct_state_access-namedbufferstorage-persistent'], >>> run_concurrent=True) >>> spec['ARB_direct_state_access']['namedbuffersubdata-vbo-sync'] = >>> PiglitGLTest(['arb_direct_state_access-namedbuffersubdata-vbo-sync'], >>> run_concurrent=True) >>> >>> spec['ARB_direct_state_access']['clearnamedbufferdata-invalid-internal-format'] >>> = >>> PiglitGLTest(['arb_direct_state_access-clearnamedbufferdata-invalid-internal-format'], >>> run_concurrent=True) >>> diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt >>> b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt >>> index b2b7465..2a4915d 100644 >>> --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt >>> +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt >>> @@ -10,6 +10,7 @@ link_libraries ( >>> ) >>> >>> piglit_add_executable (arb_direct_state_access-create-transformfeedbacks >>> create-transformfeedbacks.c) >>> +piglit_add_executable (arb_direct_state_access-create-buffers >>> create-buffers.c) >>> piglit_add_executable >>> (arb_direct_state_access-namedbufferstorage-persistent >>> namedbufferstorage.c) >>> piglit_add_executable (arb_direct_state_access-namedbuffersubdata-vbo-sync >>> namedbuffersubdata-vbo-sync.c) >>> piglit_add_executable (arb_direct_state_access- >>> clearnamedbufferdata-invalid-internal-format >>> clearnamedbufferdata-invalid-internal-format.c) >>> diff --git a/tests/spec/arb_direct_state_access/create-buffers.c >>> b/tests/spec/arb_direct_state_access/create-buffers.c >>> new file mode 100644 >>> index 000..12fcf0b >>> --- /dev/null >>> +++ b/tests/spec/arb_direct_state_access/create-buffers.c >>> @@ -0,0 +1,78 @@ >>> +/* >>> + * Copyright 2014 Intel Corporation >>> + * >>> + * Permission is hereby granted, free of charge, to any person >>> obtaining a >>> + * copy of this software and associated documentation files (the >>> "Software"), >>> + * to deal in the Software without restriction, including without >>> limitation >>> + * the rights to use, copy, modify, merge, publish, distribute, >>> sublicense, >>> + * and/or sell copies of the Software, and to permit persons to whom the >>> + * Software is furnished to do so, subject to the following conditions: >>> + * >>> + * The above copyright notice and this permission notice (including the >>> next >>> + * paragraph) shall be included in all copies or substantial portions >>> of the >>> + * Software. >>> + * >>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, >>> EXPRESS OR >>> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF >>> MERCHANTABILITY, >>> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT >>> SHALL >>> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR >>> OTHER >>> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, >>> ARISING >>> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER >>> + * DEALINGS IN THE SOFTWARE. >>> + */ >>> + >>> +/** @file create_buffers.c >>> + * >>> + * Tests glCreateBuffers to see if it behaves in the expected way, >>> + * throwing the correct errors, etc. >>> + */ >>> + >>> +#include "piglit-util-gl.h" >>> + >>> +PIGLIT_GL_TEST_CONFIG_BEGIN >>> + >>> + config.supports_gl_compat_version = 32; >>> >> This will never run on mesa, right? I assume you meant >> >> supports_gl_core_version = 31 (or 32?) >> > > Why 32? 31 should be enough and that is also what I used on all my tests. Oddly enough, there is no "core context" for 3.1. It's not a thing. 31
[Piglit] [Patch v2] profile.py: Don't allow accidental reassignments of TestDict keys
A common error in all.py is that two different tests are assigned to the same key value in profile.test_list. This change prevents a key from being reassigned to a new value on accident, but provides a mechanism to allow reassignment, using a context manager. This allows tests like the image_load_store tests in quick.py to be overwritten, but requires the author to mark that they know that they are overwriting tests, and that it's intentional. This also adds some tests for TestDict. v2: - remove some rebase artifacts, this makes the code a little simpler and a little cleaner Signed-off-by: Dylan Baker --- framework/profile.py | 65 -- framework/tests/profile_tests.py | 75 tests/quick.py | 15 3 files changed, 137 insertions(+), 18 deletions(-) diff --git a/framework/profile.py b/framework/profile.py index e8e8ba1..e1a16f0 100644 --- a/framework/profile.py +++ b/framework/profile.py @@ -32,7 +32,6 @@ import sys import multiprocessing import multiprocessing.dummy import importlib -import types import contextlib import itertools @@ -48,12 +47,20 @@ __all__ = [ ] +class TestDictError(Exception): +pass + + class TestDict(dict): # pylint: disable=too-few-public-methods """A special kind of dict for tests. This dict lowers the names of keys by default """ +def __init__(self, *args, **kwargs): +self.__allow_reassignment = False +super(TestDict, self).__init__(*args, **kwargs) + def __setitem__(self, key, value): """Enforce types on set operations. @@ -67,19 +74,46 @@ class TestDict(dict): # pylint: disable=too-few-public-methods filesystems. """ -assert isinstance(key, basestring), \ - "Keys must be strings, but was {}".format(type(key)) -# None is required to make empty assignment work: -# foo = Tree['a'] -assert isinstance(value, (Test, types.NoneType)), \ - "Values must be either a Test, but was {}".format(type(value)) +# keys should be strings +if not isinstance(key, basestring): +raise TestDictError("Keys must be strings, but was {}".format( +type(key))) + +# Values should either be more Tests +if not isinstance(value, Test): +raise TestDictError( +"Values must be a Test, but was a {}".format(type(value))) -super(TestDict, self).__setitem__(key.lower(), value) +# This must be lowered before the following test, or the test can pass +# in error if the key has capitals in it. +key = key.lower() + +# If there is already a test of that value in the tree it is an error +if not self.__allow_reassignment and key in self: +raise TestDictError( +"A test has already been asigned the name: {}".format(key)) + +super(TestDict, self).__setitem__(key, value) def __getitem__(self, key): """Lower the value before returning.""" return super(TestDict, self).__getitem__(key.lower()) +@property +@contextlib.contextmanager +def allow_reassignment(self): +"""Context manager that allows keys to be reassigned. + +Normally reassignment happens in error, but sometimes one actually +wants to do reassignment, say to add extra options in a reduced +profile. This method allows reassignment, but only within its context, +making it an explict choice to do so. + +""" +self.__allow_reassignment = True +yield +self.__allow_reassignment = False + class TestProfile(object): """ Class that holds a list of tests for execution @@ -335,6 +369,13 @@ class TestProfile(object): yield adder +@property +@contextlib.contextmanager +def allow_reassignment(self): +"""A convenience wrapper around self.test_list.allow_reassignment.""" +with self.test_list.allow_reassignment: +yield + def load_test_profile(filename): """ Load a python module and return it's profile attribute @@ -351,16 +392,18 @@ def load_test_profile(filename): filename -- the name of a python module to get a 'profile' from """ -mod = importlib.import_module('tests.{0}'.format( -os.path.splitext(os.path.basename(filename))[0])) - try: +mod = importlib.import_module('tests.{0}'.format( +os.path.splitext(os.path.basename(filename))[0])) return mod.profile except AttributeError: print("Error: There is not profile attribute in module {0}." "Did you specify the right file?".format(filename), file=sys.stderr) sys.exit(2) +except TestDictError as e: +print("Error: {}".format(e.message), file=sys.stderr) +sys.exit(1) def merge_test_profiles(profil
Re: [Piglit] [PATCH 7/7] profile.py: Don't allow accidental reassignments of TestDict keys
On Thu, Mar 05, 2015 at 02:42:51PM -0500, Ilia Mirkin wrote: > On Thu, Mar 5, 2015 at 2:34 PM, Dylan Baker wrote: > > A common error in all.py is that two different tests are assigned to the > > same key value in profile.test_list. This change prevents a key from > > being reassigned to a new value on accident, but provides a mechanism to > > allow reassignment, using a context manager. This allows tests like the > > image_load_store tests in quick.py to be overwritten, but requires the > > author to mark that they know that they are overwriting tests, and that > > it's intentional. > > > > This also adds some tests for TestDict. > > > > Signed-off-by: Dylan Baker > > --- > > framework/profile.py | 63 - > > framework/tests/profile_tests.py | 75 > > > > tests/quick.py | 15 > > 3 files changed, 138 insertions(+), 15 deletions(-) > > > > diff --git a/framework/profile.py b/framework/profile.py > > index e8e8ba1..edd1d90 100644 > > --- a/framework/profile.py > > +++ b/framework/profile.py > > @@ -48,12 +48,20 @@ __all__ = [ > > ] > > > > > > +class TestDictError(Exception): > > +pass > > + > > + > > class TestDict(dict): # pylint: disable=too-few-public-methods > > """A special kind of dict for tests. > > > > This dict lowers the names of keys by default > > > > """ > > +def __init__(self, *args, **kwargs): > > +self.__allow_reassignment = False > > +super(TestDict, self).__init__(*args, **kwargs) > > + > > def __setitem__(self, key, value): > > """Enforce types on set operations. > > > > @@ -67,19 +75,49 @@ class TestDict(dict): # pylint: > > disable=too-few-public-methods > > filesystems. > > > > """ > > -assert isinstance(key, basestring), \ > > - "Keys must be strings, but was {}".format(type(key)) > > +# keys should be strings > > +if not isinstance(key, basestring): > > +raise TestDictError("Keys must be strings, but was {}".format( > > +type(key))) > > + > > +# Values should either be more Trees or Tests > > # None is required to make empty assignment work: > > # foo = Tree['a'] > > -assert isinstance(value, (Test, types.NoneType)), \ > > - "Values must be either a Test, but was > > {}".format(type(value)) > > +if not isinstance(value, (Test, types.NoneType)): > > +raise TestDictError("Values must be either a TestDict or a > > Test, " > > +"but was {}".format(type(value))) > > > > -super(TestDict, self).__setitem__(key.lower(), value) > > +# This must be lowered before the following test, or the test can > > pass > > +# in error if the key has capitals in it. > > +key = key.lower() > > + > > +if not self.__allow_reassignment: > > +# If there is alread a test of that value in the tree it is an > > error > > +if isinstance(value, Test) and key in self: > > why do you check the type of 'value'? What else could it be? > > > +raise TestDictError( > > +"A test has already been asigned the name > > {}".format(key)) > > + > > +super(TestDict, self).__setitem__(key, value) > > -ilia It's a rebase artifact, I'll drop it. In fact, there are a couple of other rebase artifacts in this patch. I'll roll a v2 shortly. signature.asc Description: Digital signature ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 7/7] profile.py: Don't allow accidental reassignments of TestDict keys
On Thu, Mar 5, 2015 at 2:34 PM, Dylan Baker wrote: > A common error in all.py is that two different tests are assigned to the > same key value in profile.test_list. This change prevents a key from > being reassigned to a new value on accident, but provides a mechanism to > allow reassignment, using a context manager. This allows tests like the > image_load_store tests in quick.py to be overwritten, but requires the > author to mark that they know that they are overwriting tests, and that > it's intentional. > > This also adds some tests for TestDict. > > Signed-off-by: Dylan Baker > --- > framework/profile.py | 63 - > framework/tests/profile_tests.py | 75 > > tests/quick.py | 15 > 3 files changed, 138 insertions(+), 15 deletions(-) > > diff --git a/framework/profile.py b/framework/profile.py > index e8e8ba1..edd1d90 100644 > --- a/framework/profile.py > +++ b/framework/profile.py > @@ -48,12 +48,20 @@ __all__ = [ > ] > > > +class TestDictError(Exception): > +pass > + > + > class TestDict(dict): # pylint: disable=too-few-public-methods > """A special kind of dict for tests. > > This dict lowers the names of keys by default > > """ > +def __init__(self, *args, **kwargs): > +self.__allow_reassignment = False > +super(TestDict, self).__init__(*args, **kwargs) > + > def __setitem__(self, key, value): > """Enforce types on set operations. > > @@ -67,19 +75,49 @@ class TestDict(dict): # pylint: > disable=too-few-public-methods > filesystems. > > """ > -assert isinstance(key, basestring), \ > - "Keys must be strings, but was {}".format(type(key)) > +# keys should be strings > +if not isinstance(key, basestring): > +raise TestDictError("Keys must be strings, but was {}".format( > +type(key))) > + > +# Values should either be more Trees or Tests > # None is required to make empty assignment work: > # foo = Tree['a'] > -assert isinstance(value, (Test, types.NoneType)), \ > - "Values must be either a Test, but was {}".format(type(value)) > +if not isinstance(value, (Test, types.NoneType)): > +raise TestDictError("Values must be either a TestDict or a Test, > " > +"but was {}".format(type(value))) > > -super(TestDict, self).__setitem__(key.lower(), value) > +# This must be lowered before the following test, or the test can > pass > +# in error if the key has capitals in it. > +key = key.lower() > + > +if not self.__allow_reassignment: > +# If there is alread a test of that value in the tree it is an > error > +if isinstance(value, Test) and key in self: why do you check the type of 'value'? What else could it be? > +raise TestDictError( > +"A test has already been asigned the name > {}".format(key)) > + > +super(TestDict, self).__setitem__(key, value) -ilia ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 7/7] profile.py: Don't allow accidental reassignments of TestDict keys
A common error in all.py is that two different tests are assigned to the same key value in profile.test_list. This change prevents a key from being reassigned to a new value on accident, but provides a mechanism to allow reassignment, using a context manager. This allows tests like the image_load_store tests in quick.py to be overwritten, but requires the author to mark that they know that they are overwriting tests, and that it's intentional. This also adds some tests for TestDict. Signed-off-by: Dylan Baker --- framework/profile.py | 63 - framework/tests/profile_tests.py | 75 tests/quick.py | 15 3 files changed, 138 insertions(+), 15 deletions(-) diff --git a/framework/profile.py b/framework/profile.py index e8e8ba1..edd1d90 100644 --- a/framework/profile.py +++ b/framework/profile.py @@ -48,12 +48,20 @@ __all__ = [ ] +class TestDictError(Exception): +pass + + class TestDict(dict): # pylint: disable=too-few-public-methods """A special kind of dict for tests. This dict lowers the names of keys by default """ +def __init__(self, *args, **kwargs): +self.__allow_reassignment = False +super(TestDict, self).__init__(*args, **kwargs) + def __setitem__(self, key, value): """Enforce types on set operations. @@ -67,19 +75,49 @@ class TestDict(dict): # pylint: disable=too-few-public-methods filesystems. """ -assert isinstance(key, basestring), \ - "Keys must be strings, but was {}".format(type(key)) +# keys should be strings +if not isinstance(key, basestring): +raise TestDictError("Keys must be strings, but was {}".format( +type(key))) + +# Values should either be more Trees or Tests # None is required to make empty assignment work: # foo = Tree['a'] -assert isinstance(value, (Test, types.NoneType)), \ - "Values must be either a Test, but was {}".format(type(value)) +if not isinstance(value, (Test, types.NoneType)): +raise TestDictError("Values must be either a TestDict or a Test, " +"but was {}".format(type(value))) -super(TestDict, self).__setitem__(key.lower(), value) +# This must be lowered before the following test, or the test can pass +# in error if the key has capitals in it. +key = key.lower() + +if not self.__allow_reassignment: +# If there is alread a test of that value in the tree it is an error +if isinstance(value, Test) and key in self: +raise TestDictError( +"A test has already been asigned the name {}".format(key)) + +super(TestDict, self).__setitem__(key, value) def __getitem__(self, key): """Lower the value before returning.""" return super(TestDict, self).__getitem__(key.lower()) +@property +@contextlib.contextmanager +def allow_reassignment(self): +"""Context manager that allows keys to be reassigned. + +Normally reassignment happens in error, but sometimes one actually +wants to do reassignment, say to add extra options in a reduced +profile. This method allows reassignment, but only within its context, +making it an explict choice to do so. + +""" +self.__allow_reassignment = True +yield +self.__allow_reassignment = False + class TestProfile(object): """ Class that holds a list of tests for execution @@ -335,6 +373,13 @@ class TestProfile(object): yield adder +@property +@contextlib.contextmanager +def allow_reassignment(self): +"""A convenience wrapper around self.test_list.allow_reassignment.""" +with self.test_list.allow_reassignment: +yield + def load_test_profile(filename): """ Load a python module and return it's profile attribute @@ -351,16 +396,18 @@ def load_test_profile(filename): filename -- the name of a python module to get a 'profile' from """ -mod = importlib.import_module('tests.{0}'.format( -os.path.splitext(os.path.basename(filename))[0])) - try: +mod = importlib.import_module('tests.{0}'.format( +os.path.splitext(os.path.basename(filename))[0])) return mod.profile except AttributeError: print("Error: There is not profile attribute in module {0}." "Did you specify the right file?".format(filename), file=sys.stderr) sys.exit(2) +except TestDictError as e: +print("Error: {}".format(e.message), file=sys.stderr) +sys.exit(1) def merge_test_profiles(profiles): diff --git a/framework/tests/profile_tests.py b/framework/tests/profile_tests.py index d2878c3..23c796d 100644 --- a/framework/tests/pr
[Piglit] [PATCH 3/7] tests/all.py: move arb_framebuffer-rgb tests out of loop
This doesn't actually effect the nature or number of tests run. Signed-off-by: Dylan Baker --- tests/all.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/all.py b/tests/all.py index cba8733..fe310d9 100644 --- a/tests/all.py +++ b/tests/all.py @@ -1945,8 +1945,8 @@ with profile.group_manager( 'blit {} {} {} {}'.format( backing_type, srgb_types, blit_type, framebuffer_srgb_setting)) -g(['framebuffer-srgb'], run_concurrent=False) -g(['arb_framebuffer_srgb-clear']) +g(['framebuffer-srgb'], run_concurrent=False) +g(['arb_framebuffer_srgb-clear']) with profile.group_manager( PiglitGLTest, -- 2.3.1 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 1/7] tests/all.py: fix two tests that had options dropped
I traced these two tests back and through a series of errors an option required to make them unique was dropped, this corrects that and brings them back to their original status. Signed-off-by: Dylan Baker --- tests/all.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/all.py b/tests/all.py index dc73c77..7adda80 100644 --- a/tests/all.py +++ b/tests/all.py @@ -663,9 +663,9 @@ with profile.group_manager( g(['glx-pixmap-multi']) g(['glx-tfp'], run_concurrent=False) g(['glx-visuals-depth'], run_concurrent=False) -g(['glx-visuals-depth']) +g(['glx-visuals-depth', '-pixmap']) g(['glx-visuals-stencil'], run_concurrent=False) -g(['glx-visuals-stencil']) +g(['glx-visuals-stencil', '-pixmap']) g(['glx-window-life']) g(['glx-pixmap-crosscheck']) g(['glx-query-drawable', '--attr=GLX_WIDTH', '--type=GLXWINDOW'], -- 2.3.1 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 5/7] tests/all.py: remove duplicate oes_compressed_paletted test
Signed-off-by: Dylan Baker --- tests/all.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/all.py b/tests/all.py index fee090d..7fbfea5 100644 --- a/tests/all.py +++ b/tests/all.py @@ -4014,7 +4014,6 @@ with profile.group_manager( grouptools.join('spec', 'oes_compressed_paletted_texture')) as g: g(['oes_compressed_paletted_texture-api'], 'basic API') g(['arb_texture_compression-invalid-formats', 'paletted'], 'invalid formats') -g(['oes_compressed_paletted_texture-api'], 'basic API') with profile.group_manager( PiglitGLTest, -- 2.3.1 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 2/7] tests/all.py: Remove duplicate arb_tessellation_shader_minmax entry
This test was added twice, remove the second copy. Signed-off-by: Dylan Baker --- tests/all.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/all.py b/tests/all.py index 7adda80..cba8733 100644 --- a/tests/all.py +++ b/tests/all.py @@ -1634,7 +1634,6 @@ with profile.group_manager( os.path.join(TESTS_DIR, 'spec', 'arb_tessellation_shader', 'minimum-maximums.txt')], 'built-in-constants') -g(['arb_tessellation_shader-minmax']) # Group ARB_texture_multisample with profile.group_manager( -- 2.3.1 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 6/7] tests/all.py: Don't add glsl-1.50 TextureSize tests twice
Because gs is a 1.50 features, but is added in the 1.30 and 1.40 loops it currently adds the same tests twice. This corrects that. Signed-off-by: Dylan Baker --- tests/all.py | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/all.py b/tests/all.py index 7fbfea5..ff61369 100644 --- a/tests/all.py +++ b/tests/all.py @@ -1337,12 +1337,17 @@ for stage in ['vs', 'gs', 'fs']: version = '1.50' else: version = '1.30' + # textureSize(): -for sampler in textureSize_samplers_130: -profile.test_list[grouptools.join( -'spec', 'glsl-{}'.format(version), 'execution', 'textureSize', -'{}-textureSize-{}'.format(stage, sampler))] = PiglitGLTest( -['textureSize', stage, sampler]) +# These will be added in the textureSize_samplers_140 loop for gs, because +# it is a special case and is actually 1.50 feature. +if stage is not 'gs': +for sampler in textureSize_samplers_130: +profile.test_list[grouptools.join( +'spec', 'glsl-{}'.format(version), 'execution', 'textureSize', +'{}-textureSize-{}'.format(stage, sampler))] = PiglitGLTest( +['textureSize', stage, sampler]) + # texelFetch(): for sampler in ['sampler1D', 'sampler2D', 'sampler3D', 'sampler1DArray', 'sampler2DArray', 'isampler1D', 'isampler2D', 'isampler3D', 'isampler1DArray', 'isampler2DArray', 'usampler1D', 'usampler2D', 'usampler3D', 'usampler1DArray', 'usampler2DArray']: profile.test_list[grouptools.join( @@ -1353,6 +1358,7 @@ for stage in ['vs', 'gs', 'fs']: 'spec', 'glsl-{}'.format(version), 'execution', 'texelFetchOffset', '{}-texelFetch-{}'.format(stage, sampler))] = PiglitGLTest( ['texelFetch', 'offset', stage, sampler]) + # texelFetch() with EXT_texture_swizzle mode "b0r1": for type in ['i', 'u', '']: profile.test_list[grouptools.join( -- 2.3.1 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 4/7] tests/all.py: move arb_gpu_shader5 out of loop
Same as previous patch. --- tests/all.py | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/all.py b/tests/all.py index fe310d9..fee090d 100644 --- a/tests/all.py +++ b/tests/all.py @@ -1989,24 +1989,24 @@ with profile.group_manager( 'clamp' if sampler == '2DRect' else 'repeat'] g(cmd, testname) -g(['arb_gpu_shader5-minmax']) -g(['arb_gpu_shader5-invocation-id']) -g(['arb_gpu_shader5-invocations_count_too_large']) -g(['arb_gpu_shader5-xfb-streams']) -g(['arb_gpu_shader5-stream_value_too_large']) -g(['arb_gpu_shader5-emitstreamvertex_stream_too_large']) -g(['arb_gpu_shader5-tf-wrong-stream-value']) -g(['arb_gpu_shader5-xfb-streams-without-invocations']) -g(['arb_gpu_shader5-emitstreamvertex_nodraw']) -g(['arb_gpu_shader5-interpolateAtCentroid']) -g(['arb_gpu_shader5-interpolateAtCentroid-packing']) -g(['arb_gpu_shader5-interpolateAtCentroid-flat']) -g(['arb_gpu_shader5-interpolateAtCentroid-centroid']) -g(['arb_gpu_shader5-interpolateAtCentroid-noperspective']) -g(['arb_gpu_shader5-interpolateAtSample']) -g(['arb_gpu_shader5-interpolateAtSample-nonconst']) -g(['arb_gpu_shader5-interpolateAtOffset']) -g(['arb_gpu_shader5-interpolateAtOffset-nonconst']) +g(['arb_gpu_shader5-minmax']) +g(['arb_gpu_shader5-invocation-id']) +g(['arb_gpu_shader5-invocations_count_too_large']) +g(['arb_gpu_shader5-xfb-streams']) +g(['arb_gpu_shader5-stream_value_too_large']) +g(['arb_gpu_shader5-emitstreamvertex_stream_too_large']) +g(['arb_gpu_shader5-tf-wrong-stream-value']) +g(['arb_gpu_shader5-xfb-streams-without-invocations']) +g(['arb_gpu_shader5-emitstreamvertex_nodraw']) +g(['arb_gpu_shader5-interpolateAtCentroid']) +g(['arb_gpu_shader5-interpolateAtCentroid-packing']) +g(['arb_gpu_shader5-interpolateAtCentroid-flat']) +g(['arb_gpu_shader5-interpolateAtCentroid-centroid']) +g(['arb_gpu_shader5-interpolateAtCentroid-noperspective']) +g(['arb_gpu_shader5-interpolateAtSample']) +g(['arb_gpu_shader5-interpolateAtSample-nonconst']) +g(['arb_gpu_shader5-interpolateAtOffset']) +g(['arb_gpu_shader5-interpolateAtOffset-nonconst']) with profile.group_manager( -- 2.3.1 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] Don't allow test names to be reassigned accidentally
This series removes all duplicate test entries (or examples of tests being reassigned to a different test). The big change is that this changes the profile.test_list to not allow tests to be reassigned normally, if one does, an exception will be raised (and caught to print a nice error message). If one wants to actually override a test name then one can use the profile.allow_reassignment context manager to explicitly reassign tests. See quick.py for an example of this functionality. ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] spec/arb_blend_func_extended: Add test for SIMD16 dual source blending
On Thu, Mar 5, 2015 at 10:50 AM, Matt Turner wrote: > From: Iago Toral Quiroga > > On Intel hardware at least, SIMD16 dual source rendering requires handling > pixel data in two sets of 8 pixels each. Incorrect implementations may fail > to map correct colors for each pixel group (for example by using the color > for the first group as the color for the second group or viceversa). However, > tests that render using solid colors across the entire polygon won't catch > these cases (since in that case the color is the same for boths groups of > pixels). > > This test blends using a checker board pattern where each cell is > 10px wide and 10px tall. This makes it so that the two sets of 8 pixels > issued during SIMD16 operation pack different color data for the pixels > involved, enabling testing of correct behavior in that case. > --- > This is the same patch Iago sent, just rebased on today's all.py changes. > > Iago, the test doesn't seem to open a window. I expected it would render > to an offscreen FBO but then blit to a window to display if -auto wasn't > passed. Ugh, I apparently used the message-id of the corresponding Mesa patch in reply-to instead of the piglit test. ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] tests/spec/glsl-1.50/execution/fragcoord-layout-qualifiers-conflicting-case-7.shader_test conflict with spec
On Wed, Mar 4, 2015 at 8:33 PM, Guo, Johney wrote: > The conformance test expected link error, Am I wrong ? > > In the file of > conform\cts\gl_cts\GTF\GL3Tests\fragment_coord_conventions\fragment_coord_conventions_32_multishader_error_1.test > > name="redeclaration_with_no_layout_qualifiers_and_no_redeclaration_but_use" > expecterror="true"> > 150 core > 300 es > fragment_coord_conventions_32_default.vert > > fragment_coord_conventions_32_redeclaration_with_no_layout_qualifiers.frag > > fragment_coord_conventions_32_no_redeclaration_but_use.frag > > > You're right. It got changed after I added the test. See Khronos Bug#12957. Seems like people agreed on this change. In that case your patch is: Reviewed-by: Anuj Phogat > -Original Message- > From: Anuj Phogat [mailto:anuj.pho...@gmail.com] > Sent: Thursday, March 5, 2015 11:22 AM > To: Matt Turner > Cc: Guo, Johney; piglit@lists.freedesktop.org; Jordan Justen; Chris Forbes; > Lin, Qun; Ian Romanick > Subject: Re: [Piglit] [PATCH] > tests/spec/glsl-1.50/execution/fragcoord-layout-qualifiers-conflicting-case-7.shader_test > conflict with spec > > On Wed, Mar 4, 2015 at 6:25 PM, Matt Turner wrote: >> On Tue, Mar 3, 2015 at 6:43 PM, Guo, Johney wrote: >>> >>> According to spec, this test should expected to error instead of success. > I had a discussion with Ian when I added this test to piglit and khronos > conformance. We concluded that spec restriction shouldn't apply to a case > when you redeclare without any layout qualifiers because it matches the > default declaration of gl_FragCoord. NVIDIA proprietary linux driver also > allows the test to link. Making this case fail to link might break some > application making this harmless mistake. > > >>> The behavior is different with Khronos conformance test >>> GL44-CTS.gtf32.GL3Tests.fragment_coord_conventions.fragment_coord_conventions_32_multishader_error_1 >>>( subcase >>> redeclaration_with_no_layout_qualifiers_and_no_redeclaration_but_use). > Conformance test behavior matches the piglit test behavior. > >>> >>> * "If gl_FragCoord is redeclared in any fragment shader in a program, >>> * it must be redeclared in all the fragment shaders in that program >>> * that have a static use gl_FragCoord. All redeclarations of >>> * gl_FragCoord in all fragment shaders in a single program must have >>> * the same set of qualifiers." >>> >>> Please check it. >>> --- >>> >>> diff --git >>> a/tests/spec/glsl-1.50/execution/fragcoord-layout-qualifiers-conflict >>> ing-case-7.shader_test >>> b/tests/spec/glsl-1.50/execution/fragcoord-layout-qualifiers-conflict >>> ing-case-7.shader_test >>> index 13605b4..201c75d 100644 >>> --- >>> a/tests/spec/glsl-1.50/execution/fragcoord-layout-qualifiers-conflict >>> ing-case-7.shader_test >>> +++ b/tests/spec/glsl-1.50/execution/fragcoord-layout-qualifiers-conf >>> +++ licting-case-7.shader_test >>> @@ -48,4 +48,4 @@ void alpha() >>> >>> >>> [test] >>> -link success >>> +link error >> >> If you make this change, you should update the comment above the >> [require] section as well. >> >> I think I'd have to agree with your interpretation. It seems like "If >> gl_FragCoord is redeclared in any fragment shader in a program, it >> must be redeclared in all the fragment shaders in that program that >> have a static use [of] gl_FragCoord." is pretty clear that this case >> should fail to link. >> >> Anuj, Jordan, Chris? ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] main: Test for CreateBuffers.
Oops, sorry I just realized that the commit message was wrong: "main" should be "arb_direct_state_access" instead. On Thu, Mar 5, 2015 at 12:49 AM, Martin Peres wrote: > On 05/03/15 03:48, Ilia Mirkin wrote: > >> On Wed, Mar 4, 2015 at 8:38 PM, Laura Ekstrand >> wrote: >> >>> --- >>> tests/all.py | 1 + >>> .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + >>> .../spec/arb_direct_state_access/create-buffers.c | 78 >>> ++ >>> 3 files changed, 80 insertions(+) >>> create mode 100644 tests/spec/arb_direct_state_access/create-buffers.c >>> >>> diff --git a/tests/all.py b/tests/all.py >>> index 0f07105..e60a02c 100644 >>> --- a/tests/all.py >>> +++ b/tests/all.py >>> @@ -4006,6 +4006,7 @@ >>> spec['ARB_direct_state_access']['compressedtexturesubimage'] >>> = PiglitGLTest(['ar >>> spec['ARB_direct_state_access']['texture-storage-multisample'] = >>> PiglitGLTest(['arb_direct_state_access-texture-storage-multisample'], >>> run_concurrent=True) >>> spec['ARB_direct_state_access']['texture-buffer'] = >>> PiglitGLTest(['arb_direct_state_access-texture-buffer'], >>> run_concurrent=True) >>> spec['ARB_direct_state_access']['texture-buffer-range'] = >>> PiglitGLTest(['arb_direct_state_access-texture-buffer-range'], >>> run_concurrent=True) >>> +spec['ARB_direct_state_access']['create-buffers'] = >>> PiglitGLTest(['arb_direct_state_access-create-buffers'], >>> run_concurrent=True) >>> spec['ARB_direct_state_access']['namedbufferstorage-persistent'] = >>> PiglitGLTest(['arb_direct_state_access-namedbufferstorage-persistent'], >>> run_concurrent=True) >>> spec['ARB_direct_state_access']['namedbuffersubdata-vbo-sync'] = >>> PiglitGLTest(['arb_direct_state_access-namedbuffersubdata-vbo-sync'], >>> run_concurrent=True) >>> >>> spec['ARB_direct_state_access']['clearnamedbufferdata-invalid-internal-format'] >>> = >>> PiglitGLTest(['arb_direct_state_access-clearnamedbufferdata-invalid-internal-format'], >>> run_concurrent=True) >>> diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt >>> b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt >>> index b2b7465..2a4915d 100644 >>> --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt >>> +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt >>> @@ -10,6 +10,7 @@ link_libraries ( >>> ) >>> >>> piglit_add_executable (arb_direct_state_access-create-transformfeedbacks >>> create-transformfeedbacks.c) >>> +piglit_add_executable (arb_direct_state_access-create-buffers >>> create-buffers.c) >>> piglit_add_executable >>> (arb_direct_state_access-namedbufferstorage-persistent >>> namedbufferstorage.c) >>> piglit_add_executable (arb_direct_state_access-namedbuffersubdata-vbo-sync >>> namedbuffersubdata-vbo-sync.c) >>> piglit_add_executable (arb_direct_state_access- >>> clearnamedbufferdata-invalid-internal-format >>> clearnamedbufferdata-invalid-internal-format.c) >>> diff --git a/tests/spec/arb_direct_state_access/create-buffers.c >>> b/tests/spec/arb_direct_state_access/create-buffers.c >>> new file mode 100644 >>> index 000..12fcf0b >>> --- /dev/null >>> +++ b/tests/spec/arb_direct_state_access/create-buffers.c >>> @@ -0,0 +1,78 @@ >>> +/* >>> + * Copyright 2014 Intel Corporation >>> + * >>> + * Permission is hereby granted, free of charge, to any person >>> obtaining a >>> + * copy of this software and associated documentation files (the >>> "Software"), >>> + * to deal in the Software without restriction, including without >>> limitation >>> + * the rights to use, copy, modify, merge, publish, distribute, >>> sublicense, >>> + * and/or sell copies of the Software, and to permit persons to whom the >>> + * Software is furnished to do so, subject to the following conditions: >>> + * >>> + * The above copyright notice and this permission notice (including the >>> next >>> + * paragraph) shall be included in all copies or substantial portions >>> of the >>> + * Software. >>> + * >>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, >>> EXPRESS OR >>> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF >>> MERCHANTABILITY, >>> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT >>> SHALL >>> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR >>> OTHER >>> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, >>> ARISING >>> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER >>> + * DEALINGS IN THE SOFTWARE. >>> + */ >>> + >>> +/** @file create_buffers.c >>> + * >>> + * Tests glCreateBuffers to see if it behaves in the expected way, >>> + * throwing the correct errors, etc. >>> + */ >>> + >>> +#include "piglit-util-gl.h" >>> + >>> +PIGLIT_GL_TEST_CONFIG_BEGIN >>> + >>> + config.supports_gl_compat_version = 32; >>> >> This will never run on mesa, right? I assume you meant >> >> supports_gl_core_version = 31 (or 32?) >> > > Why 32? 31 should be enough and
[Piglit] [PATCH] spec/arb_blend_func_extended: Add test for SIMD16 dual source blending
From: Iago Toral Quiroga On Intel hardware at least, SIMD16 dual source rendering requires handling pixel data in two sets of 8 pixels each. Incorrect implementations may fail to map correct colors for each pixel group (for example by using the color for the first group as the color for the second group or viceversa). However, tests that render using solid colors across the entire polygon won't catch these cases (since in that case the color is the same for boths groups of pixels). This test blends using a checker board pattern where each cell is 10px wide and 10px tall. This makes it so that the two sets of 8 pixels issued during SIMD16 operation pack different color data for the pixels involved, enabling testing of correct behavior in that case. --- This is the same patch Iago sent, just rebased on today's all.py changes. Iago, the test doesn't seem to open a window. I expected it would render to an offscreen FBO but then blit to a window to display if -auto wasn't passed. tests/all.py | 2 + .../execution/CMakeLists.gl.txt| 1 + .../execution/fbo-extended-blend-pattern.c | 209 + 3 files changed, 212 insertions(+) create mode 100644 tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c diff --git a/tests/all.py b/tests/all.py index 61fa1e2..9dc16db 100644 --- a/tests/all.py +++ b/tests/all.py @@ -3847,6 +3847,8 @@ with profile.group_manager( g(['arb_blend_func_extended-fbo-extended-blend'], run_concurrent=False) g(['arb_blend_func_extended-fbo-extended-blend-explicit'], run_concurrent=False) +g(['arb_blend_func_extended-fbo-extended-blend-pattern'], + run_concurrent=False) with profile.group_manager( PiglitGLTest, diff --git a/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt b/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt index ebe0fa0..1db7fa1 100644 --- a/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt +++ b/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt @@ -12,4 +12,5 @@ link_libraries ( piglit_add_executable (arb_blend_func_extended-fbo-extended-blend fbo-extended-blend.c) piglit_add_executable (arb_blend_func_extended-fbo-extended-blend-explicit fbo-extended-blend-explicit.c) +piglit_add_executable (arb_blend_func_extended-fbo-extended-blend-pattern fbo-extended-blend-pattern.c) # vim: ft=cmake: diff --git a/tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c b/tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c new file mode 100644 index 000..488c380 --- /dev/null +++ b/tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c @@ -0,0 +1,209 @@ +/* + * Copyright (c) 2014 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/** + * @file fbo-extended-blend-pattern.c + * @author Iago Toral Quiroga + * + * On Intel hardware at least, SIMD16 dual source rendering requires handling + * pixel data in two sets of 8 pixels each. Incorrect implementations may fail + * to map correct colors for each pixel group (for example by using the color + * for the first group as the color for the second group or viceversa). However, + * tests that render using solid colors across the entire polygon won't catch + * these cases (since in that case the color is the same for boths groups of + * pixels). + * + * This test blends using a checker board pattern where each cell is + * 10px wide and 10px tall. This makes it so that the two sets of 8 pixels + * issued during SIMD16 operation pack different color data for the pixels + * involved, enabling testing of correct behavior in that case. + * + * This only tests with one specific blend mode. There is no need to test + * others, since the details of SIMD16 operation are independent of the + * specifi
Re: [Piglit] [Patch v3 1/8] igt.py: Fix whitepace warnings for pylint
Hey Thomas, did you have any more comments on this series, or is it good to land? I ask because I'm working on python3 porting, an landing this will make a lot of that work easier. Dylan On Wed, Jan 28, 2015 at 11:35:01AM -0800, Dylan Baker wrote: > v2: - Also remove stderr from subprocess.Popen > > Signed-off-by: Dylan Baker > --- > tests/igt.py | 20 +--- > 1 file changed, 9 insertions(+), 11 deletions(-) > > diff --git a/tests/igt.py b/tests/igt.py > index bd4c70e..d54bb65 100644 > --- a/tests/igt.py > +++ b/tests/igt.py > @@ -124,22 +124,20 @@ tests.extend(listTests("multi-tests")) > > def addSubTestCases(test): > proc = subprocess.Popen( > -[os.path.join(igtTestRoot, test), '--list-subtests'], > -stdout=subprocess.PIPE, > -stderr=subprocess.PIPE, > -env=os.environ.copy(), > -universal_newlines=True > -) > -out, err = proc.communicate() > +[os.path.join(igtTestRoot, test), '--list-subtests'], > +stdout=subprocess.PIPE, > +env=os.environ.copy(), > +universal_newlines=True) > +out, _ = proc.communicate() > > # a return code of 79 indicates there are no subtests > if proc.returncode == 79: > - profile.test_list[grouptools.join('igt', test)] = IGTTest(test) > - return > +profile.test_list[grouptools.join('igt', test)] = IGTTest(test) > +return > > if proc.returncode != 0: > - print "Error: Could not list subtests for " + test > - return > +print "Error: Could not list subtests for " + test > +return > > subtests = out.split("\n") > > -- > 2.2.2 > signature.asc Description: Digital signature ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [ANNOuNCE] all.py and cl.py format changes
My final series for reworking all.py and cl.py landed this morning. Worth noting is the way that tests are added now. For those in the OpenGL crowd, asmperser, glslparser, and shader tests are added in a loop at the top of the file. for everyone else you now open a context manager for a group, rather than creating a dictionary profile.group_manager( # The class you are adding, probably PiglitGLTest or # PiglitCLTest PiglitGLTest, # And the group to add it to as a flat string. It is preferable to # use grouptools.join to join groups. grouptool.join('spec', 'ARB_hamsandwhich')) as g: g(['test', 'arguments'], , ) If you do not specify a name then the arguments will be joined with spaces (' '.join(args)). Any additional keyword arguments will be passed to the Test constructor. Common arguments might be, run_concurrent, require_platforms, exclude_platforms. Finally, the run_concurrent flag has been flipped in all.py, it now defaults to True, so tests that need to run serially need to be marked with run_concurrent=False, but tests that run concurrent will not need to be marked. In cl.py the concurrent setter has been moved into the PiglitCLTest class, it will do the check and set concurrency based on that, unless a test sets run_concurrent=False, then it will not. signature.asc Description: Digital signature ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] spec/arb_blend_func_extended: Add test for SIMD16 dual source blending
On Intel hardware at least, SIMD16 dual source rendering requires handling pixel data in two sets of 8 pixels each. Incorrect implementations may fail to map correct colors for each pixel group (for example by using the color for the first group as the color for the second group or viceversa). However, tests that render using solid colors across the entire polygon won't catch these cases (since in that case the color is the same for boths groups of pixels). This test blends using a checker board pattern where each cell is 10px wide and 10px tall. This makes it so that the two sets of 8 pixels issued during SIMD16 operation pack different color data for the pixels involved, enabling testing of correct behavior in that case. --- I sent this a few months ago, but since my SIMD16 dual source blending patch for i965 never got reviewed this never became relevant. I have now updated my version of that patch and hopefully I'll get it reviewed this time, so I am sending the test here again too. tests/all.py | 1 + .../execution/CMakeLists.gl.txt| 1 + .../execution/fbo-extended-blend-pattern.c | 209 + 3 files changed, 211 insertions(+) create mode 100644 tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c diff --git a/tests/all.py b/tests/all.py index d2ae5ea..1cc6e5f 100644 --- a/tests/all.py +++ b/tests/all.py @@ -3666,6 +3666,7 @@ add_plain_test(arb_blend_func_extended, ['arb_blend_func_extended-error-at-begin add_plain_test(arb_blend_func_extended, ['arb_blend_func_extended-getfragdataindex']) add_plain_test(arb_blend_func_extended, ['arb_blend_func_extended-fbo-extended-blend']) add_plain_test(arb_blend_func_extended, ['arb_blend_func_extended-fbo-extended-blend-explicit']) +add_plain_test(arb_blend_func_extended, ['arb_blend_func_extended-fbo-extended-blend-pattern']) arb_base_instance = {} spec['ARB_base_instance'] = arb_base_instance diff --git a/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt b/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt index ebe0fa0..1db7fa1 100644 --- a/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt +++ b/tests/spec/arb_blend_func_extended/execution/CMakeLists.gl.txt @@ -12,4 +12,5 @@ link_libraries ( piglit_add_executable (arb_blend_func_extended-fbo-extended-blend fbo-extended-blend.c) piglit_add_executable (arb_blend_func_extended-fbo-extended-blend-explicit fbo-extended-blend-explicit.c) +piglit_add_executable (arb_blend_func_extended-fbo-extended-blend-pattern fbo-extended-blend-pattern.c) # vim: ft=cmake: diff --git a/tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c b/tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c new file mode 100644 index 000..488c380 --- /dev/null +++ b/tests/spec/arb_blend_func_extended/execution/fbo-extended-blend-pattern.c @@ -0,0 +1,209 @@ +/* + * Copyright (c) 2014 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/** + * @file fbo-extended-blend-pattern.c + * @author Iago Toral Quiroga + * + * On Intel hardware at least, SIMD16 dual source rendering requires handling + * pixel data in two sets of 8 pixels each. Incorrect implementations may fail + * to map correct colors for each pixel group (for example by using the color + * for the first group as the color for the second group or viceversa). However, + * tests that render using solid colors across the entire polygon won't catch + * these cases (since in that case the color is the same for boths groups of + * pixels). + * + * This test blends using a checker board pattern where each cell is + * 10px wide and 10px tall. This makes it so that the two sets of 8 pixels + * issued during SIMD16 operation pack different color data for the pixels + * involved, enabling testing of
[Piglit] [PATCH] util: do not compile/attach a NULL shader
This will simplify greatly the code for an upcoming test Signed-off-by: Martin Peres --- tests/util/piglit-shader.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) mode change 100644 => 100755 tests/util/piglit-shader.c diff --git a/tests/util/piglit-shader.c b/tests/util/piglit-shader.c old mode 100644 new mode 100755 index 37cc7cc..dfc2d92 --- a/tests/util/piglit-shader.c +++ b/tests/util/piglit-shader.c @@ -378,10 +378,14 @@ piglit_build_simple_program_unlinked_multiple_shaders_v(GLenum target1, target = target1; while (target != 0) { - GLuint shader = piglit_compile_shader_text(target, source); + /* do not compile/attach a NULL shader */ + if (source) { + GLuint shader = piglit_compile_shader_text(target, + source); - glAttachShader(prog, shader); - glDeleteShader(shader); + glAttachShader(prog, shader); + glDeleteShader(shader); + } target = va_arg(ap, GLenum); if (target != 0) -- 2.3.1 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] main: Test for CreateBuffers.
On 05/03/15 03:48, Ilia Mirkin wrote: On Wed, Mar 4, 2015 at 8:38 PM, Laura Ekstrand wrote: --- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + .../spec/arb_direct_state_access/create-buffers.c | 78 ++ 3 files changed, 80 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/create-buffers.c diff --git a/tests/all.py b/tests/all.py index 0f07105..e60a02c 100644 --- a/tests/all.py +++ b/tests/all.py @@ -4006,6 +4006,7 @@ spec['ARB_direct_state_access']['compressedtexturesubimage'] = PiglitGLTest(['ar spec['ARB_direct_state_access']['texture-storage-multisample'] = PiglitGLTest(['arb_direct_state_access-texture-storage-multisample'], run_concurrent=True) spec['ARB_direct_state_access']['texture-buffer'] = PiglitGLTest(['arb_direct_state_access-texture-buffer'], run_concurrent=True) spec['ARB_direct_state_access']['texture-buffer-range'] = PiglitGLTest(['arb_direct_state_access-texture-buffer-range'], run_concurrent=True) +spec['ARB_direct_state_access']['create-buffers'] = PiglitGLTest(['arb_direct_state_access-create-buffers'], run_concurrent=True) spec['ARB_direct_state_access']['namedbufferstorage-persistent'] = PiglitGLTest(['arb_direct_state_access-namedbufferstorage-persistent'], run_concurrent=True) spec['ARB_direct_state_access']['namedbuffersubdata-vbo-sync'] = PiglitGLTest(['arb_direct_state_access-namedbuffersubdata-vbo-sync'], run_concurrent=True) spec['ARB_direct_state_access']['clearnamedbufferdata-invalid-internal-format'] = PiglitGLTest(['arb_direct_state_access-clearnamedbufferdata-invalid-internal-format'], run_concurrent=True) diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index b2b7465..2a4915d 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -10,6 +10,7 @@ link_libraries ( ) piglit_add_executable (arb_direct_state_access-create-transformfeedbacks create-transformfeedbacks.c) +piglit_add_executable (arb_direct_state_access-create-buffers create-buffers.c) piglit_add_executable (arb_direct_state_access-namedbufferstorage-persistent namedbufferstorage.c) piglit_add_executable (arb_direct_state_access-namedbuffersubdata-vbo-sync namedbuffersubdata-vbo-sync.c) piglit_add_executable (arb_direct_state_access-clearnamedbufferdata-invalid-internal-format clearnamedbufferdata-invalid-internal-format.c) diff --git a/tests/spec/arb_direct_state_access/create-buffers.c b/tests/spec/arb_direct_state_access/create-buffers.c new file mode 100644 index 000..12fcf0b --- /dev/null +++ b/tests/spec/arb_direct_state_access/create-buffers.c @@ -0,0 +1,78 @@ +/* + * Copyright 2014 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** @file create_buffers.c + * + * Tests glCreateBuffers to see if it behaves in the expected way, + * throwing the correct errors, etc. + */ + +#include "piglit-util-gl.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 32; This will never run on mesa, right? I assume you meant supports_gl_core_version = 31 (or 32?) Why 32? 31 should be enough and that is also what I used on all my tests. + + config.window_visual = PIGLIT_GL_VISUAL_RGBA | + PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + +void +piglit_init(int argc, char **argv) +{ + piglit_require_extension("GL_ARB_direct_state_access"); +} + +enum piglit_result +piglit_display(void) +{ + bool pass = true; + GLuint name; + GLboolean ret; + + /* Throw some invalid inputs at glCreateBuffers. */ + + /* n is negative */ + glCreateBuffers(-1, &name); + pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass; + + /* name is not
Re: [Piglit] [PATCH] util: keep track of failures in subtests
On 04/03/15 20:38, Dylan Baker wrote: On Wed, Mar 04, 2015 at 10:00:03AM +0200, Martin Peres wrote: On 03/03/15 20:32, Dylan Baker wrote: On Tue, Mar 03, 2015 at 03:12:51PM +0200, Martin Peres wrote: On 03/03/15 14:55, Jose Fonseca wrote: On 26/02/15 16:06, Martin Peres wrote: --- tests/util/piglit-util.c | 17 + 1 file changed, 17 insertions(+) diff --git a/tests/util/piglit-util.c b/tests/util/piglit-util.c index b094625..b5bd89f 100644 --- a/tests/util/piglit-util.c +++ b/tests/util/piglit-util.c @@ -273,6 +273,20 @@ piglit_set_timeout(double seconds, enum piglit_result timeout_result) #endif } +static bool _piglit_subtests_all_passed = true; + +bool piglit_subtests_all_passed() +{ +return _piglit_subtests_all_passed; +} + +bool piglit_subtests_all_passed_reset() +{ +bool ret = _piglit_subtests_all_passed; +_piglit_subtests_all_passed = true; +return ret; +} + void piglit_report_subtest_result(enum piglit_result result, const char *format, ...) { @@ -287,6 +301,9 @@ piglit_report_subtest_result(enum piglit_result result, const char *format, ...) fflush(stdout); va_end(ap); + +if (result == PIGLIT_FAIL) +_piglit_subtests_all_passed = false; } #ifdef _WIN32 Sorry for the delay. This looks good overall, though it might be better to change the interface to use enum piglit_result instead of bool, so that it eventually it handles WARP/SKIP better (eg., if all subtests SKIP, then report SKIP). No probs for the delay. That is indeed a good proposition. BTW, is it really true that if one subtest fails, the overall test should be false? For example, when I was looking at iglit_report_subtest_result callers, I noticed that tests/spec/amd_performance_monitor/api.c will not report false overall, even though may report true. That is a matter of conventions I guess but to me it does not make sense to say that a test passed if some parts of it failed. Has anyone a test in mind where it would make sense? Worst case, we could make a function that does not update the global state. I agree with this, and it is what piglit currently does. Right now the framework disregards the overall status of the test and return the 'worst' subtest status as the overall test status. Really? That sounds great! How can I use this behaviour? Should be done automatically by the summary generator. I'm not sure if that's being done in the raw result files, but it certainly could be changed easily enough Yeah, it is not done in the raw result files. I guess it would make sense to do the work there and not in the summary generator. ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit