Re: [Piglit] [PATCH 0/2] Storing doubles
I've pushed these patches, thanks! -Tom On Fri, Nov 29, 2013 at 09:57:53PM -0500, Jan Vesely wrote: > Hi, > > these two patches attempt to improve the situation with store-double* > generated tests. > The first patch adds cl_khr_fp64 requirement to all generated tests, the > second one adds necessary infrasttructure to > tests/cl/program/program_tester.c. > > I'm not sure if I fully understand the TODO comment that was there. > According to > http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/clGetDeviceInfo.html > cl_khr_fp64 must be returned by all OpenCL 1.2 devices. Checking for > the presence of this extension should be enough, or am I missing something? > > These patches change 10 store-double* tests from warn to skipped on my amd > turks > (and to passed on intel cpu implementation). Note that the compiler only > complains about missing extension for type double, vector types (doubleN) > pass. > > regards, > Jan > > Jan Vesely (2): > cl: check for cl_khr_fp64 in generated double store tests > program-tester: Allow double type > > generated_tests/generate-cl-store-tests.py | 10 -- > tests/cl/program/program-tester.c | 11 +++ > 2 files changed, 15 insertions(+), 6 deletions(-) > > -- > 1.8.3.1 > > ___ > Piglit mailing list > Piglit@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/piglit ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH V3 1/1] cl: Add buffer-flags test
On Tue, Dec 03, 2013 at 02:58:18PM -0500, Jan Vesely wrote: > v2: Rework to use subtests > v3: fix printf output > use piglit_merge_result > whitespace fixes > 0 as default was added in OpenCL 1.2 > > Signed-off-by: Jan Vesely > --- > > Hi, > > thanks for your feedback. > > I was wondering what to do about the overlap with cl-api-create-buffer test. > cl-api-create-buffer includes similar tests but it does not test copying or > destination buffers, it just creates a buffer and reads it back. > > So my question is whether it would make more sense to merge this test with > api-cl-create-buffers (and make it use subtests), or have a separate test for > testing data consistency (this one), and remove the overlapping tests from > api-cl-create-buffers. Or leave both as they test slightly different things. > I went ahead and pushed this patch as is, if we decide to re-organize the tests we can do it later as a separate series. I'm not quite sure the best way to organize the tests. Maybe this will become more clear as we add more tests, but right now I'm leaning towards having one test program per API call and using piglit's subtest feature for reporting results. The problem with the way the tests are currently organized is if we're failing 4/5 of the api-cl-create-buffers tests and then we regress to 3/5 this won't show up in the piglit results, since 3/5 and 4/5 are both failures. -Tom > I ran this test on intel OCL (Corei7) CPU and nvidia CUDA (GF GT 630), both > pass. > Tests that use CL_MEM_USE_HOST_PTR in source buffer fail on mesa/clover > on my AMD TURKS card. > > regards, > Jan > > > tests/all_cl.tests| 1 + > tests/cl/custom/CMakeLists.cl.txt | 1 + > tests/cl/custom/buffer-flags.c| 226 > ++ > 3 files changed, 228 insertions(+) > create mode 100644 tests/cl/custom/buffer-flags.c > > diff --git a/tests/all_cl.tests b/tests/all_cl.tests > index a648e1a..57bfe3e 100644 > --- a/tests/all_cl.tests > +++ b/tests/all_cl.tests > @@ -40,6 +40,7 @@ profile.tests['Program'] = program > add_plain_test(custom, 'Run simple kernel', ['cl-custom-run-simple-kernel']) > add_plain_test(custom, 'Flush after enqueue kernel', > ['cl-custom-flush-after-enqueue-kernel']) > add_plain_test(custom, 'r600 create release buffer bug', > ['cl-custom-r600-create-release-buffer-bug']) > +add_plain_test(custom, 'Buffer flags', ['cl-custom-buffer-flags']) > > # API > # Platform > diff --git a/tests/cl/custom/CMakeLists.cl.txt > b/tests/cl/custom/CMakeLists.cl.txt > index 70649ea..778b845 100644 > --- a/tests/cl/custom/CMakeLists.cl.txt > +++ b/tests/cl/custom/CMakeLists.cl.txt > @@ -1,3 +1,4 @@ > piglit_cl_add_custom_test (run-simple-kernel run-simple-kernel.c) > piglit_cl_add_custom_test (flush-after-enqueue-kernel > flush-after-enqueue-kernel.c) > piglit_cl_add_custom_test (r600-create-release-buffer-bug > r600-create-release-buffer-bug.c) > +piglit_cl_add_custom_test (buffer-flags buffer-flags.c) > diff --git a/tests/cl/custom/buffer-flags.c b/tests/cl/custom/buffer-flags.c > new file mode 100644 > index 000..321d75f > --- /dev/null > +++ b/tests/cl/custom/buffer-flags.c > @@ -0,0 +1,226 @@ > +/* > + * Copyright 2013 Jan Vesely > + * > + * Permission is hereby granted, free of charge, to any person obtaining a > + * copy of this software and associated documentation files (the "Software"), > + * to deal in the Software without restriction, including without limitation > + * the rights to use, copy, modify, merge, publish, distribute, sublicense, > + * and/or sell copies of the Software, and to permit persons to whom the > + * Software is furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice (including the next > + * paragraph) shall be included in all copies or substantial portions of the > + * Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > + * DEALINGS IN THE SOFTWARE. > + * > + */ > + > +#include "piglit-framework-cl-custom.h" > + > +PIGLIT_CL_CUSTOM_TEST_CONFIG_BEGIN > + > + config.name = "CL buffer memory flags"; > + config.run_per_device = true; > + > +PIGLIT_CL_CUSTOM_TEST_CONFIG_END > + > + > +/* This is a simple copy-kernel, the purpose of this test is to test buffer > + * data availability, not specific compute function. */ > +char *source = > +"__kernel void test (global float *out, global float *in) {\n" > +"int i = get_global_id(0); \n" > +"out[i] = in[i];
[Piglit] [PATCH] Add new concurrency option
This patch adds a new concurrency option that runs all tests out of a multi-threaded pool, ignoring their request to be threaded or not. This new option is mutually exclusive with the -1/--no-concurrency option. Signed-off-by: Dylan Baker --- framework/core.py | 30 -- piglit-run.py | 17 + 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/framework/core.py b/framework/core.py index 5a9e8b0..c8dc4bc 100644 --- a/framework/core.py +++ b/framework/core.py @@ -564,22 +564,32 @@ class TestProfile: self.prepare_test_list(env) -# If using concurrency, add all the concurrent tests to the pool and -# execute that pool -if env.concurrent: +# If concurrency is set to 'all' run all tests out of a concurrent +# threadpool, if it's none, then run evey test serially. otherwise mix +# and match them +if env.concurrent == "all": +pool = ThreadPool(multiprocessing.cpu_count()) +for (path, test) in self.test_list.items(): +pool.add(test.execute, (env, path, json_writer)) +pool.join() +elif env.concurrent == "none": +pool = ThreadPool(1) +for (path, test) in self.test_list.items(): +if not env.concurrent or not test.runConcurrent: +pool.add(test.execute, (env, path, json_writer)) +pool.join() +else: pool = ThreadPool(multiprocessing.cpu_count()) for (path, test) in self.test_list.items(): if test.runConcurrent: pool.add(test.execute, (env, path, json_writer)) pool.join() -# Run any remaining tests serially from a single thread pool after the -# concurrent tests have finished -pool = ThreadPool(1) -for (path, test) in self.test_list.items(): -if not env.concurrent or not test.runConcurrent: -pool.add(test.execute, (env, path, json_writer)) -pool.join() +pool = ThreadPool(1) +for (path, test) in self.test_list.items(): +if not test.runConcurrent: +pool.add(test.execute, (env, path, json_writer)) +pool.join() def remove_test(self, test_path): """Remove a fully qualified test from the profile. diff --git a/piglit-run.py b/piglit-run.py index 0d3d1be..c4bed93 100755 --- a/piglit-run.py +++ b/piglit-run.py @@ -56,10 +56,19 @@ def main(): metavar="", help="Exclude matching tests " "(can be used more than once)") -parser.add_argument("-1", "--no-concurrency", -action="store_false", -dest="concurrency", -help="Disable concurrent test runs") +conc_parser = parser.add_mutually_exclusive_group() +conc_parser.add_argument('-c', '--all-concurrent', + action="store_const", + default="some", + const="all", + dest="concurrency", + help="Run all tests concurrently") +conc_parser.add_argument("-1", "--no-concurrency", + action="store_const", + default="some", + const="none", + dest="concurrency", + help="Disable concurrent test runs") parser.add_argument("-p", "--platform", choices=["glx", "x11_egl", "wayland", "gbm"], help="Name of windows system passed to waffle") -- 1.8.5.1 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH V3 4/6] ARB_sample_shading: Add test to verify the functionality of gl_SampleMask[]
On 6 November 2013 17:24, Anuj Phogat wrote: > V2: Get rid of redundant projection matrix. > V3: Draw to a multisample texture and use it later to verify > the expected color of each sample. > Use piglit_draw_rect() and get rid of redundant code. > > Signed-off-by: Anuj Phogat > --- > tests/all.tests| 5 + > .../arb_sample_shading/execution/CMakeLists.gl.txt | 1 + > .../execution/builtin-gl-sample-mask.cpp | 227 > + > 3 files changed, 233 insertions(+) > create mode 100644 > tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask.cpp > > diff --git a/tests/all.tests b/tests/all.tests > index 5f66e43..eb9f481 100644 > --- a/tests/all.tests > +++ b/tests/all.tests > @@ -1347,6 +1347,11 @@ for num_samples in TEST_SAMPLE_COUNTS: > executable = 'arb_sample_shading-{0} -auto'.format(test_name) > arb_sample_shading[test_name] = PlainExecTest(executable) > > +for num_samples in TEST_SAMPLE_COUNTS: > +test_name = 'builtin-gl-sample-mask {0}'.format(num_samples) > +executable = 'arb_sample_shading-{0} -auto'.format(test_name) > +arb_sample_shading[test_name] = PlainExecTest(executable) > + > # Group ARB_debug_output > arb_debug_output = Group() > spec['ARB_debug_output'] = arb_debug_output > diff --git a/tests/spec/arb_sample_shading/execution/CMakeLists.gl.txt > b/tests/spec/arb_sample_shading/execution/CMakeLists.gl.txt > index 35f2905..d2f1f4a 100644 > --- a/tests/spec/arb_sample_shading/execution/CMakeLists.gl.txt > +++ b/tests/spec/arb_sample_shading/execution/CMakeLists.gl.txt > @@ -13,4 +13,5 @@ link_libraries ( > piglit_add_executable (arb_sample_shading-api api.c) > piglit_add_executable (arb_sample_shading-builtin-gl-num-samples > builtin-gl-num-samples.cpp) > piglit_add_executable (arb_sample_shading-builtin-gl-sample-id > builtin-gl-sample-id.cpp) > +piglit_add_executable (arb_sample_shading-builtin-gl-sample-mask > builtin-gl-sample-mask.cpp) > # vim: ft=cmake: > diff --git > a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask.cpp > b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask.cpp > new file mode 100644 > index 000..2686377 > --- /dev/null > +++ b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask.cpp > @@ -0,0 +1,227 @@ > +/* > + * Copyright © 2013 Intel Corporation > + * > + * Permission is hereby granted, free of charge, to any person obtaining a > + * copy of this software and associated documentation files (the > "Software"), > + * to deal in the Software without restriction, including without > limitation > + * the rights to use, copy, modify, merge, publish, distribute, > sublicense, > + * and/or sell copies of the Software, and to permit persons to whom the > + * Software is furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice (including the > next > + * paragraph) shall be included in all copies or substantial portions of > the > + * Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, > EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF > MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT > SHALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR > OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > DEALINGS > + * IN THE SOFTWARE. > + */ > + > +/** \file builtin-gl-sample-mask.cpp > + * This test verifies that supplying a value to gl_SampleMask[] > + * in fragment shader program works as per ARB_sample_shading > + * specification. > + **/ > + > +#include "piglit-fbo.h" > +using namespace piglit_util_fbo; > + > +const int pattern_width = 128; const int pattern_height = 128; > + > +PIGLIT_GL_TEST_CONFIG_BEGIN > + > + config.supports_gl_compat_version = 21; > With my recommended changes to the vertex shader below, you should be able to also add: config.suports_gl_core_version = 31; > + > + config.window_width = pattern_width; > + config.window_height = pattern_height; > + config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | > PIGLIT_GL_VISUAL_RGBA; > + > +PIGLIT_GL_TEST_CONFIG_END > + > +static int num_samples; > +static unsigned prog_0, prog_1; > +static Fbo multisampled_fbo, multisampled_tex, singlesampled_fbo; > + > +static void > +print_usage_and_exit(char *prog_name) > +{ > + printf("Usage: %s \n", prog_name); > + piglit_report_result(PIGLIT_FAIL); > +} > + > +void > +compile_shader(void) > +{ > + static const char *vert = > + "#version 130\n" > + "in vec2 pos;\n" > + "void main()\n" > + "{\n" > + " gl_Position = gl_ModelViewProjectionMatrix *\n" > + "vec4(pos, 0.0, 1.0);\n" > +
Re: [Piglit] [PATCH 14/16] msaa: Verify accuracy of sRGB MSAA resolves.
On Fri, Jun 15, 2012 at 5:32 PM, Paul Berry wrote: > From the GL spec, version 4.2, section 4.1.11 (Additional Multisample > Fragment Operations): > > If a framebuffer object is not bound, after all operations have > been completed on the multisample buffer, the sample values for > each color in the multisample buffer are combined to produce a > single color value, and that value is written into the > corresponding color buffers selected by DrawBuffer or > DrawBuffers. An implementation may defer the writing of the color > buffers until a later time, but the state of the framebuffer must > behave as if the color buffers were updated as each fragment was > processed. The method of combination is not specified. If the > framebuffer contains sRGB values, then it is recommended that the > an average of sample values is computed in a linearized space, as > for blending (see section 4.1.7). I think this is wrong. Using a quote from the spec that explicitly states "If a framebuffer object is not bound ..." and then fixing a test with it that only tests the case where the framebuffer object IS bound... it's a contradiction. Also, if the spec recommends a certain behavior but doesn't require it, failing to comply with the behavior should report WARN and not FAIL. Anyway, according to the GL 4.4 spec, most of our piglit sRGB glBlitFramebuffer tests are wrong. Marek > > This patch adds a new "srgb" mode to the MSAA accuracy test, which > verifies that the formula used by the implementation to blend sRGB > samples matches the GL spec's recommendations. When an "srgb" > accuracy test is requested, the test is modified to do the following > things: > > - Render using a buffer format of SRGB8_ALPHA8 instead of RGBA. > > - When manually downsampling the reference image, enable > FRAMEBUFFER_SRGB, so that the data output by the manual downsampler > gets converted from linear color space into sRGB color space. This > ensures that the reference image is generated according to the > spec's recommendations. > > - Convert pixels from sRGB color space to linear color space before > comparing the test image and the reference image. This ensures that > the RMS error is computed in linear color space, so that the RMS > error computed for sRGB mode is comparable with the RMS error > computed for linear RGBA color. > --- > tests/all.tests|2 +- > .../spec/ext_framebuffer_multisample/accuracy.cpp |3 + > tests/spec/ext_framebuffer_multisample/common.cpp | 55 --- > tests/spec/ext_framebuffer_multisample/common.h|7 ++- > 4 files changed, 55 insertions(+), 12 deletions(-) > > diff --git a/tests/all.tests b/tests/all.tests > index 2a636f3..755eace 100644 > --- a/tests/all.tests > +++ b/tests/all.tests > @@ -1333,7 +1333,7 @@ ext_framebuffer_multisample['renderbuffer-samples'] = > concurrent_test('ext_frame > ext_framebuffer_multisample['samples'] = > concurrent_test('ext_framebuffer_multisample-samples') > > for num_samples in MSAA_SAMPLE_COUNTS: > -for test_type in ('color', 'stencil_draw', 'stencil_resolve', > +for test_type in ('color', 'srgb', 'stencil_draw', 'stencil_resolve', >'depth_draw', 'depth_resolve'): > for options in power_set(('small', 'depthstencil')): > test_name = ' '.join(['accuracy', str(num_samples), > test_type] > diff --git a/tests/spec/ext_framebuffer_multisample/accuracy.cpp > b/tests/spec/ext_framebuffer_multisample/accuracy.cpp > index 1b7ac1c..0462db0 100644 > --- a/tests/spec/ext_framebuffer_multisample/accuracy.cpp > +++ b/tests/spec/ext_framebuffer_multisample/accuracy.cpp > @@ -56,6 +56,7 @@ print_usage_and_exit(char *prog_name) > printf("Usage: %s [options]\n" >" where is one of:\n" >"color: test downsampling of color buffer\n" > + "srgb: test downsampling of srgb color buffer\n" >"stencil_draw: test drawing using MSAA stencil buffer\n" >"stencil_resolve: test resolve of MSAA stencil buffer\n" >"depth_draw: test drawing using MSAA depth buffer\n" > @@ -105,6 +106,8 @@ piglit_init(int argc, char **argv) > test_type_enum test_type; > if (strcmp(argv[2], "color") == 0) { > test_type = TEST_TYPE_COLOR; > + } else if (strcmp(argv[2], "srgb") == 0) { > + test_type = TEST_TYPE_SRGB; > } else if (strcmp(argv[2], "stencil_draw") == 0) { > test_type = TEST_TYPE_STENCIL_DRAW; > } else if (strcmp(argv[2], "stencil_resolve") == 0) { > diff --git a/tests/spec/ext_framebuffer_multisample/common.cpp > b/tests/spec/ext_framebuffer_multisample/common.cpp > index e1060a8..c211363 100644 > --- a/tests/spec/ext_framebuffer_multisample/common.cpp > +++ b/tests/spec/ext_framebuffer_multi
[Piglit] [PATCH] undefined reference to clock_gettime
From: Jin Zhou diff --git a/tests/util/CMakeLists.no_api.txt b/tests/util/CMakeLists.no_api.txt index c331368..96a6587 100644 --- a/tests/util/CMakeLists.no_api.txt +++ b/tests/util/CMakeLists.no_api.txt @@ -7,7 +7,7 @@ piglit_add_library (piglitutil ) if(UNIX) - target_link_libraries(piglitutil m) + target_link_libraries(piglitutil m rt) endif(UNIX) # vim: ft=cmake: -- 1.7.9.5 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] array-texture: fail if any of the subtests fail rather than the last
Signed-off-by: Ilia Mirkin --- tests/texturing/array-texture.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/texturing/array-texture.c b/tests/texturing/array-texture.c index 9837473..a65d919 100644 --- a/tests/texturing/array-texture.c +++ b/tests/texturing/array-texture.c @@ -176,7 +176,7 @@ make_1d_array_texture(void) static GLboolean test_2d_array_texture(GLuint tex) { - GLboolean pass; + GLboolean pass, ret = GL_TRUE; int i; float width = piglit_width / NUM_COLORS; float x = 0.0; @@ -200,18 +200,20 @@ test_2d_array_texture(GLuint tex) if (!pass) { printf("%s: failed for 2D image/slice %d\n", prog, i); } + + ret &= pass; } glBindTexture(GL_TEXTURE_2D_ARRAY_EXT, 0); - return pass; + return ret; } static GLboolean test_1d_array_texture(GLuint tex) { - GLboolean pass; + GLboolean pass, ret = GL_TRUE; int i; float width = piglit_width / NUM_COLORS; float x = 0.0; @@ -239,11 +241,13 @@ test_1d_array_texture(GLuint tex) if (!pass) { printf("%s: failed for 1D image/slice %d\n", prog, i); } + + ret &= pass; } glBindTexture(GL_TEXTURE_1D_ARRAY_EXT, 0); - return pass; + return ret; } -- 1.8.3.2 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] fix the fbo bind error check. a GL_INVALID_OPERATION error should be generated, instead of GL_INVALID_VALUE
From: Jin Zhou diff --git a/tests/fbo/fbo-bind-renderbuffer.c b/tests/fbo/fbo-bind-renderbuffer.c index 50c8c7f..3b2b305 100644 --- a/tests/fbo/fbo-bind-renderbuffer.c +++ b/tests/fbo/fbo-bind-renderbuffer.c @@ -64,6 +64,7 @@ test_binding(GLboolean bindRenderbuffer) GL_RENDERBUFFER_EXT, rb); err = glGetError(); + return err; } -- 1.7.9.5 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH V3 4/6] ARB_sample_shading: Add test to verify the functionality of gl_SampleMask[]
On Mon, Dec 9, 2013 at 10:02 AM, Paul Berry wrote: > On 6 November 2013 17:24, Anuj Phogat wrote: > >> V2: Get rid of redundant projection matrix. >> V3: Draw to a multisample texture and use it later to verify >> the expected color of each sample. >> Use piglit_draw_rect() and get rid of redundant code. >> >> Signed-off-by: Anuj Phogat >> --- >> tests/all.tests| 5 + >> .../arb_sample_shading/execution/CMakeLists.gl.txt | 1 + >> .../execution/builtin-gl-sample-mask.cpp | 227 >> + >> 3 files changed, 233 insertions(+) >> create mode 100644 >> tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask.cpp >> >> diff --git a/tests/all.tests b/tests/all.tests >> index 5f66e43..eb9f481 100644 >> --- a/tests/all.tests >> +++ b/tests/all.tests >> @@ -1347,6 +1347,11 @@ for num_samples in TEST_SAMPLE_COUNTS: >> executable = 'arb_sample_shading-{0} -auto'.format(test_name) >> arb_sample_shading[test_name] = PlainExecTest(executable) >> >> +for num_samples in TEST_SAMPLE_COUNTS: >> +test_name = 'builtin-gl-sample-mask {0}'.format(num_samples) >> +executable = 'arb_sample_shading-{0} -auto'.format(test_name) >> +arb_sample_shading[test_name] = PlainExecTest(executable) >> + >> # Group ARB_debug_output >> arb_debug_output = Group() >> spec['ARB_debug_output'] = arb_debug_output >> diff --git a/tests/spec/arb_sample_shading/execution/CMakeLists.gl.txt >> b/tests/spec/arb_sample_shading/execution/CMakeLists.gl.txt >> index 35f2905..d2f1f4a 100644 >> --- a/tests/spec/arb_sample_shading/execution/CMakeLists.gl.txt >> +++ b/tests/spec/arb_sample_shading/execution/CMakeLists.gl.txt >> @@ -13,4 +13,5 @@ link_libraries ( >> piglit_add_executable (arb_sample_shading-api api.c) >> piglit_add_executable (arb_sample_shading-builtin-gl-num-samples >> builtin-gl-num-samples.cpp) >> piglit_add_executable (arb_sample_shading-builtin-gl-sample-id >> builtin-gl-sample-id.cpp) >> +piglit_add_executable (arb_sample_shading-builtin-gl-sample-mask >> builtin-gl-sample-mask.cpp) >> # vim: ft=cmake: >> diff --git >> a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask.cpp >> b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask.cpp >> new file mode 100644 >> index 000..2686377 >> --- /dev/null >> +++ b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask.cpp >> @@ -0,0 +1,227 @@ >> +/* >> + * Copyright © 2013 Intel Corporation >> + * >> + * Permission is hereby granted, free of charge, to any person obtaining >> a >> + * copy of this software and associated documentation files (the >> "Software"), >> + * to deal in the Software without restriction, including without >> limitation >> + * the rights to use, copy, modify, merge, publish, distribute, >> sublicense, >> + * and/or sell copies of the Software, and to permit persons to whom the >> + * Software is furnished to do so, subject to the following conditions: >> + * >> + * The above copyright notice and this permission notice (including the >> next >> + * paragraph) shall be included in all copies or substantial portions of >> the >> + * Software. >> + * >> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, >> EXPRESS OR >> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF >> MERCHANTABILITY, >> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT >> SHALL >> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR >> OTHER >> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, >> ARISING >> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER >> DEALINGS >> + * IN THE SOFTWARE. >> + */ >> + >> +/** \file builtin-gl-sample-mask.cpp >> + * This test verifies that supplying a value to gl_SampleMask[] >> + * in fragment shader program works as per ARB_sample_shading >> + * specification. >> + **/ >> + >> +#include "piglit-fbo.h" >> +using namespace piglit_util_fbo; >> + >> +const int pattern_width = 128; const int pattern_height = 128; >> + >> +PIGLIT_GL_TEST_CONFIG_BEGIN >> + >> + config.supports_gl_compat_version = 21; >> > > With my recommended changes to the vertex shader below, you should be able > to also add: > > config.suports_gl_core_version = 31; > > >> + >> + config.window_width = pattern_width; >> + config.window_height = pattern_height; >> + config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | >> PIGLIT_GL_VISUAL_RGBA; >> + >> +PIGLIT_GL_TEST_CONFIG_END >> + >> +static int num_samples; >> +static unsigned prog_0, prog_1; >> +static Fbo multisampled_fbo, multisampled_tex, singlesampled_fbo; >> + >> +static void >> +print_usage_and_exit(char *prog_name) >> +{ >> + printf("Usage: %s \n", prog_name); >> + piglit_report_result(PIGLIT_FAIL); >> +} >> + >> +void >> +compile_shader(void) >> +{ >> + static const char *vert = >> + "#version 130\n" >> + "in vec2 pos;\n" >>
Re: [Piglit] [PATCH V3 3/6] ARB_sample_shading: Add test to verify the functionality of gl_SampleID
On Fri, Dec 6, 2013 at 3:04 PM, Paul Berry wrote: > > On 6 November 2013 17:20, Anuj Phogat wrote: >> >> V2: Get rid of redundant projection matrix. >> V3: Draw to a multisample texture and use it later to verify >> the expected color of each sample. >> Use piglit_draw_rect() and get rid of redundant code. >> >> Signed-off-by: Anuj Phogat >> --- >> tests/all.tests| 5 + >> .../arb_sample_shading/execution/CMakeLists.gl.txt | 1 + >> .../execution/builtin-gl-sample-id.cpp | 216 >> + >> 3 files changed, 222 insertions(+) >> create mode 100644 >> tests/spec/arb_sample_shading/execution/builtin-gl-sample-id.cpp >> >> diff --git a/tests/all.tests b/tests/all.tests >> index 883fbec..5f66e43 100644 >> --- a/tests/all.tests >> +++ b/tests/all.tests >> @@ -1342,6 +1342,11 @@ for num_samples in TEST_SAMPLE_COUNTS: >> executable = 'arb_sample_shading-{0} -auto'.format(test_name) >> arb_sample_shading[test_name] = PlainExecTest(executable) >> >> +for num_samples in TEST_SAMPLE_COUNTS: >> +test_name = 'builtin-gl-sample-id {0}'.format(num_samples) >> +executable = 'arb_sample_shading-{0} -auto'.format(test_name) >> +arb_sample_shading[test_name] = PlainExecTest(executable) >> + >> # Group ARB_debug_output >> arb_debug_output = Group() >> spec['ARB_debug_output'] = arb_debug_output >> diff --git a/tests/spec/arb_sample_shading/execution/CMakeLists.gl.txt >> b/tests/spec/arb_sample_shading/execution/CMakeLists.gl.txt >> index 56fa0da..35f2905 100644 >> --- a/tests/spec/arb_sample_shading/execution/CMakeLists.gl.txt >> +++ b/tests/spec/arb_sample_shading/execution/CMakeLists.gl.txt >> @@ -12,4 +12,5 @@ link_libraries ( >> >> piglit_add_executable (arb_sample_shading-api api.c) >> piglit_add_executable (arb_sample_shading-builtin-gl-num-samples >> builtin-gl-num-samples.cpp) >> +piglit_add_executable (arb_sample_shading-builtin-gl-sample-id >> builtin-gl-sample-id.cpp) >> # vim: ft=cmake: >> diff --git >> a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-id.cpp >> b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-id.cpp >> new file mode 100644 >> index 000..ebbb6a0 >> --- /dev/null >> +++ b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-id.cpp >> @@ -0,0 +1,216 @@ >> +/* >> + * Copyright © 2013 Intel Corporation >> + * >> + * Permission is hereby granted, free of charge, to any person obtaining a >> + * copy of this software and associated documentation files (the >> "Software"), >> + * to deal in the Software without restriction, including without limitation >> + * the rights to use, copy, modify, merge, publish, distribute, sublicense, >> + * and/or sell copies of the Software, and to permit persons to whom the >> + * Software is furnished to do so, subject to the following conditions: >> + * >> + * The above copyright notice and this permission notice (including the next >> + * paragraph) shall be included in all copies or substantial portions of the >> + * Software. >> + * >> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS >> OR >> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, >> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL >> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR >> OTHER >> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING >> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER >> DEALINGS >> + * IN THE SOFTWARE. >> + */ >> + >> +/** \file builtin-gl-sample-id.cpp >> + * This test verifies that using gl_SampleID in fragment shader program >> + * works as per ARB_sample_shading specification. >> + * >> + **/ >> + >> +#include "piglit-fbo.h" >> +using namespace piglit_util_fbo; >> + >> +const int pattern_width = 128; const int pattern_height = 128; >> + >> +PIGLIT_GL_TEST_CONFIG_BEGIN >> + >> + config.supports_gl_compat_version = 21; >> + >> + config.window_width = pattern_width; >> + config.window_height = pattern_height; >> + config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | >> PIGLIT_GL_VISUAL_RGBA; >> + >> +PIGLIT_GL_TEST_CONFIG_END >> + >> +static int num_samples; >> +static unsigned prog_0, prog_1; >> +static Fbo multisampled_fbo, multisampled_tex; >> + >> +static void >> +print_usage_and_exit(char *prog_name) >> +{ >> + printf("Usage: %s \n", prog_name); >> + piglit_report_result(PIGLIT_FAIL); >> +} >> + >> +void >> +compile_shader(void) >> +{ >> + static const char *vert = >> + "#version 130\n" >> + "in vec2 pos;\n" >> + "void main()\n" >> + "{\n" >> + " gl_Position = gl_ModelViewProjectionMatrix *\n" >> + "vec4(pos, 0.0, 1.0);\n" >> + "}\n"; > > > To interface properly with piglit_draw_rect, you really want your vertex > shader
Re: [Piglit] [PATCH V3 4/6] ARB_sample_shading: Add test to verify the functionality of gl_SampleMask[]
On 9 December 2013 18:42, Anuj Phogat wrote: > > > > On Mon, Dec 9, 2013 at 10:02 AM, Paul Berry wrote: > >> On 6 November 2013 17:24, Anuj Phogat wrote: >> >>> + static const char *frag_template = >>> + "#version 130\n" >>> + "%s\n" >>> + "uniform %s tex;\n" >>> + "uniform int samples;\n" >>> + "out vec4 out_color;\n" >>> + "void main()\n" >>> + "{\n" >>> + " int i = 0;\n" >>> + " bool pass = true;\n" >>> + " int mask = (int(gl_FragCoord.x) * 0x10204081) ^\n" >>> + " (int(gl_FragCoord.y) * 0x01010101);\n" >>> + " vec4 green = vec4(0.0, 1.0, 0.0, 1.0);\n" >>> + " vec4 black = vec4(0.0, 0.0, 0.0, 0.0);\n" >>> + " do {\n" >>> >> >> Any particular reason not to use a for loop here? (i.e. for (int i = 0; >> i < samples; i++)) >> > > I used do-while to include testing of 'samples == 0' case. > Oh, ok. Would you mind putting a comment just above the loop to explain that? With the comment added I'm ok with the loop as is. ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH V3 4/6] ARB_sample_shading: Add test to verify the functionality of gl_SampleMask[]
On Mon, Dec 9, 2013 at 6:47 PM, Paul Berry wrote: > On 9 December 2013 18:42, Anuj Phogat wrote: >> >> >> >> >> On Mon, Dec 9, 2013 at 10:02 AM, Paul Berry >> wrote: >>> >>> On 6 November 2013 17:24, Anuj Phogat wrote: + static const char *frag_template = + "#version 130\n" + "%s\n" + "uniform %s tex;\n" + "uniform int samples;\n" + "out vec4 out_color;\n" + "void main()\n" + "{\n" + " int i = 0;\n" + " bool pass = true;\n" + " int mask = (int(gl_FragCoord.x) * 0x10204081) ^\n" + " (int(gl_FragCoord.y) * 0x01010101);\n" + " vec4 green = vec4(0.0, 1.0, 0.0, 1.0);\n" + " vec4 black = vec4(0.0, 0.0, 0.0, 0.0);\n" + " do {\n" >>> >>> >>> Any particular reason not to use a for loop here? (i.e. for (int i = 0; >>> i < samples; i++)) >> >> >> I used do-while to include testing of 'samples == 0' case. > > > Oh, ok. Would you mind putting a comment just above the loop to explain > that? With the comment added I'm ok with the loop as is. I'll add the comment. Thanks. ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] Add tests/gl33conform.tests to run GTF for khronos OpenGL CTS
Signed-off-by: Anuj Phogat --- tests/gl33conform.tests | 81 + 1 file changed, 81 insertions(+) create mode 100644 tests/gl33conform.tests diff --git a/tests/gl33conform.tests b/tests/gl33conform.tests new file mode 100644 index 000..9a8bd92 --- /dev/null +++ b/tests/gl33conform.tests @@ -0,0 +1,81 @@ +# +# 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: +# +# This permission notice 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 AUTHOR(S) 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. + +import os +import re +import sys + +from os import path +from glob import glob +from framework.core import TestProfile, testBinDir +from framework.exectest import ExecTest + +# +# GTFTest: Execute a sub-test of the Khronos OpenGL Conformance suite. +# +# To use this, create a 'GTF3' symlink in piglit/bin which points to the +# Khronos 'GTF' executable. Piglit will automatically add all .test +# files into the 'gtf' category. +# + +if not path.exists(path.join(testBinDir, 'GTF3')): +sys.exit(0) + +profile = TestProfile() + +# Chase the piglit/bin/GTF symlink to find where the tests really live. +gtfroot = path.dirname(path.realpath(path.join(testBinDir, 'GTF3'))) + +class GTFTest(ExecTest): +pass_re = re.compile(r'(Conformance|Regression) PASSED all (?P\d+) tests') + +def __init__(self, testpath): +ExecTest.__init__(self, [path.join(testBinDir, 'GTF3'), '-glmajor=3', '-glminor=3', '-debug','-minfmt', '-width=113', '-height=47', '-run=' + testpath]) + +def interpretResult(self, out, returncode, results, dmesg): +mo = self.pass_re.search(out) +if mo is not None and int(mo.group('passed')) > 0: +results['result'] = 'dmesg-warn' if dmesg != '' else 'pass' +else: +results['result'] = 'dmesg-fail' if dmesg != '' else 'fail' +return out + +def populateTests(runfile): +"Read a .run file, adding any .test files to the profile" +with open(runfile, 'r') as f: +for line in f.readlines(): +# Ignore comments and whitespace +line = line.strip() +if line.startswith('#') or line == '': +continue + +newpath = path.join(path.dirname(runfile), line) +if line.endswith('.run'): +populateTests(newpath) +else: +# Add the .test file +group = path.join('gl33conform', path.relpath(newpath, gtfroot)) +profile.test_list[group] = GTFTest(newpath) + + +# Populate the group with all the .test files +populateTests(path.join(gtfroot, 'mustpass_gl33.run')) -- 1.8.3.1 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit