[Piglit] [PATCH] gl-3.0: test glUniform*ui{v} functions are compiled into display lists
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78097 --- tests/opengl.py | 2 + tests/spec/gl-3.0/CMakeLists.gl.txt | 1 + tests/spec/gl-3.0/dlist-uint-uniforms.c | 305 3 files changed, 308 insertions(+) create mode 100644 tests/spec/gl-3.0/dlist-uint-uniforms.c diff --git a/tests/opengl.py b/tests/opengl.py index 347e8c5d4..9c43d32c9 100644 --- a/tests/opengl.py +++ b/tests/opengl.py @@ -899,6 +899,8 @@ with profile.test_list.group_manager( g(['clearbuffer-invalid-buffer']) g(['clearbuffer-mixed-format']) g(['clearbuffer-stencil']) +g(['gl-3.0-dlist-uint-uniforms'], + 'dlist-uint-uniforms') g(['genmipmap-errors']) g(['getfragdatalocation']) g(['integer-errors']) diff --git a/tests/spec/gl-3.0/CMakeLists.gl.txt b/tests/spec/gl-3.0/CMakeLists.gl.txt index 6e9635c9c..e9bcb3627 100644 --- a/tests/spec/gl-3.0/CMakeLists.gl.txt +++ b/tests/spec/gl-3.0/CMakeLists.gl.txt @@ -9,6 +9,7 @@ link_libraries ( ) piglit_add_executable (gl-3.0-bound-resource-limits bound-resource-limits.c) +piglit_add_executable (gl-3.0-dlist-uint-uniforms dlist-uint-uniforms.c) piglit_add_executable (gl-3.0-multidrawarrays-vertexid multidrawarrays-vertexid.c) piglit_add_executable (gl-3.0-minmax minmax.c) piglit_add_executable (gl-3.0-render-integer render-integer.c) diff --git a/tests/spec/gl-3.0/dlist-uint-uniforms.c b/tests/spec/gl-3.0/dlist-uint-uniforms.c new file mode 100644 index 0..b1f52c98c --- /dev/null +++ b/tests/spec/gl-3.0/dlist-uint-uniforms.c @@ -0,0 +1,305 @@ +/* + * 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. + */ + +/** + * Verify that unsigned glUniform* commands added in GL 3.0 are compiled into + * display lists. + * + * This test is adapted from tests/spec/arb_separate_shader_objects/dlist.c + */ +#include "piglit-util-gl.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + /* No supports_gl_core_version setting because there are no display +* lists in core profile. +*/ + config.supports_gl_compat_version = 30; + config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA; + config.khr_no_error_support = PIGLIT_NO_ERRORS; + +PIGLIT_GL_TEST_CONFIG_END + +static bool Uniformui(void); + +void +piglit_init(int argc, char **argv) +{ + unsigned glsl_version; + bool pass = true; + + pass = Uniformui() && pass; + + piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL); +} + +enum mode { + set_scalar, + set_vector, + get_and_compare +}; + +#define UINT_UNIFORM(type, n, suffix) \ + do {\ + type inbuf[n]; \ + type outbuf[n]; \ + unsigned jjj; \ + \ + for (jjj = 0; jjj < n; jjj++) \ + outbuf[jjj] = (type) value++; \ + \ + switch (m) {\ + case set_scalar:\ + switch (n) {\ + case 1: \ + glUniform1 ## suffix\ + (loc, \ +outbuf[0]);\ + break; \ + case 2: \ + glUniform2 ## suffix\ + (loc,
Re: [Piglit] [PATCH 00/35] Serialize profiles into XML at build time
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) 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. ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH v2] ext_packed_float: Add a test that queries GL_RGBA_SIGNED_COMPONENTS_EXT
Reviewed-by: Brian PaulThanks, Timothy! On 05/09/2018 05:52 PM, Timothy Arceri wrote: From: Bruce Merry V2 (Timothy Arceri): - use piglit_get_gl_enum_name() - use ARRAY_SIZE() - set config.khr_no_error_support Cc: Brian Paul Bugzilla: https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.freedesktop.org_show-5Fbug.cgi-3Fid-3D73096=DwIBAQ=uilaK90D4TOVoH58JNXRgQ=Ie7_encNUsqxbSRbqbNgofw0ITcfE8JKfaUjIQhncGA=sTpUQmyOGL91bvssjpEHJtUmlOt4TnqBYzGCTQ-2AjI=Uwftee8YPacZLs7kLj4tq-aSShze4d26ueEaOGzX5fg= --- tests/opengl.py | 1 + tests/spec/ext_packed_float/CMakeLists.gl.txt | 1 + .../query-rgba-signed-components.c| 162 ++ 3 files changed, 164 insertions(+) create mode 100644 tests/spec/ext_packed_float/query-rgba-signed-components.c diff --git a/tests/opengl.py b/tests/opengl.py index 825e0bf83..347e8c5d4 100644 --- a/tests/opengl.py +++ b/tests/opengl.py @@ -3175,6 +3175,7 @@ with profile.test_list.group_manager( PiglitGLTest, grouptools.join('spec', 'ext_packed_float')) as g: g(['ext_packed_float-pack'], 'pack') +g(['query-rgba-signed-components'], 'query-rgba-signed-components') g(['getteximage-invalid-format-for-packed-type'], 'getteximage-invalid-format-for-packed-type') add_msaa_formats_tests(g, 'GL_EXT_packed_float') diff --git a/tests/spec/ext_packed_float/CMakeLists.gl.txt b/tests/spec/ext_packed_float/CMakeLists.gl.txt index 44a8818c8..b061cb6b2 100644 --- a/tests/spec/ext_packed_float/CMakeLists.gl.txt +++ b/tests/spec/ext_packed_float/CMakeLists.gl.txt @@ -10,5 +10,6 @@ link_libraries ( piglit_add_executable (ext_packed_float-pack pack.c) piglit_add_executable (getteximage-invalid-format-for-packed-type getteximage-invalid-format-for-packed-type.c) +piglit_add_executable (query-rgba-signed-components query-rgba-signed-components.c) # vim: ft=cmake: diff --git a/tests/spec/ext_packed_float/query-rgba-signed-components.c b/tests/spec/ext_packed_float/query-rgba-signed-components.c new file mode 100644 index 0..f5c0047fa --- /dev/null +++ b/tests/spec/ext_packed_float/query-rgba-signed-components.c @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2013 Bruce Merry + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 + * NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COYPRIGTH + * HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "piglit-util-gl.h" + +typedef struct { + GLenum format; + const char *extension; + int expected[4]; + int buffer; /* Draw buffer to attach the renderbuffer to */ +} format_info; + +static const format_info formats[] = { + { GL_RGBA8, NULL, { 0, 0, 0, 0 } }, + { GL_R8I, "GL_ARB_texture_rg", { 1, 0, 0, 0 } }, + { GL_RG8I, "GL_ARB_texture_rg", { 1, 1, 0, 0 } }, + { GL_R8_SNORM, "GL_EXT_texture_snorm", { 1, 0, 0, 0 } }, + { GL_LUMINANCE8_SNORM, "GL_EXT_texture_snorm", { 1, 1, 1, 0 } }, + { GL_RGBA8UI_EXT, "GL_EXT_texture_integer", { 0, 0, 0, 0 } }, + { GL_RGBA16F_ARB, "GL_ARB_texture_float", { 1, 1, 1, 1 } }, + { GL_LUMINANCE16F_ARB, "GL_ARB_texture_float", { 1, 1, 1, 0 } }, + { GL_RGB9_E5_EXT, "GL_EXT_texture_shared_exponent", { 0, 0, 0, 0 } }, + { GL_R11F_G11F_B10F_EXT, "GL_EXT_packed_float", { 0, 0, 0, 0 } }, + { GL_RGBA16F_ARB, "GL_ARB_texture_float", { 0, 0, 0, 0 }, 1 } +}; + +PIGLIT_GL_TEST_CONFIG_BEGIN + config.supports_gl_compat_version = 10; + config.window_visual = PIGLIT_GL_VISUAL_RGB; + config.khr_no_error_support = PIGLIT_NO_ERRORS; +PIGLIT_GL_TEST_CONFIG_END + +enum piglit_result +piglit_display(void) +{ + /* Should never be reached */ + return PIGLIT_FAIL; +} + +/* Queries GL_RGBA_SIGNED_COMPONENTS_EXT and compares to expected. + * If they do not match, prints an error. Returns true on match. + */ +static bool check_rgba_signed(const int *expected) +{ +
[Piglit] [PATCH v2] ext_packed_float: Add a test that queries GL_RGBA_SIGNED_COMPONENTS_EXT
From: Bruce MerryV2 (Timothy Arceri): - use piglit_get_gl_enum_name() - use ARRAY_SIZE() - set config.khr_no_error_support Cc: Brian Paul Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73096 --- tests/opengl.py | 1 + tests/spec/ext_packed_float/CMakeLists.gl.txt | 1 + .../query-rgba-signed-components.c| 162 ++ 3 files changed, 164 insertions(+) create mode 100644 tests/spec/ext_packed_float/query-rgba-signed-components.c diff --git a/tests/opengl.py b/tests/opengl.py index 825e0bf83..347e8c5d4 100644 --- a/tests/opengl.py +++ b/tests/opengl.py @@ -3175,6 +3175,7 @@ with profile.test_list.group_manager( PiglitGLTest, grouptools.join('spec', 'ext_packed_float')) as g: g(['ext_packed_float-pack'], 'pack') +g(['query-rgba-signed-components'], 'query-rgba-signed-components') g(['getteximage-invalid-format-for-packed-type'], 'getteximage-invalid-format-for-packed-type') add_msaa_formats_tests(g, 'GL_EXT_packed_float') diff --git a/tests/spec/ext_packed_float/CMakeLists.gl.txt b/tests/spec/ext_packed_float/CMakeLists.gl.txt index 44a8818c8..b061cb6b2 100644 --- a/tests/spec/ext_packed_float/CMakeLists.gl.txt +++ b/tests/spec/ext_packed_float/CMakeLists.gl.txt @@ -10,5 +10,6 @@ link_libraries ( piglit_add_executable (ext_packed_float-pack pack.c) piglit_add_executable (getteximage-invalid-format-for-packed-type getteximage-invalid-format-for-packed-type.c) +piglit_add_executable (query-rgba-signed-components query-rgba-signed-components.c) # vim: ft=cmake: diff --git a/tests/spec/ext_packed_float/query-rgba-signed-components.c b/tests/spec/ext_packed_float/query-rgba-signed-components.c new file mode 100644 index 0..f5c0047fa --- /dev/null +++ b/tests/spec/ext_packed_float/query-rgba-signed-components.c @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2013 Bruce Merry + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 + * NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COYPRIGTH + * HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "piglit-util-gl.h" + +typedef struct { + GLenum format; + const char *extension; + int expected[4]; + int buffer; /* Draw buffer to attach the renderbuffer to */ +} format_info; + +static const format_info formats[] = { + { GL_RGBA8, NULL, { 0, 0, 0, 0 } }, + { GL_R8I, "GL_ARB_texture_rg", { 1, 0, 0, 0 } }, + { GL_RG8I, "GL_ARB_texture_rg", { 1, 1, 0, 0 } }, + { GL_R8_SNORM, "GL_EXT_texture_snorm", { 1, 0, 0, 0 } }, + { GL_LUMINANCE8_SNORM, "GL_EXT_texture_snorm", { 1, 1, 1, 0 } }, + { GL_RGBA8UI_EXT, "GL_EXT_texture_integer", { 0, 0, 0, 0 } }, + { GL_RGBA16F_ARB, "GL_ARB_texture_float", { 1, 1, 1, 1 } }, + { GL_LUMINANCE16F_ARB, "GL_ARB_texture_float", { 1, 1, 1, 0 } }, + { GL_RGB9_E5_EXT, "GL_EXT_texture_shared_exponent", { 0, 0, 0, 0 } }, + { GL_R11F_G11F_B10F_EXT, "GL_EXT_packed_float", { 0, 0, 0, 0 } }, + { GL_RGBA16F_ARB, "GL_ARB_texture_float", { 0, 0, 0, 0 }, 1 } +}; + +PIGLIT_GL_TEST_CONFIG_BEGIN + config.supports_gl_compat_version = 10; + config.window_visual = PIGLIT_GL_VISUAL_RGB; + config.khr_no_error_support = PIGLIT_NO_ERRORS; +PIGLIT_GL_TEST_CONFIG_END + +enum piglit_result +piglit_display(void) +{ + /* Should never be reached */ + return PIGLIT_FAIL; +} + +/* Queries GL_RGBA_SIGNED_COMPONENTS_EXT and compares to expected. + * If they do not match, prints an error. Returns true on match. + */ +static bool check_rgba_signed(const int *expected) +{ + int i; + /* Start with nonsense values, to ensure they are written */ + GLint actual[4] = {2, 2, 2, 2}; + + glGetIntegerv(GL_RGBA_SIGNED_COMPONENTS_EXT, actual); + if (!piglit_check_gl_error(GL_NO_ERROR)) { + return false; + } + + for (i = 0; i < 4; i++) { + if (expected[i] !=
Re: [Piglit] [PATCH] ext_packed_float: Add a test that queries GL_RGBA_SIGNED_COMPONENTS_EXT
On 10/05/18 03:36, Bruce Merry wrote: Hi I'm afraid it's been about 4 years since I last did any OpenGL work. Realistically I don't think that rebasing this is going to make it to the top of my priority stack any time soon. Apologies for abandoning it. Not a problem I'll get this over the line :) Thanks for writing test and reporting the bug. Tim Bruce On 9 May 2018 at 18:44, Brian Paulwrote: Minor things below. -Brian On 05/09/2018 12:13 AM, Timothy Arceri wrote: From: Bruce Merry Cc: Brian Paul Bugzilla: https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.freedesktop.org_show-5Fbug.cgi-3Fid-3D73096=DwIBAQ=uilaK90D4TOVoH58JNXRgQ=Ie7_encNUsqxbSRbqbNgofw0ITcfE8JKfaUjIQhncGA=K7EzhJILOr1w_DQt9GuR7_BVUkIV83zFlObLq3eo-Rk=av-uP6XeQB05-iaIJnhRtBPNizb9NRb-1e_J5oSQu94= --- I came across this test when cleaning up bugzilla. Seems we fixed Mesa but never pushed the piglit test. tests/all.py | 1 + tests/spec/ext_packed_float/CMakeLists.gl.txt | 1 + .../query-rgba-signed-components.c| 167 ++ 3 files changed, 169 insertions(+) create mode 100644 tests/spec/ext_packed_float/query-rgba-signed-components.c diff --git a/tests/all.py b/tests/all.py index 26638cd82..db85f172e 100644 --- a/tests/all.py +++ b/tests/all.py This will need to be rebased on ToT since all.py is gone. @@ -3331,6 +3331,7 @@ with profile.test_list.group_manager( PiglitGLTest, grouptools.join('spec', 'ext_packed_float')) as g: g(['ext_packed_float-pack'], 'pack') +g(['query-rgba-signed-components'], 'query-rgba-signed-components') g(['getteximage-invalid-format-for-packed-type'], 'getteximage-invalid-format-for-packed-type') add_msaa_formats_tests(g, 'GL_EXT_packed_float') diff --git a/tests/spec/ext_packed_float/CMakeLists.gl.txt b/tests/spec/ext_packed_float/CMakeLists.gl.txt index 44a8818c8..b061cb6b2 100644 --- a/tests/spec/ext_packed_float/CMakeLists.gl.txt +++ b/tests/spec/ext_packed_float/CMakeLists.gl.txt @@ -10,5 +10,6 @@ link_libraries ( piglit_add_executable (ext_packed_float-pack pack.c) piglit_add_executable (getteximage-invalid-format-for-packed-type getteximage-invalid-format-for-packed-type.c) +piglit_add_executable (query-rgba-signed-components query-rgba-signed-components.c) # vim: ft=cmake: diff --git a/tests/spec/ext_packed_float/query-rgba-signed-components.c b/tests/spec/ext_packed_float/query-rgba-signed-components.c new file mode 100644 index 0..635d5bc5a --- /dev/null +++ b/tests/spec/ext_packed_float/query-rgba-signed-components.c @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2013 Bruce Merry + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 + * NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COYPRIGTH + * HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "piglit-util-gl.h" + +#define MAKE_FORMAT_STR(x) x, #x + +typedef struct { + GLenum format; + const char *format_str; + const char *extension; + int expected[4]; + int buffer; /* Draw buffer to attach the renderbuffer to */ +} format_info; + +static const format_info formats[] = { + { MAKE_FORMAT_STR(GL_RGBA8), NULL, { 0, 0, 0, 0 } }, We can rm the MAKE_FORMAT_STR stuff now and use piglit_get_gl_enum_name(). + { MAKE_FORMAT_STR(GL_R8I), "GL_ARB_texture_rg", { 1, 0, 0, 0 } }, + { MAKE_FORMAT_STR(GL_RG8I), "GL_ARB_texture_rg", { 1, 1, 0, 0 } }, + { MAKE_FORMAT_STR(GL_R8_SNORM), "GL_EXT_texture_snorm", { 1, 0, 0, 0 } }, + { MAKE_FORMAT_STR(GL_LUMINANCE8_SNORM), "GL_EXT_texture_snorm", { 1, 1, 1, 0 } }, + { MAKE_FORMAT_STR(GL_RGBA8UI_EXT), "GL_EXT_texture_integer", { 0, 0, 0, 0 } }, + { MAKE_FORMAT_STR(GL_RGBA16F_ARB), "GL_ARB_texture_float", { 1, 1, 1, 1 } }, + { MAKE_FORMAT_STR(GL_LUMINANCE16F_ARB), "GL_ARB_texture_float", { 1, 1, 1, 0 } }, + {
[Piglit] [PATCH 1/2] Fix bogus assertions in builtin uniform test generator.
self.test_rows is measured in a number of 4x4 rectangles, but y is measured in pixels, so they are not comparable. The only reason this doesn't trip is because self.test_rows is currently the number of 4x4 rectangles that can fit in a 250x250 window (62)...and no test has nearly that many rows of rectangles. Instead, just assert y fits in the window height. --- generated_tests/gen_builtin_uniform_tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generated_tests/gen_builtin_uniform_tests.py b/generated_tests/gen_builtin_uniform_tests.py index 50cced444..ac09a64fc 100644 --- a/generated_tests/gen_builtin_uniform_tests.py +++ b/generated_tests/gen_builtin_uniform_tests.py @@ -386,7 +386,7 @@ class ShaderTest(object): def draw_command(self, test_num): x = (test_num % self.tests_per_row) * self.rect_width y = (test_num // self.tests_per_row) * self.rect_height -assert(y < self.test_rows) +assert(y + self.rect_height <= self.win_height) return 'draw rect ortho {0} {1} {2} {3}\n'.format(x, y, self.rect_width, self.rect_height) @@ -662,7 +662,7 @@ class TessellationShaderTest(ShaderTest): def draw_command(self, test_num): x = (test_num % self.tests_per_row) * self.rect_width y = (test_num // self.tests_per_row) * self.rect_height -assert(y < self.test_rows) +assert(y + self.rect_height <= self.win_height) return 'draw rect ortho patch {0} {1} {2} {3}\n'.format(x, y, self.rect_width, self.rect_height) -- 2.17.0 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 2/2] Specify an explicit window size in builtin uniform tests.
Currently, these tests assume a 250x250 window size, but don't specify SIZE 250x250, which means they can break when using PIGLIT_DEFAULT_SIZE. The tests draw multiple 4x4 rectangles side by side, and lay them out based on the window size. We bump the window width to 256 so that it's a multiple of 4, and shrink y to fit the number of rows. --- generated_tests/gen_builtin_uniform_tests.py | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/generated_tests/gen_builtin_uniform_tests.py b/generated_tests/gen_builtin_uniform_tests.py index ac09a64fc..8001f7123 100644 --- a/generated_tests/gen_builtin_uniform_tests.py +++ b/generated_tests/gen_builtin_uniform_tests.py @@ -48,6 +48,7 @@ from __future__ import print_function, division, absolute_import from builtin_function import * import abc import numpy +import math import optparse import os import os.path @@ -357,15 +358,14 @@ class ShaderTest(object): # Size of the rectangles drawn by the test. self.rect_width = 4 self.rect_height = 4 -# shader_runner currently defaults to a 250x250 window. We -# could reduce window size to cut test time, but there are -# platform-dependent limits we haven't really characterized -# (smaller on Linux than Windows, but still present in some -# window managers). -self.win_width = 250 -self.win_height = 250 + +# Use a 256xN window. Make it at least 160 pixels tall to avoid +# window manager issues with small window sizes (see comments in +# piglit_gl_test_config_init() for details). +self.win_width = 256 self.tests_per_row = (self.win_width // self.rect_width) -self.test_rows = (self.win_height // self.rect_height) +self.test_rows = math.ceil(len(test_vectors) / self.tests_per_row) +self.win_height = max(self.test_rows * self.rect_height, 160) if use_if: self._comparator = BoolIfComparator(signature) @@ -560,6 +560,7 @@ class ShaderTest(object): shader_test = '[require]\n' shader_test += 'GLSL >= {0:1.2f}\n'.format( float(self.glsl_version()) / 100) +shader_test += 'SIZE {0}x{1}'.format(self.win_width, self.win_height) for extension in self.extensions(): shader_test += 'GL_{}\n'.format(extension) shader_test += self.make_additional_requirements() -- 2.17.0 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 2/3] tests: rename shader_*_multi to shader_*.no_isolation
This allows the --process-isolation flag to control these profiles and load the correct one, as enabled by the previous patch. --- tests/CMakeLists.no_api.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.no_api.txt b/tests/CMakeLists.no_api.txt index a3542d2f7..632c6786a 100644 --- a/tests/CMakeLists.no_api.txt +++ b/tests/CMakeLists.no_api.txt @@ -68,8 +68,8 @@ piglit_generate_xml(glslparser glslparser gen-gl-gen-xml "" gen-gl-tests static- piglit_generate_xml(glslparser_arb_compat glslparser gen-gl-gen-xml "--glsl-arb-compat" gen-gl-tests static-glslparser-tests static-asmparser-tests) piglit_generate_xml(shader shader gen-gl-gen-xml "" gen-gl-tests static-shader-tests) piglit_generate_xml(quick_shader quick_shader gen-gl-gen-xml "" gen-gl-tests static-shader-tests) -piglit_generate_xml(shader_multi shader gen-gl-gen-xml "--no-process-isolation" gen-gl-tests static-shader-tests) -piglit_generate_xml(quick_shader_multi quick_shader gen-gl-gen-xml "--no-process-isolation" gen-gl-tests static-shader-tests) +piglit_generate_xml(shader.no_isolation shader gen-gl-gen-xml "--no-process-isolation" gen-gl-tests static-shader-tests) +piglit_generate_xml(quick_shader.no_isolation quick_shader gen-gl-gen-xml "--no-process-isolation" gen-gl-tests static-shader-tests) piglit_generate_xml(no_error no_error gen-gl-gen-xml "" gen-gl-tests static-shader-tests) add_custom_target(gen-cl-xml) -- 2.17.0 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 3/3] tests: Add gpu and quick no_isolation metaprofiles
Even without these --process-isolation works as expected, but these improve runtime (for me by almost a minute) by putting the tests in a more optimal order. This is a very cheap optimization. --- tests/gpu.no_isolation.meta.xml | 11 +++ tests/quick.no_isolation.meta.xml | 6 ++ 2 files changed, 17 insertions(+) create mode 100644 tests/gpu.no_isolation.meta.xml create mode 100644 tests/quick.no_isolation.meta.xml diff --git a/tests/gpu.no_isolation.meta.xml b/tests/gpu.no_isolation.meta.xml new file mode 100644 index 0..f26a3027b --- /dev/null +++ b/tests/gpu.no_isolation.meta.xml @@ -0,0 +1,11 @@ + + + + quick_shader.no_isolation + quick_gl + diff --git a/tests/quick.no_isolation.meta.xml b/tests/quick.no_isolation.meta.xml new file mode 100644 index 0..11d37863d --- /dev/null +++ b/tests/quick.no_isolation.meta.xml @@ -0,0 +1,6 @@ + + + quick_shader.no_isolation + quick_gl + glslparser + -- 2.17.0 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 1/3] profile: add the idea of process-isolated xml file
This adds a new name.no_process.xml (or .meta.xml) file that is loaded when --process-isolation=false is used. --- framework/profile.py | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/framework/profile.py b/framework/profile.py index aff0ffa2c..ffc91e0a6 100644 --- a/framework/profile.py +++ b/framework/profile.py @@ -56,6 +56,7 @@ from framework.test.piglit_test import ( ) from framework.test.shader_test import ShaderTest, MultiShaderTest from framework.test.glsl_parser_test import GLSLParserTest +from framework.options import OPTIONS __all__ = [ 'RegexFilter', @@ -552,8 +553,22 @@ def load_test_profile(filename, python=None): module. If True, then only python is tried, if False then only XML is tried. """ -name = os.path.splitext(os.path.basename(filename))[0] +name, ext = os.path.splitext(os.path.basename(filename)) +if ext == '.no_isolation': +name = filename + if not python: +# If process-isolation is false then try to load a profile named +# {name}.no_isolation instead. This is only valid for xml based +# profiles. +if ext != '.no_isolation' and not OPTIONS.process_isolation: +try: +return load_test_profile(name + '.no_isolation' + ext, python) +except exceptions.PiglitFatalError: +# There might not be a .no_isolation version, try to load the +# regular version in that case. +pass + meta = os.path.join(ROOT_DIR, 'tests', name + '.meta.xml') if os.path.exists(meta): return MetaProfile(meta) -- 2.17.0 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH v4] tests: add nvidia conservative rasterization tests
Ping I guess? On Fri, Mar 30, 2018 at 10:56 PM, Rhys Perrywrote: > 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', 'NV_conservative_raster_pre_snap_triangles')) > as g: > +g(['nv_conservative_raster_pre_snap_triangles-draw'], 'draw') > + > if platform.system() is 'Windows': > profile.filters.append(lambda p, _: not p.startswith('glx')) > diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt > index dc14beb4e..a0bc845c5 100644 > --- a/tests/spec/CMakeLists.txt > +++ b/tests/spec/CMakeLists.txt > @@ -101,6 +101,9 @@ add_subdirectory (ext_texture_swizzle) > add_subdirectory (ext_timer_query) > add_subdirectory (ext_transform_feedback) > add_subdirectory (nv_conditional_render) > +add_subdirectory (nv_conservative_raster) > +add_subdirectory (nv_conservative_raster_dilate) > +add_subdirectory (nv_conservative_raster_pre_snap_triangles) > add_subdirectory (nv_fill_rectangle) > add_subdirectory (nv_image_formats) > add_subdirectory (nv_texture_barrier) > diff --git a/tests/spec/nv_conservative_raster/CMakeLists.gl.txt > b/tests/spec/nv_conservative_raster/CMakeLists.gl.txt > new file mode 100644 > index 0..5f632c864 > --- /dev/null > +++ b/tests/spec/nv_conservative_raster/CMakeLists.gl.txt > @@ -0,0 +1,13 @@ > +include_directories( > + ${GLEXT_INCLUDE_DIR} > + ${OPENGL_INCLUDE_PATH}
Re: [Piglit] [PATCH 1/4] framework: ensure that all tests are run before exiting
Quoting Michel Dänzer (2018-05-09 02:33:13) > On 2018-05-08 11:27 PM, Dylan Baker wrote: > > Michel, does this series fix the remaining issues you're seeing? > > It mostly fixes the gpu profile running fewer tests than before. The > only remaining minor issue there is that the > shaders@glsl-{fs,vs}-{inline,unroll}-explosion tests were previously > accurately listed as "crash" in the summary, now it's "notrun". > > Tested-by: Michel Dänzer> > > The bigger remaining issue is that --process-isolation false gpu takes > almost twice as long as it did before > 9461d92301e72807eba4776a16a05207e3a16477. 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. Dylan > > > -- > Earthling Michel Dänzer | http://www.amd.com > Libre software enthusiast | Mesa and X developer > signature.asc Description: signature ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 1/4] framework: ensure that all tests are run before exiting
Quoting Michel Dänzer (2018-05-09 02:33:13) > On 2018-05-08 11:27 PM, Dylan Baker wrote: > > Michel, does this series fix the remaining issues you're seeing? > > It mostly fixes the gpu profile running fewer tests than before. The > only remaining minor issue there is that the > shaders@glsl-{fs,vs}-{inline,unroll}-explosion tests were previously > accurately listed as "crash" in the summary, now it's "notrun". That's odd, the filtering of tests that have '-explosion' in the name has been in quick.py for a *long* time, since they can take a long time to run, and gpu is quick.py without glslparser tests. > > Tested-by: Michel Dänzer> > > 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? When I run the two profiles I see 2 different tests, and that master takes ~1 minute longer to run. I'm thinking about how I could reduce the runtime without hurting startup time or exploding the memory usage. I'll make the process-isolation flag work again too. Dylan signature.asc Description: signature ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] framework: fix running with mixed concurrency (neither -c or -1)
Quoting Arkadiusz Hiler (2018-05-09 03:56:53) > On Tue, May 08, 2018 at 10:32:26AM -0700, Dylan Baker wrote: > > test_list is an iterator, you can't walk an iterator more than once. To > > solve this we use itertools.tee, which creates a shared buffer for the > > iterators to draw from. This fixes errors like: > > > > [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/user/piglit/framework/exceptions.py", line 51, in _inner > > func(*args, **kwargs) > > File "/home/user/piglit/framework/programs/run.py", line 370, in run > > backend.finalize({'time_elapsed': time_elapsed.to_json()}) > > File "/home/user/piglit/framework/backends/json.py", line 163, in finalize > > assert data['tests'] > > AssertionError > > > > Thanks Tomi for figuring out what was wrong with the original patch! > > > > CC: Michel Dänzer> > CC: Tomi Sarvela > > CC: "Juan A. Suarez Romero" > > Oh, just noticed that (well, actually Tomi told me about this). > > I've sent another patch which fixes the same issue in a slightly > different way. Sorry for the duplication! No worries! It's nice that there's other people looking at the framework besides me :) Dylan signature.asc Description: signature ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] ext_packed_float: Add a test that queries GL_RGBA_SIGNED_COMPONENTS_EXT
Minor things below. -Brian On 05/09/2018 12:13 AM, Timothy Arceri wrote: From: Bruce MerryCc: Brian Paul Bugzilla: https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.freedesktop.org_show-5Fbug.cgi-3Fid-3D73096=DwIBAQ=uilaK90D4TOVoH58JNXRgQ=Ie7_encNUsqxbSRbqbNgofw0ITcfE8JKfaUjIQhncGA=K7EzhJILOr1w_DQt9GuR7_BVUkIV83zFlObLq3eo-Rk=av-uP6XeQB05-iaIJnhRtBPNizb9NRb-1e_J5oSQu94= --- I came across this test when cleaning up bugzilla. Seems we fixed Mesa but never pushed the piglit test. tests/all.py | 1 + tests/spec/ext_packed_float/CMakeLists.gl.txt | 1 + .../query-rgba-signed-components.c| 167 ++ 3 files changed, 169 insertions(+) create mode 100644 tests/spec/ext_packed_float/query-rgba-signed-components.c diff --git a/tests/all.py b/tests/all.py index 26638cd82..db85f172e 100644 --- a/tests/all.py +++ b/tests/all.py This will need to be rebased on ToT since all.py is gone. @@ -3331,6 +3331,7 @@ with profile.test_list.group_manager( PiglitGLTest, grouptools.join('spec', 'ext_packed_float')) as g: g(['ext_packed_float-pack'], 'pack') +g(['query-rgba-signed-components'], 'query-rgba-signed-components') g(['getteximage-invalid-format-for-packed-type'], 'getteximage-invalid-format-for-packed-type') add_msaa_formats_tests(g, 'GL_EXT_packed_float') diff --git a/tests/spec/ext_packed_float/CMakeLists.gl.txt b/tests/spec/ext_packed_float/CMakeLists.gl.txt index 44a8818c8..b061cb6b2 100644 --- a/tests/spec/ext_packed_float/CMakeLists.gl.txt +++ b/tests/spec/ext_packed_float/CMakeLists.gl.txt @@ -10,5 +10,6 @@ link_libraries ( piglit_add_executable (ext_packed_float-pack pack.c) piglit_add_executable (getteximage-invalid-format-for-packed-type getteximage-invalid-format-for-packed-type.c) +piglit_add_executable (query-rgba-signed-components query-rgba-signed-components.c) # vim: ft=cmake: diff --git a/tests/spec/ext_packed_float/query-rgba-signed-components.c b/tests/spec/ext_packed_float/query-rgba-signed-components.c new file mode 100644 index 0..635d5bc5a --- /dev/null +++ b/tests/spec/ext_packed_float/query-rgba-signed-components.c @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2013 Bruce Merry + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 + * NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COYPRIGTH + * HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "piglit-util-gl.h" + +#define MAKE_FORMAT_STR(x) x, #x + +typedef struct { + GLenum format; + const char *format_str; + const char *extension; + int expected[4]; + int buffer; /* Draw buffer to attach the renderbuffer to */ +} format_info; + +static const format_info formats[] = { + { MAKE_FORMAT_STR(GL_RGBA8), NULL, { 0, 0, 0, 0 } }, We can rm the MAKE_FORMAT_STR stuff now and use piglit_get_gl_enum_name(). + { MAKE_FORMAT_STR(GL_R8I), "GL_ARB_texture_rg", { 1, 0, 0, 0 } }, + { MAKE_FORMAT_STR(GL_RG8I), "GL_ARB_texture_rg", { 1, 1, 0, 0 } }, + { MAKE_FORMAT_STR(GL_R8_SNORM), "GL_EXT_texture_snorm", { 1, 0, 0, 0 } }, + { MAKE_FORMAT_STR(GL_LUMINANCE8_SNORM), "GL_EXT_texture_snorm", { 1, 1, 1, 0 } }, + { MAKE_FORMAT_STR(GL_RGBA8UI_EXT), "GL_EXT_texture_integer", { 0, 0, 0, 0 } }, + { MAKE_FORMAT_STR(GL_RGBA16F_ARB), "GL_ARB_texture_float", { 1, 1, 1, 1 } }, + { MAKE_FORMAT_STR(GL_LUMINANCE16F_ARB), "GL_ARB_texture_float", { 1, 1, 1, 0 } }, + { MAKE_FORMAT_STR(GL_RGB9_E5_EXT), "GL_EXT_texture_shared_exponent", { 0, 0, 0, 0 } }, + { MAKE_FORMAT_STR(GL_R11F_G11F_B10F_EXT), "GL_EXT_packed_float", { 0, 0, 0, 0 } }, + { MAKE_FORMAT_STR(GL_RGBA16F_ARB), "GL_ARB_texture_float", { 0, 0, 0, 0 }, 1 } +}; + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 10; + + config.window_visual = PIGLIT_GL_VISUAL_RGB; + +PIGLIT_GL_TEST_CONFIG_END +
Re: [Piglit] [PATCH] gl-1.5-get-array-attribs: exercise glGetIntegerv, etc. with vertex arrays
Reviewed-by: Charmaine LeeFrom: Brian Paul Sent: Wednesday, May 9, 2018 8:30:05 AM To: piglit@lists.freedesktop.org Cc: xuelian@samsung.com; Neha Bhende; Charmaine Lee; Brian Paul Subject: [PATCH] gl-1.5-get-array-attribs: exercise glGetIntegerv, etc. with vertex arrays This new test checks that glGetInteger/Fload/Double/Booleanv() return the right values when querying vertex array attributes. Currently broken in Mesa. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106450 --- tests/opengl.py | 1 + tests/spec/gl-1.5/CMakeLists.gl.txt | 1 + tests/spec/gl-1.5/get-array-attribs.c | 135 ++ 3 files changed, 137 insertions(+) create mode 100644 tests/spec/gl-1.5/get-array-attribs.c diff --git a/tests/opengl.py b/tests/opengl.py index 825e0bf..cbc4e39 100644 --- a/tests/opengl.py +++ b/tests/opengl.py @@ -801,6 +801,7 @@ with profile.test_list.group_manager( g(['draw-vertices', 'user'], 'draw-vertices-user') g(['isbufferobj']) g(['depth-tex-compare']) +g(['gl-1.5-get-array-attribs']) g(['gl-1.5-normal3b3s-invariance', 'GL_BYTE'], 'normal3b3s-invariance-byte') g(['gl-1.5-normal3b3s-invariance', 'GL_SHORT'], diff --git a/tests/spec/gl-1.5/CMakeLists.gl.txt b/tests/spec/gl-1.5/CMakeLists.gl.txt index e072757..6cc69f5 100644 --- a/tests/spec/gl-1.5/CMakeLists.gl.txt +++ b/tests/spec/gl-1.5/CMakeLists.gl.txt @@ -8,6 +8,7 @@ link_libraries ( ${OPENGL_gl_LIBRARY} ) +piglit_add_executable (gl-1.5-get-array-attribs get-array-attribs.c) piglit_add_executable (gl-1.5-normal3b3s-invariance normal3b3s-invariance.c) piglit_add_executable (gl-1.5-vertex-buffer-offsets vertex-buffer-offsets.c) diff --git a/tests/spec/gl-1.5/get-array-attribs.c b/tests/spec/gl-1.5/get-array-attribs.c new file mode 100644 index 000..6aa3c78 --- /dev/null +++ b/tests/spec/gl-1.5/get-array-attribs.c @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2018 VMware, Inc. + * + * 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 glGetInteger/Float/Double/Booleanv with vertex array attributes. + */ + +#include "piglit-util-gl.h" + + +PIGLIT_GL_TEST_CONFIG_BEGIN + config.supports_gl_compat_version = 15; + config.window_visual = PIGLIT_GL_VISUAL_RGBA; + config.khr_no_error_support = PIGLIT_NO_ERRORS; +PIGLIT_GL_TEST_CONFIG_END + + +static bool +test_get(GLenum pname, GLint expectedValue) +{ + GLint i; + GLfloat f; + GLdouble d; + GLboolean b; + bool pass = true; + + glGetIntegerv(pname, ); + glGetFloatv(pname, ); + glGetDoublev(pname, ); + glGetBooleanv(pname, ); + + if (i != expectedValue) { + printf("glGetIntegerv(%s) failed: expected %d, got %d\n", + piglit_get_gl_enum_name(pname), + expectedValue, i); + pass = false; + } + + if (f != (GLfloat) expectedValue) { + printf("glGetFloatv(%s) failed: expected %f, got %f\n", + piglit_get_gl_enum_name(pname), + (GLfloat) expectedValue, f); + pass = false; + } + + if (d != (GLdouble) expectedValue) { + printf("glGetDoublev(%s) failed: expected %f, got %f\n", + piglit_get_gl_enum_name(pname), + (GLdouble) expectedValue, f); + pass = false; + } + + if (b != (GLboolean) !!expectedValue) { + printf("glGetBooleanv(%s) failed: expected %d, got %d\n", + piglit_get_gl_enum_name(pname), + !!expectedValue, b); + pass = false; + } + + return pass; +} + + +enum piglit_result +piglit_display(void) +{ + /* nothing */ + return
[Piglit] [PATCH] gl-1.5-get-array-attribs: exercise glGetIntegerv, etc. with vertex arrays
This new test checks that glGetInteger/Fload/Double/Booleanv() return the right values when querying vertex array attributes. Currently broken in Mesa. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106450 --- tests/opengl.py | 1 + tests/spec/gl-1.5/CMakeLists.gl.txt | 1 + tests/spec/gl-1.5/get-array-attribs.c | 135 ++ 3 files changed, 137 insertions(+) create mode 100644 tests/spec/gl-1.5/get-array-attribs.c diff --git a/tests/opengl.py b/tests/opengl.py index 825e0bf..cbc4e39 100644 --- a/tests/opengl.py +++ b/tests/opengl.py @@ -801,6 +801,7 @@ with profile.test_list.group_manager( g(['draw-vertices', 'user'], 'draw-vertices-user') g(['isbufferobj']) g(['depth-tex-compare']) +g(['gl-1.5-get-array-attribs']) g(['gl-1.5-normal3b3s-invariance', 'GL_BYTE'], 'normal3b3s-invariance-byte') g(['gl-1.5-normal3b3s-invariance', 'GL_SHORT'], diff --git a/tests/spec/gl-1.5/CMakeLists.gl.txt b/tests/spec/gl-1.5/CMakeLists.gl.txt index e072757..6cc69f5 100644 --- a/tests/spec/gl-1.5/CMakeLists.gl.txt +++ b/tests/spec/gl-1.5/CMakeLists.gl.txt @@ -8,6 +8,7 @@ link_libraries ( ${OPENGL_gl_LIBRARY} ) +piglit_add_executable (gl-1.5-get-array-attribs get-array-attribs.c) piglit_add_executable (gl-1.5-normal3b3s-invariance normal3b3s-invariance.c) piglit_add_executable (gl-1.5-vertex-buffer-offsets vertex-buffer-offsets.c) diff --git a/tests/spec/gl-1.5/get-array-attribs.c b/tests/spec/gl-1.5/get-array-attribs.c new file mode 100644 index 000..6aa3c78 --- /dev/null +++ b/tests/spec/gl-1.5/get-array-attribs.c @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2018 VMware, Inc. + * + * 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 glGetInteger/Float/Double/Booleanv with vertex array attributes. + */ + +#include "piglit-util-gl.h" + + +PIGLIT_GL_TEST_CONFIG_BEGIN + config.supports_gl_compat_version = 15; + config.window_visual = PIGLIT_GL_VISUAL_RGBA; + config.khr_no_error_support = PIGLIT_NO_ERRORS; +PIGLIT_GL_TEST_CONFIG_END + + +static bool +test_get(GLenum pname, GLint expectedValue) +{ + GLint i; + GLfloat f; + GLdouble d; + GLboolean b; + bool pass = true; + + glGetIntegerv(pname, ); + glGetFloatv(pname, ); + glGetDoublev(pname, ); + glGetBooleanv(pname, ); + + if (i != expectedValue) { + printf("glGetIntegerv(%s) failed: expected %d, got %d\n", + piglit_get_gl_enum_name(pname), + expectedValue, i); + pass = false; + } + + if (f != (GLfloat) expectedValue) { + printf("glGetFloatv(%s) failed: expected %f, got %f\n", + piglit_get_gl_enum_name(pname), + (GLfloat) expectedValue, f); + pass = false; + } + + if (d != (GLdouble) expectedValue) { + printf("glGetDoublev(%s) failed: expected %f, got %f\n", + piglit_get_gl_enum_name(pname), + (GLdouble) expectedValue, f); + pass = false; + } + + if (b != (GLboolean) !!expectedValue) { + printf("glGetBooleanv(%s) failed: expected %d, got %d\n", + piglit_get_gl_enum_name(pname), + !!expectedValue, b); + pass = false; + } + + return pass; +} + + +enum piglit_result +piglit_display(void) +{ + /* nothing */ + return PIGLIT_PASS; +} + + +void +piglit_init(int argc, char **argv) +{ + bool pass = true; + GLubyte dummy[100]; + + glVertexPointer(2, GL_FLOAT, 12, dummy); + glNormalPointer(GL_FLOAT, 0, dummy); + glColorPointer(4, GL_UNSIGNED_BYTE, 16, dummy); + glSecondaryColorPointer(3, GL_SHORT, 32, dummy); + glTexCoordPointer(3, GL_SHORT, 18,
Re: [Piglit] [PATCH] framework: fix running with mixed concurrency (neither -c or -1)
On Tue, 2018-05-08 at 10:32 -0700, Dylan Baker wrote: > test_list is an iterator, you can't walk an iterator more than once. To > solve this we use itertools.tee, which creates a shared buffer for the > iterators to draw from. This fixes errors like: > Cool!! It seems to fix the problem. Thank you! Reviewed-by: Juan A. Suarez> [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/user/piglit/framework/exceptions.py", line 51, in _inner > func(*args, **kwargs) > File "/home/user/piglit/framework/programs/run.py", line 370, in run > backend.finalize({'time_elapsed': time_elapsed.to_json()}) > File "/home/user/piglit/framework/backends/json.py", line 163, in finalize > assert data['tests'] > AssertionError > > Thanks Tomi for figuring out what was wrong with the original patch! > > CC: Michel Dänzer > CC: Tomi Sarvela > CC: "Juan A. Suarez Romero" > --- > framework/profile.py | 7 +-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/framework/profile.py b/framework/profile.py > index 1c75025b3..5161f6e4c 100644 > --- a/framework/profile.py > +++ b/framework/profile.py > @@ -596,13 +596,16 @@ def run(profiles, logger, backend, concurrency): > run_threads(single, profile, test_list) > else: > assert concurrency == "some" > +# test_list is an iterator, we need to copy it to run it twice. > +test_list = itertools.tee(test_list, 2) > + > # Filter and return only thread safe tests to the threaded pool > -run_threads(multi, profile, test_list, > +run_threads(multi, profile, test_list[0], > lambda x: x[1].run_concurrent) > > # Filter and return the non thread safe tests to the single > # pool > -run_threads(single, profile, test_list, > +run_threads(single, profile, test_list[1], > lambda x: not x[1].run_concurrent) > profile.teardown() > ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] framework: fix running with mixed concurrency (neither -c or -1)
On Tue, May 08, 2018 at 10:32:26AM -0700, Dylan Baker wrote: > test_list is an iterator, you can't walk an iterator more than once. To > solve this we use itertools.tee, which creates a shared buffer for the > iterators to draw from. This fixes errors like: > > [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/user/piglit/framework/exceptions.py", line 51, in _inner > func(*args, **kwargs) > File "/home/user/piglit/framework/programs/run.py", line 370, in run > backend.finalize({'time_elapsed': time_elapsed.to_json()}) > File "/home/user/piglit/framework/backends/json.py", line 163, in finalize > assert data['tests'] > AssertionError > > Thanks Tomi for figuring out what was wrong with the original patch! > > CC: Michel Dänzer> CC: Tomi Sarvela > CC: "Juan A. Suarez Romero" Oh, just noticed that (well, actually Tomi told me about this). I've sent another patch which fixes the same issue in a slightly different way. Sorry for the duplication! -- Cheers, Arek ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] profile: Don't exhaust generator when concurrency == "some"
TestProfile.itertests() is a generator that we happily exhaust. If concurrency == "some" then run_profile() invokes run_threads() twice, once for thread safe tests, and once for non-safe ones. The first invocation exhaust the generator, so the second one sees nothing. This patch changes the call chain so that we call .itertests() in the place we actually consume the generator, not earlier. Reported-by: Stanislav LisovskiySigned-off-by: Arkadiusz Hiler --- framework/profile.py | 28 +--- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/framework/profile.py b/framework/profile.py index 1c75025b3..f214006bc 100644 --- a/framework/profile.py +++ b/framework/profile.py @@ -561,12 +561,7 @@ def run(profiles, logger, backend, concurrency): """ chunksize = 1 -profiles = [(p, p.itertests()) for p in profiles] -log = LogManager(logger, sum(len(p) for p, _ in profiles)) - -# check that after the filters are run there are actually tests to run. -# if not any(l for _, l in profiles): -# raise exceptions.PiglitUserError('no matching tests') +log = LogManager(logger, sum(len(p) for p in profiles)) def test(name, test, profile, this_pool=None): """Function to call test.execute from map""" @@ -576,33 +571,36 @@ def run(profiles, logger, backend, concurrency): if profile.options['monitor'].abort_needed: this_pool.terminate() -def run_threads(pool, profile, test_list, filterby=None): +def run_threads(pool, profile, filterby=None): """ Open a pool, close it, and join it """ if filterby: # Although filterby could be attached to TestProfile as a filter, # it would have to be removed when run_threads exits, requiring # more code, and adding side-effects -test_list = (x for x in test_list if filterby(x)) +test_list = (x for x in profile.itertests() if filterby(x)) +else: +test_list = list(profile.itertests()) pool.imap(lambda pair: test(pair[0], pair[1], profile, pool), test_list, chunksize) -def run_profile(profile, test_list): +def run_profile(profile): """Run an individual profile.""" profile.setup() + if concurrency == "all": -run_threads(multi, profile, test_list) +run_threads(multi, profile) elif concurrency == "none": -run_threads(single, profile, test_list) +run_threads(single, profile) else: assert concurrency == "some" # Filter and return only thread safe tests to the threaded pool -run_threads(multi, profile, test_list, +run_threads(multi, profile, lambda x: x[1].run_concurrent) # Filter and return the non thread safe tests to the single # pool -run_threads(single, profile, test_list, +run_threads(single, profile, lambda x: not x[1].run_concurrent) profile.teardown() @@ -615,7 +613,7 @@ def run(profiles, logger, backend, concurrency): try: for p in profiles: -run_profile(*p) +run_profile(p) for pool in [single, multi]: pool.close() @@ -623,6 +621,6 @@ def run(profiles, logger, backend, concurrency): finally: log.get().summary() -for p, _ in profiles: +for p in profiles: if p.options['monitor'].abort_needed: raise exceptions.PiglitAbort(p.options['monitor'].error_message) -- 2.14.3 ___ 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-08 07:19 PM, Dylan Baker wrote: > Quoting Michel Dänzer (2018-05-08 07:07:34) >> >> 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. > > That would mean reverting nearly 20 commits I appreciate that would suck, but so does having piglit in a regressed state for a week, with slow progress towards fixing all the regressions. > and giving up considerable runtime reductions for us The thing is, while I can see that the time until running the first test has been greatly reduced, ./piglit run -x basic-arithmetic-uvec2-texture2d -x glx-multithread-texture --process-isolation false gpu takes significantly longer to finish now (~8 minutes) than before 9461d92301e72807eba4776a16a05207e3a16477 (~4.5 minutes), with radeonsi on an 8-core Ryzen CPU. -- 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 1/4] framework: ensure that all tests are run before exiting
On 2018-05-08 11:27 PM, Dylan Baker wrote: > Michel, does this series fix the remaining issues you're seeing? It mostly fixes the gpu profile running fewer tests than before. The only remaining minor issue there is that the shaders@glsl-{fs,vs}-{inline,unroll}-explosion tests were previously accurately listed as "crash" in the summary, now it's "notrun". Tested-by: Michel DänzerThe bigger remaining issue is that --process-isolation false gpu takes almost twice as long as it did before 9461d92301e72807eba4776a16a05207e3a16477. -- 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] framework: fix running with mixed concurrency (neither -c or -1)
On 2018-05-08 07:32 PM, Dylan Baker wrote: > test_list is an iterator, you can't walk an iterator more than once. To > solve this we use itertools.tee, which creates a shared buffer for the > iterators to draw from. This fixes errors like: > > [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/user/piglit/framework/exceptions.py", line 51, in _inner > func(*args, **kwargs) > File "/home/user/piglit/framework/programs/run.py", line 370, in run > backend.finalize({'time_elapsed': time_elapsed.to_json()}) > File "/home/user/piglit/framework/backends/json.py", line 163, in finalize > assert data['tests'] > AssertionError > > Thanks Tomi for figuring out what was wrong with the original patch! > > CC: Michel Dänzer> CC: Tomi Sarvela > CC: "Juan A. Suarez Romero" > --- > framework/profile.py | 7 +-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/framework/profile.py b/framework/profile.py > index 1c75025b3..5161f6e4c 100644 > --- a/framework/profile.py > +++ b/framework/profile.py > @@ -596,13 +596,16 @@ def run(profiles, logger, backend, concurrency): > run_threads(single, profile, test_list) > else: > assert concurrency == "some" > +# test_list is an iterator, we need to copy it to run it twice. > +test_list = itertools.tee(test_list, 2) > + > # Filter and return only thread safe tests to the threaded pool > -run_threads(multi, profile, test_list, > +run_threads(multi, profile, test_list[0], > lambda x: x[1].run_concurrent) > > # Filter and return the non thread safe tests to the single > # pool > -run_threads(single, profile, test_list, > +run_threads(single, profile, test_list[1], > lambda x: not x[1].run_concurrent) > profile.teardown() > > This seems to fix the issues with the xts-render profile. Tested-by: Michel Dänzer -- 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
[Piglit] [PATCH] ext_packed_float: Add a test that queries GL_RGBA_SIGNED_COMPONENTS_EXT
From: Bruce MerryCc: Brian Paul Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73096 --- I came across this test when cleaning up bugzilla. Seems we fixed Mesa but never pushed the piglit test. tests/all.py | 1 + tests/spec/ext_packed_float/CMakeLists.gl.txt | 1 + .../query-rgba-signed-components.c| 167 ++ 3 files changed, 169 insertions(+) create mode 100644 tests/spec/ext_packed_float/query-rgba-signed-components.c diff --git a/tests/all.py b/tests/all.py index 26638cd82..db85f172e 100644 --- a/tests/all.py +++ b/tests/all.py @@ -3331,6 +3331,7 @@ with profile.test_list.group_manager( PiglitGLTest, grouptools.join('spec', 'ext_packed_float')) as g: g(['ext_packed_float-pack'], 'pack') +g(['query-rgba-signed-components'], 'query-rgba-signed-components') g(['getteximage-invalid-format-for-packed-type'], 'getteximage-invalid-format-for-packed-type') add_msaa_formats_tests(g, 'GL_EXT_packed_float') diff --git a/tests/spec/ext_packed_float/CMakeLists.gl.txt b/tests/spec/ext_packed_float/CMakeLists.gl.txt index 44a8818c8..b061cb6b2 100644 --- a/tests/spec/ext_packed_float/CMakeLists.gl.txt +++ b/tests/spec/ext_packed_float/CMakeLists.gl.txt @@ -10,5 +10,6 @@ link_libraries ( piglit_add_executable (ext_packed_float-pack pack.c) piglit_add_executable (getteximage-invalid-format-for-packed-type getteximage-invalid-format-for-packed-type.c) +piglit_add_executable (query-rgba-signed-components query-rgba-signed-components.c) # vim: ft=cmake: diff --git a/tests/spec/ext_packed_float/query-rgba-signed-components.c b/tests/spec/ext_packed_float/query-rgba-signed-components.c new file mode 100644 index 0..635d5bc5a --- /dev/null +++ b/tests/spec/ext_packed_float/query-rgba-signed-components.c @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2013 Bruce Merry + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 + * NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COYPRIGTH + * HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "piglit-util-gl.h" + +#define MAKE_FORMAT_STR(x) x, #x + +typedef struct { + GLenum format; + const char *format_str; + const char *extension; + int expected[4]; + int buffer; /* Draw buffer to attach the renderbuffer to */ +} format_info; + +static const format_info formats[] = { + { MAKE_FORMAT_STR(GL_RGBA8), NULL, { 0, 0, 0, 0 } }, + { MAKE_FORMAT_STR(GL_R8I), "GL_ARB_texture_rg", { 1, 0, 0, 0 } }, + { MAKE_FORMAT_STR(GL_RG8I), "GL_ARB_texture_rg", { 1, 1, 0, 0 } }, + { MAKE_FORMAT_STR(GL_R8_SNORM), "GL_EXT_texture_snorm", { 1, 0, 0, 0 } }, + { MAKE_FORMAT_STR(GL_LUMINANCE8_SNORM), "GL_EXT_texture_snorm", { 1, 1, 1, 0 } }, + { MAKE_FORMAT_STR(GL_RGBA8UI_EXT), "GL_EXT_texture_integer", { 0, 0, 0, 0 } }, + { MAKE_FORMAT_STR(GL_RGBA16F_ARB), "GL_ARB_texture_float", { 1, 1, 1, 1 } }, + { MAKE_FORMAT_STR(GL_LUMINANCE16F_ARB), "GL_ARB_texture_float", { 1, 1, 1, 0 } }, + { MAKE_FORMAT_STR(GL_RGB9_E5_EXT), "GL_EXT_texture_shared_exponent", { 0, 0, 0, 0 } }, + { MAKE_FORMAT_STR(GL_R11F_G11F_B10F_EXT), "GL_EXT_packed_float", { 0, 0, 0, 0 } }, + { MAKE_FORMAT_STR(GL_RGBA16F_ARB), "GL_ARB_texture_float", { 0, 0, 0, 0 }, 1 } +}; + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 10; + + config.window_visual = PIGLIT_GL_VISUAL_RGB; + +PIGLIT_GL_TEST_CONFIG_END + +enum piglit_result +piglit_display(void) +{ + /* Should never be reached */ + return PIGLIT_FAIL; +} + +/* Queries GL_RGBA_SIGNED_COMPONENTS_EXT and compares to expected. + * If they do not match, prints an error. Returns true on match. + */ +static bool check_rgba_signed(const int *expected) +{ + int i; + /* Start with nonsense values, to ensure they are written */ + GLint actual[4] = {2, 2, 2, 2}; + +