[Piglit] [PATCH] gl-1.0: Bitmap test that draws zelda hearts.
--- tests/opengl.py| 1 + tests/spec/gl-1.0/CMakeLists.gl.txt| 1 + tests/spec/gl-1.0/bitmap-heart-dance.c | 219 + 3 files changed, 221 insertions(+) create mode 100644 tests/spec/gl-1.0/bitmap-heart-dance.c diff --git a/tests/opengl.py b/tests/opengl.py index 347e8c5d4..ddf07b0b7 100644 --- a/tests/opengl.py +++ b/tests/opengl.py @@ -570,6 +570,7 @@ with profile.test_list.group_manager( PiglitGLTest, grouptools.join('spec', '!opengl 1.0')) as g: g(['gl-1.0-beginend-coverage']) +g(['gl-1.0-bitmap-heart-dance']) g(['gl-1.0-dlist-beginend']) g(['gl-1.0-dlist-bitmap']) g(['gl-1.0-dlist-materials']) diff --git a/tests/spec/gl-1.0/CMakeLists.gl.txt b/tests/spec/gl-1.0/CMakeLists.gl.txt index e5986968c..c97a160fc 100644 --- a/tests/spec/gl-1.0/CMakeLists.gl.txt +++ b/tests/spec/gl-1.0/CMakeLists.gl.txt @@ -10,6 +10,7 @@ link_libraries ( piglit_add_executable (gl-1.0-user-clip-all-planes user-clip-all-planes.c) piglit_add_executable (gl-1.0-beginend-coverage beginend-coverage.c) +piglit_add_executable (gl-1.0-bitmap-heart-dance bitmap-heart-dance.c) piglit_add_executable (gl-1.0-blend-func blend.c) piglit_add_executable (gl-1.0-dlist-beginend dlist-beginend.c) piglit_add_executable (gl-1.0-dlist-bitmap dlist-bitmap.c) diff --git a/tests/spec/gl-1.0/bitmap-heart-dance.c b/tests/spec/gl-1.0/bitmap-heart-dance.c new file mode 100644 index 0..cb1c7faa7 --- /dev/null +++ b/tests/spec/gl-1.0/bitmap-heart-dance.c @@ -0,0 +1,219 @@ +/* + * Copyright (C) 2018 Laura Ekstrand + * + * 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 glBitmap in a methodical way using a series of heart shapes. + * Heart shape is diagram A.2 from Garnstudio free sock pattern Heart Dance + * (https://www.garnstudio.com/pattern.php?id=7440=17). + * Knitting color work is basically glBitmap for knits! + * + * _ * _ _ _ * _ _where _ = 0 + * * * * _ * * * _ * = 1 + * * * * * * * * _ + * * * * * * * * _ + * _ * * * * * _ _ + * _ _ * * * _ _ _ + * _ _ _ * _ _ _ _ + * _ _ _ _ _ _ _ _ + * + * Or: Little endBig end + * 0 1 0 0 0 1 0 0 68 0x44 0x22 + * 1 1 1 0 1 1 1 0238 0xEE 0x77 + * 1 1 1 1 1 1 1 0254 0xFE 0xF7 + * 1 1 1 1 1 1 1 0254 0xFE 0xF7 + * 0 1 1 1 1 1 0 0124 0x7C 0xE3 + * 0 0 1 1 1 0 0 0 56 0x38 0xC2 + * 0 0 0 1 0 0 0 0 16 0x10 0x80 + * 0 0 0 0 0 0 0 0 0 0x00 0x00 + * + * Laura Ekstrand + * March 2018 + */ + +#include "piglit-util-gl.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + config.supports_gl_compat_version = 10; + config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | + PIGLIT_GL_VISUAL_RGBA; + config.window_width = 340; + config.window_height = 200; + config.khr_no_error_support = PIGLIT_NO_ERRORS; +PIGLIT_GL_TEST_CONFIG_END + +static const float red[4] = {0.502, 0.082, 0.082, 1.0}; +static const float salmon[4] = {1.000, 0.353, 0.353, 1.0}; +static const float pink[4] = {0.945, 0.471, 0.639, 1.0}; +static const float orange[4] = {1.000, 0.286, 0.000, 1.0}; +static const float ltorange[4] = {1.000, 0.514, 0.322, 1.0}; +static const float yellow[4] = {1.000, 0.871, 0.133, 1.0}; +static GLubyte bitmap[8] = { 0x00, 0x10, 0x38, 0x7C, +0xFE, 0xFE, 0xEE, 0x44 }; + +static const char *fragShaderText = + "#version 130 \n" + "uniform vec4 red; \n" + "uniform vec4 salmon; \n" + "uniform vec4 pink; \n" + "uniform vec4 orange; \n" + "uniform vec4 ltorange; \n" + "uniform vec4 yellow; \n" + "uniform int xorig; \n" + "uniform int yorig;
Re: [Piglit] [PATCH] gl-1.0: Bitmap test that draws zelda hearts.
Ian, This test has been moved up the priority list. Jason has adopted my blitter-removal patches because someone at Intel wants the blitter gone. (It should've been deleted ages ago.) Anyway, test coverage for glBitmap was a little spotty for the purposes of removing the blitter from glBitmap in the i965 driver, so that's why I made this test. Thanks. Laura On Fri, May 11, 2018 at 1:38 PM, Laura Ekstrandwrote: > --- > tests/opengl.py| 1 + > tests/spec/gl-1.0/CMakeLists.gl.txt| 1 + > tests/spec/gl-1.0/bitmap-heart-dance.c | 219 > + > 3 files changed, 221 insertions(+) > create mode 100644 tests/spec/gl-1.0/bitmap-heart-dance.c > > diff --git a/tests/opengl.py b/tests/opengl.py > index 347e8c5d4..ddf07b0b7 100644 > --- a/tests/opengl.py > +++ b/tests/opengl.py > @@ -570,6 +570,7 @@ with profile.test_list.group_manager( > PiglitGLTest, > grouptools.join('spec', '!opengl 1.0')) as g: > g(['gl-1.0-beginend-coverage']) > +g(['gl-1.0-bitmap-heart-dance']) > g(['gl-1.0-dlist-beginend']) > g(['gl-1.0-dlist-bitmap']) > g(['gl-1.0-dlist-materials']) > diff --git a/tests/spec/gl-1.0/CMakeLists.gl.txt b/tests/spec/gl-1.0/ > CMakeLists.gl.txt > index e5986968c..c97a160fc 100644 > --- a/tests/spec/gl-1.0/CMakeLists.gl.txt > +++ b/tests/spec/gl-1.0/CMakeLists.gl.txt > @@ -10,6 +10,7 @@ link_libraries ( > > piglit_add_executable (gl-1.0-user-clip-all-planes user-clip-all-planes.c) > piglit_add_executable (gl-1.0-beginend-coverage beginend-coverage.c) > +piglit_add_executable (gl-1.0-bitmap-heart-dance bitmap-heart-dance.c) > piglit_add_executable (gl-1.0-blend-func blend.c) > piglit_add_executable (gl-1.0-dlist-beginend dlist-beginend.c) > piglit_add_executable (gl-1.0-dlist-bitmap dlist-bitmap.c) > diff --git a/tests/spec/gl-1.0/bitmap-heart-dance.c > b/tests/spec/gl-1.0/bitmap-heart-dance.c > new file mode 100644 > index 0..cb1c7faa7 > --- /dev/null > +++ b/tests/spec/gl-1.0/bitmap-heart-dance.c > @@ -0,0 +1,219 @@ > +/* > + * Copyright (C) 2018 Laura Ekstrand > + * > + * 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 glBitmap in a methodical way using a series of heart shapes. > + * Heart shape is diagram A.2 from Garnstudio free sock pattern Heart > Dance > + * (https://www.garnstudio.com/pattern.php?id=7440=17). > + * Knitting color work is basically glBitmap for knits! > + * > + * _ * _ _ _ * _ _where _ = 0 > + * * * * _ * * * _ * = 1 > + * * * * * * * * _ > + * * * * * * * * _ > + * _ * * * * * _ _ > + * _ _ * * * _ _ _ > + * _ _ _ * _ _ _ _ > + * _ _ _ _ _ _ _ _ > + * > + * Or: Little endBig end > + * 0 1 0 0 0 1 0 0 68 0x44 0x22 > + * 1 1 1 0 1 1 1 0238 0xEE 0x77 > + * 1 1 1 1 1 1 1 0254 0xFE 0xF7 > + * 1 1 1 1 1 1 1 0254 0xFE 0xF7 > + * 0 1 1 1 1 1 0 0124 0x7C 0xE3 > + * 0 0 1 1 1 0 0 0 56 0x38 0xC2 > + * 0 0 0 1 0 0 0 0 16 0x10 0x80 > + * 0 0 0 0 0 0 0 0 0 0x00 0x00 > + * > + * Laura Ekstrand > + * March 2018 > + */ > + > +#include "piglit-util-gl.h" > + > +PIGLIT_GL_TEST_CONFIG_BEGIN > + config.supports_gl_compat_version = 10; > + config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | > + PIGLIT_GL_VISUAL_RGBA; > + config.window_width = 340; > + config.window_height = 200; > + config.khr_no_error_support = PIGLIT_NO_ERRORS; > +PIGLIT_GL_TEST_CONFIG_END > + > +static const float red[4] = {0.502, 0.082, 0.082, 1.0}; > +static const float salmon[4] = {1.000, 0.353, 0.353, 1.0}; > +static const float pink[4]
Re: [Piglit] [PATCH 1/3] profile: add the idea of process-isolated xml file
On 2018-05-10 06:41 PM, Dylan Baker wrote: > Marek and Michel, > > I meant to CC you both on this series as well. With this you should be able to > run ./piglit gpu outdir --process-isolation=false and get the result you > expect. > I've tested the runtime with this series applied and before my 35 patch and it > is pretty close to equivalent. Indeed. First run after compiling piglit with this series took ~6 minutes, but now it seems to consistently hit under 4:50, whereas before 9461d92301e72807eba4776a16a05207e3a16477 it was ~4:40. Also, with this series, the set of tests run by the gpu profile is almost identical to what it was before 9461d92301e72807eba4776a16a05207e3a16477. I assume the remaining minor differences are expected due to unrelated other changes in the meantime. Overall, this series looks great from my end, thanks Dylan! Tested-by: Michel Dänzer-- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer signature.asc Description: OpenPGP digital signature ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [Bug 106477] Wayland. Piglit tests can't be built - fatal error: wayland-client.h: No such fi le or directory
https://bugs.freedesktop.org/show_bug.cgi?id=106477 Mark Janeschanged: What|Removed |Added Resolution|--- |INVALID Status|NEW |RESOLVED --- Comment #2 from Mark Janes --- This is a question for IRC, not bugzilla. Make sure you have the wayland dev packages installed. Every commit of piglit is built daily in CI. -- You are receiving this mail because: You are the assignee for the bug. You are the QA Contact for the bug.___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] util: add includes when building for Wayland
This fixes following compile issue on OpenSUSE Tumbleweed: piglit_wl_framework.c:33:10: fatal error: wayland-client.h: No such file or directory #include Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106477 Signed-off-by: Sergii Romantsov--- tests/util/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt index 0508eb0..3fa67d7 100644 --- a/tests/util/CMakeLists.txt +++ b/tests/util/CMakeLists.txt @@ -94,6 +94,9 @@ if(PIGLIT_USE_WAFFLE) list(APPEND UTIL_GL_SOURCES piglit-framework-gl/piglit_wl_framework.c ) + list(APPEND UTIL_GL_INCLUDES + ${WAYLAND_wayland-client_INCLUDEDIR} + ) endif() if(PIGLIT_HAS_X11) list(APPEND UTIL_GL_SOURCES -- 2.7.4 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [Bug 106477] Wayland. Piglit tests can't be built - fatal error: wayland-client.h: No such fi le or directory
https://bugs.freedesktop.org/show_bug.cgi?id=106477 --- Comment #1 from Denis--- Created attachment 139500 --> https://bugs.freedesktop.org/attachment.cgi?id=139500=edit CMakeLists.txt -- You are receiving this mail because: You are the assignee for the bug. You are the QA Contact for the bug.___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [Bug 106477] New: Wayland. Piglit tests can't be built - fatal error: wayland-client.h: No such fi le or directory
https://bugs.freedesktop.org/show_bug.cgi?id=106477 Bug ID: 106477 Summary: Wayland. Piglit tests can't be built - fatal error: wayland-client.h: No such fi le or directory Product: piglit Version: unspecified Hardware: x86-64 (AMD64) OS: Linux (All) Status: NEW Severity: minor Priority: medium Component: tests Assignee: piglit@lists.freedesktop.org Reporter: denys.kos...@globallogic.com QA Contact: piglit@lists.freedesktop.org Created attachment 139499 --> https://bugs.freedesktop.org/attachment.cgi?id=139499=edit CmakeCache.txt Hi. Faced with a problem that piglit tests are failing to build on distributive with Wayland. What I did: 1. clonned git 2. made configuration file with "cmake ." 3. make Error displays (config file generated after cmake - attached). Below my configuration and error: System: Host: linux-vueb Kernel: 4.16.3-1-default x86_64 bits: 64 Desktop: KDE Plasma 5.12.4 Distro: openSUSE Tumbleweed 20180425 Error: [ 0%] Building C object target_api/gl/tests/util/CMakeFiles/piglitutil_gl.dir/piglit-util-waffle.c.o [ 0%] Building C object target_api/gl/tests/util/CMakeFiles/piglitutil_gl.dir/piglit-framework-gl/piglit_gbm_framework. c.o [ 0%] Building C object target_api/gl/tests/util/CMakeFiles/piglitutil_gl.dir/piglit-framework-gl/piglit_wl_framework.c .o /home/denis/piglit/tests/util/piglit-framework-gl/piglit_wl_framework.c:33:10: fatal error: wayland-client.h: No such fi le or directory #include ^~ compilation terminated. make[2]: *** [target_api/gl/tests/util/CMakeFiles/piglitutil_gl.dir/build.make:615: target_api/gl/tests/util/CMakeFiles/ piglitutil_gl.dir/piglit-framework-gl/piglit_wl_framework.c.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:6095: target_api/gl/tests/util/CMakeFiles/piglitutil_gl.dir/all] Error 2 make: *** [Makefile:152: all] Error 2 denis@linux-vueb:~/piglit> -- You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug.___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH v4] tests: add nvidia conservative rasterization tests
Both approaches look like they would be more robust that the current one. I think I'll create a new version of the patch using the first one. On Fri, May 11, 2018 at 4:06 AM, Brian Paulwrote: > Reviewed-by: Brian Paul > > Though, I can't help but think that we could do something better for the > drawing test. > > My first approach would be to draw a triangle with conservative > rasterization on then off and compare how many pixels are written. The > conservative rasterization should generate more fragments than the normal > rasterization. And the difference should, I think, be proportional to the > perimeter of the triangle. As long as there's no vertical/horizontal edges > exactly on pixel bounds. > > Another approach would be to draw two adjacent gray triangles with blend-add > mode and check that pixels along the shared edge are white (hit twice). > > What do you think? > > -Brian > > > > On 05/09/2018 02:05 PM, Rhys Perry wrote: >> >> Ping I guess? >> >> On Fri, Mar 30, 2018 at 10:56 PM, Rhys Perry >> wrote: >>> >>> Adds tests for GL_NV_conservative_raster, >>> GL_NV_conservative_raster_dilate >>> and GL_NV_conservative_raster_pre_snap_triangles. >>> >>> Changes in v2: >>> - cleanup the tests >>> - fix some test failures >>> - remove the gles version of the dilation test as the extension is not >>>exposed in gl.xml >>> Changes in v3: >>> - fix accidently luck-based pre-snap-triangles test >>> Changes in v4: >>> - apply formatting changes >>> - elaborate on various comments describing the test source code files >>> >>> Signed-off-by: Rhys Perry >>> --- >>> I am new to this project and don't have commit access. >>> >>> tests/all.py | 20 ++ >>> tests/spec/CMakeLists.txt | 3 + >>> .../spec/nv_conservative_raster/CMakeLists.gl.txt | 13 + >>> .../nv_conservative_raster/CMakeLists.gles2.txt| 3 + >>> tests/spec/nv_conservative_raster/CMakeLists.txt | 1 + >>> tests/spec/nv_conservative_raster/attrib.c | 107 +++ >>> tests/spec/nv_conservative_raster/dlist.c | 110 +++ >>> tests/spec/nv_conservative_raster/draw.c | 338 >>> + >>> .../CMakeLists.gl.txt | 11 + >>> .../nv_conservative_raster_dilate/CMakeLists.txt | 1 + >>> tests/spec/nv_conservative_raster_dilate/draw.c| 151 + >>> .../CMakeLists.gl.txt | 11 + >>> .../CMakeLists.gles2.txt | 3 + >>> .../CMakeLists.txt | 1 + >>> .../draw.c | 148 + >>> 15 files changed, 921 insertions(+) >>> create mode 100644 tests/spec/nv_conservative_raster/CMakeLists.gl.txt >>> create mode 100644 >>> tests/spec/nv_conservative_raster/CMakeLists.gles2.txt >>> create mode 100644 tests/spec/nv_conservative_raster/CMakeLists.txt >>> create mode 100644 tests/spec/nv_conservative_raster/attrib.c >>> create mode 100644 tests/spec/nv_conservative_raster/dlist.c >>> create mode 100644 tests/spec/nv_conservative_raster/draw.c >>> create mode 100644 >>> tests/spec/nv_conservative_raster_dilate/CMakeLists.gl.txt >>> create mode 100644 >>> tests/spec/nv_conservative_raster_dilate/CMakeLists.txt >>> create mode 100644 tests/spec/nv_conservative_raster_dilate/draw.c >>> create mode 100644 >>> tests/spec/nv_conservative_raster_pre_snap_triangles/CMakeLists.gl.txt >>> create mode 100644 >>> tests/spec/nv_conservative_raster_pre_snap_triangles/CMakeLists.gles2.txt >>> create mode 100644 >>> tests/spec/nv_conservative_raster_pre_snap_triangles/CMakeLists.txt >>> create mode 100644 >>> tests/spec/nv_conservative_raster_pre_snap_triangles/draw.c >>> >>> diff --git a/tests/all.py b/tests/all.py >>> index 7c8580ef0..5fa219ca0 100644 >>> --- a/tests/all.py >>> +++ b/tests/all.py >>> @@ -4995,5 +4995,25 @@ with profile.test_list.group_manager( >>> g(['arb_bindless_texture-uint64_attribs'], 'uint64_attribs') >>> g(['arb_bindless_texture-uniform'], 'uniform') >>> >>> +# Group NV_conservative_raster >>> +with profile.test_list.group_manager( >>> + PiglitGLTest, >>> + grouptools.join('spec', 'NV_conservative_raster')) as g: >>> +g(['nv_conservative_raster-draw'], 'draw') >>> +g(['nv_conservative_raster-dlist'], 'dlist') >>> +g(['nv_conservative_raster-attrib'], 'attrib') >>> + >>> +# Group NV_conservative_raster_dilate >>> +with profile.test_list.group_manager( >>> + PiglitGLTest, >>> + grouptools.join('spec', 'NV_conservative_raster_dilate')) as g: >>> +g(['nv_conservative_raster_dilate-draw'], 'draw') >>> + >>> +# Group NV_conservative_raster_pre_snap_triangles >>> +with profile.test_list.group_manager( >>> + PiglitGLTest, >>> + grouptools.join('spec', >>>
[Piglit] [PATCH 1/2] util: provide way to read a texture in ES compatible way
Implementation supports GL_TEXTURE_2D, GL_TEXTURE_2D_ARRAY and affects following functions: - piglit_probe_texel_rect_rgba - piglit_probe_texel_volume_rgba Signed-off-by: Tapani Pälli--- tests/util/piglit-util-gl.c | 109 ++-- 1 file changed, 105 insertions(+), 4 deletions(-) diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c index 2443be03e..f6a83e717 100644 --- a/tests/util/piglit-util-gl.c +++ b/tests/util/piglit-util-gl.c @@ -1882,6 +1882,99 @@ piglit_probe_image_ubyte(int x, int y, int w, int h, GLenum format, return 1; } +static GLuint +create_fbo_from_texture(GLenum target, GLint texture, GLint level, GLint layer) +{ + GLuint fbo; + + glGenFramebuffers(1, ); + glBindFramebuffer(GL_FRAMEBUFFER, fbo); + + if (layer > 0) { + glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, + texture, level, layer); + } else { + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, + target, texture, level); + } + + assert(glCheckFramebufferStatus(GL_FRAMEBUFFER) == + GL_FRAMEBUFFER_COMPLETE); + return fbo; +} + +static GLenum +binding_from_target(GLenum target) +{ + switch (target) { + case GL_TEXTURE_2D: + return GL_TEXTURE_BINDING_2D; + case GL_TEXTURE_2D_ARRAY: + return GL_TEXTURE_BINDING_2D_ARRAY; + default: + fprintf(stderr, "%s: unsupported target 0x%x\n", + __func__, target); + return 0; + } +} + +/** + * Read texels in OpenGL ES compatible way. + * + * Currently bound texture is attached to a framebuffer object and + * contents are read using glReadPixels. Supported targets are + * GL_TEXTURE_2D, GL_TEXTURE_2D_ARRAY. + */ +static GLfloat * +read_texture(int target, int level, int x, int y, int layer, int w, int h) +{ + GLint width, height, depth; + GLint current_read_fbo, current_draw_fbo, current_texture; + GLenum binding = binding_from_target(target); + unsigned char *buf; + GLfloat *buffer; + unsigned offset; + + assert(binding != 0); + + glGetIntegerv(binding, _texture); + glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, _read_fbo); + glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, _draw_fbo); + + assert(target == GL_TEXTURE_2D || target == GL_TEXTURE_2D_ARRAY); + + glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, ); + glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, ); + glGetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, ); + + buffer = malloc(width * height * depth * 4 * sizeof(GLfloat)); + buf = malloc(width * height * depth * 4 * sizeof(unsigned char)); + + GLuint fbo = + create_fbo_from_texture(target, current_texture, level, layer); + assert(fbo != 0); + + /* Offset to the layer we are expected to read. */ + offset = layer * (width * height * 4); + + glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, +buf + offset); + + for (unsigned k = offset; k < offset + width * height * 4; k++) + buffer[k] = ((float) buf[k]) / 255.0; + + free(buf); + + glDeleteFramebuffers(1, ); + + /* Restore FBO state. */ + glBindFramebuffer(GL_READ_FRAMEBUFFER, current_read_fbo); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, current_draw_fbo); + + return buffer; +} + + /** * Read a texel rectangle from the given location and compare its RGB value to * the given expected values. @@ -1957,9 +2050,13 @@ int piglit_probe_texel_rect_rgba(int target, int level, int x, int y, glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, ); glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, ); - buffer = malloc(width * height * 4 * sizeof(GLfloat)); - glGetTexImage(target, level, GL_RGBA, GL_FLOAT, buffer); + if (target == GL_TEXTURE_2D) { + buffer = read_texture(target, level, x, y, 0, w, h); + } else { + buffer = malloc(width * height * 4 * sizeof(GLfloat)); + glGetTexImage(target, level, GL_RGBA, GL_FLOAT, buffer); + } assert(x >= 0); assert(y >= 0); @@ -2021,9 +2118,13 @@ int piglit_probe_texel_volume_rgba(int target, int level, int x, int y, int z, glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, ); glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, ); glGetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, ); - buffer = malloc(width * height * depth * 4 * sizeof(GLfloat)); - glGetTexImage(target, level, GL_RGBA, GL_FLOAT, buffer); + if (target == GL_TEXTURE_2D || GL_TEXTURE_2D_ARRAY) { + buffer =
[Piglit] [PATCH 2/2] arb_texture_view: convert some more tests to run on ES 3.1
- arb_texture_view-clear-into-view-2d-array_gles3 - arb_texture_view-clear-into-view-2d_gles3 - arb_texture_view-clear-into-view-layered_gles3 - arb_texture_view-copytexsubimage-layers_gles3 - arb_texture_view-texsubimage-layers_gles3 - arb_texture_view-texsubimage-levels_gles3 Signed-off-by: Tapani Pälli--- tests/spec/arb_texture_view/CMakeLists.gles3.txt | 6 ++ tests/spec/arb_texture_view/clear-into-view-2d-array.c | 5 + tests/spec/arb_texture_view/clear-into-view-2d.c | 5 + tests/spec/arb_texture_view/clear-into-view-layered.c | 5 + tests/spec/arb_texture_view/copytexsubimage-layers.c | 5 + tests/spec/arb_texture_view/texsubimage-layers.c | 5 + tests/spec/arb_texture_view/texsubimage-levels.c | 5 + 7 files changed, 36 insertions(+) diff --git a/tests/spec/arb_texture_view/CMakeLists.gles3.txt b/tests/spec/arb_texture_view/CMakeLists.gles3.txt index ad3bae355..cbd8277fd 100644 --- a/tests/spec/arb_texture_view/CMakeLists.gles3.txt +++ b/tests/spec/arb_texture_view/CMakeLists.gles3.txt @@ -1,5 +1,9 @@ link_libraries(piglitutil_${piglit_target_api}) +piglit_add_executable(arb_texture_view-clear-into-view-2d-array_gles3 clear-into-view-2d-array.c common.c) +piglit_add_executable(arb_texture_view-clear-into-view-2d_gles3 clear-into-view-2d.c common.c) +piglit_add_executable(arb_texture_view-clear-into-view-layered_gles3 clear-into-view-layered.c common.c) +piglit_add_executable(arb_texture_view-copytexsubimage-layers_gles3 copytexsubimage-layers.c common.c) piglit_add_executable(arb_texture_view-rendering-formats_gles3 rendering-formats.c) piglit_add_executable(arb_texture_view-rendering-layers_gles3 rendering_layers.c common.c) piglit_add_executable(arb_texture_view-rendering-levels_gles3 rendering_levels.c common.c) @@ -10,4 +14,6 @@ piglit_add_executable(arb_texture_view-sampling-2d-array-as-cubemap-array_gles3 piglit_add_executable(arb_texture_view-formats_gles3 formats.c common.c) piglit_add_executable(arb_texture_view-queries_gles3 queries.c) piglit_add_executable(arb_texture_view-targets_gles3 targets.c common.c) +piglit_add_executable(arb_texture_view-texsubimage-layers_gles3 texsubimage-layers.c common.c) +piglit_add_executable(arb_texture_view-texsubimage-levels_gles3 texsubimage-levels.c common.c) piglit_add_executable(arb_texture_view-texture-immutable-levels_gles3 texture-immutable-levels.c) diff --git a/tests/spec/arb_texture_view/clear-into-view-2d-array.c b/tests/spec/arb_texture_view/clear-into-view-2d-array.c index 4ab68b1c5..1628bbf7b 100644 --- a/tests/spec/arb_texture_view/clear-into-view-2d-array.c +++ b/tests/spec/arb_texture_view/clear-into-view-2d-array.c @@ -35,6 +35,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN config.supports_gl_compat_version = 30; + config.supports_gl_es_version = 31; config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE; config.khr_no_error_support = PIGLIT_NO_ERRORS; @@ -60,7 +61,11 @@ piglit_init(int argc, char **argv) int i, j; bool pass = true; +#ifdef PIGLIT_USE_OPENGL piglit_require_extension("GL_ARB_texture_view"); +#else + piglit_require_extension("GL_OES_texture_view"); +#endif /* build a 2d array texture; no mip levels */ glGenTextures(1, ); diff --git a/tests/spec/arb_texture_view/clear-into-view-2d.c b/tests/spec/arb_texture_view/clear-into-view-2d.c index cdb605972..d03323a5d 100644 --- a/tests/spec/arb_texture_view/clear-into-view-2d.c +++ b/tests/spec/arb_texture_view/clear-into-view-2d.c @@ -35,6 +35,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN config.supports_gl_compat_version = 30; + config.supports_gl_es_version = 31; config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE; config.khr_no_error_support = PIGLIT_NO_ERRORS; @@ -59,7 +60,11 @@ piglit_init(int argc, char **argv) int i, j; bool pass = true; +#ifdef PIGLIT_USE_OPENGL piglit_require_extension("GL_ARB_texture_view"); +#else + piglit_require_extension("GL_OES_texture_view"); +#endif /* build a 2d array texture; no mip levels */ glGenTextures(1, ); diff --git a/tests/spec/arb_texture_view/clear-into-view-layered.c b/tests/spec/arb_texture_view/clear-into-view-layered.c index b134d7d44..895c71adf 100644 --- a/tests/spec/arb_texture_view/clear-into-view-layered.c +++ b/tests/spec/arb_texture_view/clear-into-view-layered.c @@ -35,6 +35,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN config.supports_gl_core_version = 32; /* for layered rendering */ + config.supports_gl_es_version = 31; config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE; config.khr_no_error_support = PIGLIT_NO_ERRORS; @@ -59,7 +60,11 @@ piglit_init(int argc, char **argv) int i, j; bool pass = true; +#ifdef PIGLIT_USE_OPENGL
Re: [Piglit] [PATCH 1/4] framework: ensure that all tests are run before exiting
On 2018-05-09 07:38 PM, Dylan Baker wrote: > Quoting Michel Dänzer (2018-05-09 02:33:13) >> On 2018-05-08 11:27 PM, Dylan Baker wrote: >> >> The bigger remaining issue is that --process-isolation false gpu takes >> almost twice as long as it did before >> 9461d92301e72807eba4776a16a05207e3a16477. > > Is it running significantly more tests? Still fewer actually, because it's using a smaller random subset of the generated vs_in tests now. > Can you provide all of the options you're using? I just want to make sure I > can > track down any other issues that I haven't run into because we don't use those > options. I provided the full command line in another post: ./piglit run -x basic-arithmetic-uvec2-texture2d -x glx-multithread-texture --process-isolation false gpu -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer signature.asc Description: OpenPGP digital signature ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 00/35] Serialize profiles into XML at build time
On 2018-05-10 03:08 AM, Matt Turner wrote: > On Tue, May 8, 2018 at 7:07 AM, Michel Dänzerwrote: >> On 2018-05-07 06:49 PM, Michel Dänzer wrote: >>> On 2018-05-07 06:44 PM, Dylan Baker wrote: Quoting Tomi Sarvela (2018-05-07 01:20:46) > > piglit/framework$ diff -c profile.py.orig profile.py > *** profile.py.orig 2018-05-07 19:11:37.649994643 +0300 > --- profile.py 2018-05-07 19:11:46.880994608 +0300 > *** > *** 584,591 ># more code, and adding side-effects >test_list = (x for x in test_list if filterby(x)) > > ! pool.imap(lambda pair: test(pair[0], pair[1], profile, pool), > ! test_list, chunksize) > >def run_profile(profile, test_list): >"""Run an individual profile.""" > --- 584,591 ># more code, and adding side-effects >test_list = (x for x in test_list if filterby(x)) > > ! pool.map(lambda pair: test(pair[0], pair[1], profile, pool), > ! test_list, chunksize) > >def run_profile(profile, test_list): >"""Run an individual profile.""" > > > Tomi Juan, can you test this patch and see if it resolves your issue as well? I'm not sure why this is fixing things, but if it does I'm happy to merge it and deal with any performance problems it introduces later. >>> >>> FWIW, this patch doesn't fix the gpu profile running a lot fewer tests >>> now than it did before 9461d92301e72807eba4776a16a05207e3a16477. I'm >>> also using -x. >> >> I just bisected another problem to >> 9461d92301e72807eba4776a16a05207e3a16477: The xts-render profile doesn't >> work anymore. Most of the time, it doesn't even start: >> >> [000/480] >> Traceback (most recent call last): >> File "./piglit", line 178, in >> main() >> File "./piglit", line 174, in main >> sys.exit(runner(args)) >> File "/home/daenzer/src/piglit-git/piglit/framework/exceptions.py", line >> 51, in _inner >> func(*args, **kwargs) >> File "/home/daenzer/src/piglit-git/piglit/framework/programs/run.py", line >> 370, in run >> backend.finalize({'time_elapsed': time_elapsed.to_json()}) >> File "/home/daenzer/src/piglit-git/piglit/framework/backends/json.py", >> line 163, in finalize >> assert data['tests'] >> AssertionError >> >> Sometimes, it doesn't fail like this, but only runs between 0 and another >> number < 480 of tests. Very rarely, it manages to run all tests. >> >> (I'm using python 3.6 now) >> >> >> Dylan, since a number of issues have been reported to have started with >> this commit, and you don't seem to have an idea what's wrong with it, >> can you revert it and anything depending on it for the time being? I'll >> be happy to test against the issues I've run into when you're ready to >> try again. > > Do you think that is a good workflow? (Serious question) Who said anything about "workflow"? It's just damage control. I did say it would suck. Would a single change causing multiple regressions be tolerated for so long if any of the regressions affected the Intel CI? > Dylan's patches were on the list for three weeks and I think only one > person (Rafael) tested them. It doesn't make sense to me to > significantly increase the burden on the person writing the code (by > reverting all the patches when a problem is found) in exchange for a > promise to test the patches... which you or anyone else could have > done during the three weeks Dylan was practically begging for testers. > > It's frustrating for me, just as an observer, to see that not even the > people who have so loudly complained about the lack of this very > feature could be bothered to try it out. I don't know what you mean by "this very feature", but I don't remember ever "complaining loudly" about the lack of any feature in piglit, so I guess I'm not one of those people. Anyway, these patches weren't on my radar; I had no idea they might cause such issues, and I certainly don't have the bandwidth to even look at all piglit patches (not that it would make any difference when it comes to Python), let alone test them. Does that mean I can't report any issues I run into? -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit