Re: [Piglit] [PATCH] tests/spec: ARB_arrays_of_arrays compiler tests
On 5 October 2013 04:21, Timothy Arceri wrote: > > Signed-off-by: Timothy Arceri > --- > tests/all.tests|7 +++ > ...-function-parameter-declaration-new-syntax.vert | 17 > ...ay-of-array-function-parameter-declaration.vert | 17 > ...y-function-parameter-definition-new-syntax.vert | 20 > +++ > ...ray-of-array-function-parameter-definition.vert | 20 > +++ > .../array-of-array-structure-field-new-syntax.frag | 17 > .../compiler/array-of-array-structure-field.frag | 17 > .../array-of-array-uniform-new-syntax.vert | 15 ++ > ...f-array-uniform-unsized-invalid-new-syntax.vert | 21 > > ...-array-uniform-unsized-invalid-new-syntax2.vert | 21 > > .../array-of-array-uniform-unsized-invalid.vert| 21 > > .../array-of-array-uniform-unsized-invalid2.vert | 21 > > .../array-of-array-uniform-unsized-new-syntax.vert | 15 ++ > .../compiler/array-of-array-uniform-unsized.vert | 15 ++ > .../compiler/array-of-array-uniform.vert | 15 ++ > 15 files changed, 259 insertions(+) > create mode 100644 > tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration-new-syntax.vert > create mode 100644 > tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration.vert > create mode 100644 > tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-definition-new-syntax.vert > create mode 100644 > tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-definition.vert > create mode 100644 > tests/spec/arb_arrays_of_arrays/compiler/array-of-array-structure-field-new-syntax.frag > create mode 100644 > tests/spec/arb_arrays_of_arrays/compiler/array-of-array-structure-field.frag > create mode 100644 > tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-new-syntax.vert > create mode 100644 > tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid-new-syntax.vert > create mode 100644 > tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid-new-syntax2.vert > create mode 100644 > tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid.vert > create mode 100644 > tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-invalid2.vert > create mode 100644 > tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized-new-syntax.vert > create mode 100644 > tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform-unsized.vert > create mode 100644 > tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform.vert > General comment: it seems redundant to have "arb_arrays_of_arrays" in the folder name and "array-of-array-" as a prefix to each parser test. Can we remove "array-of-array-" from the parser test file names (so for example tests/spec/arb_arrays_of_arrays/compiler/array-of-array-uniform.vert becomes tests/spec/arb_arrays_of_arrays/compiler/uniform.vert). > > diff --git a/tests/all.tests b/tests/all.tests > index 3e5e1a3..1737138 100644 > --- a/tests/all.tests > +++ b/tests/all.tests > @@ -1272,6 +1272,13 @@ for backing_type in ('texture', 'renderbuffer'): > 'arb_framebuffer_srgb-' + test_name) > add_plain_test(arb_framebuffer_srgb, 'framebuffer-srgb') > > +# Group ARB_arrays_of_arrays > +arb_arrays_of_arrays = Group() > +spec['ARB_arrays_of_arrays'] = arb_arrays_of_arrays > +import_glsl_parser_tests(arb_arrays_of_arrays, > +os.path.join(testsDir, 'spec', > 'arb_arrays_of_arrays'), > +['compiler']) > + > arb_gpu_shader5 = Group() > spec['ARB_gpu_shader5'] = arb_gpu_shader5 > add_shader_test_dir(arb_gpu_shader5, > diff --git > a/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration-new-syntax.vert > b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration-new-syntax.vert > new file mode 100644 > index 000..d4f8bf8 > --- /dev/null > +++ > b/tests/spec/arb_arrays_of_arrays/compiler/array-of-array-function-parameter-declaration-new-syntax.vert > Calling this test "new syntax" is confusing. All three of these syntaxes are new: vec4[3][2] a; vec4[2] a[3]; vec4 a[3][2]; I'd suggest a naming convention that just names the syntax elements in the order they appear. So for instance: vec4[3][2] a; // tested by *-array-array-var vec4[2] a[3]; // tested by *-array-var-array vec4 a[3][2]; // tested by *-var-array-array > @@ -0,0 +1,17 @@ > +/* [config] > + * expect_result: pass > + * glsl_version: 1.20 > + * require_extensions: GL_ARB_arrays_of_arrays > + * [end config] > + */ > +#version 120 > +#extension GL_ARB_arrays_of_arrays: enable >
[Piglit] [PATCH] ARB_viewport_array: Add test for API coverage of index/first/count params
Tests valid and invalid "index", "first", "count" parameters for the following: glViewportArrayv, glViewportIndexedf, glViewportIndexedfv glScissorArrayv, glScissorIndexed, glScissorIndexedv glDepthRangeArrayv, glDepthRangeIndexed glGetFloati_v, glGetDoublei_v Tested on Nvidia Quadro 600 all tests pass. --- tests/all.tests | 4 + tests/spec/CMakeLists.txt | 1 + tests/spec/arb_viewport_array/CMakeLists.gl.txt | 14 + tests/spec/arb_viewport_array/CMakeLists.txt| 1 + tests/spec/arb_viewport_array/indices.c | 329 5 files changed, 349 insertions(+) create mode 100644 tests/spec/arb_viewport_array/CMakeLists.gl.txt create mode 100644 tests/spec/arb_viewport_array/CMakeLists.txt create mode 100644 tests/spec/arb_viewport_array/indices.c diff --git a/tests/all.tests b/tests/all.tests index 742cc21..9bc3b78 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -1650,6 +1650,10 @@ add_plain_test(arb_vertex_program, 'vp-address-04') add_plain_test(arb_vertex_program, 'vp-bad-program') add_plain_test(arb_vertex_program, 'vp-max-array') +arb_viewport_array = Group() +spec['ARB_viewport_array'] = arb_viewport_array +arb_viewport_array['indices'] = concurrent_test('arb_viewport_array-indices') + nv_vertex_program = Group() spec['NV_vertex_program'] = nv_vertex_program add_vpfpgeneric(nv_vertex_program, 'nv-mov') diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt index 18b846d..d22d8a4 100644 --- a/tests/spec/CMakeLists.txt +++ b/tests/spec/CMakeLists.txt @@ -41,6 +41,7 @@ add_subdirectory (arb_texture_storage_multisample) add_subdirectory (arb_texture_view) add_subdirectory (arb_timer_query) add_subdirectory (arb_transform_feedback2) +add_subdirectory (arb_viewport_array) add_subdirectory (ati_envmap_bumpmap) add_subdirectory (ext_fog_coord) add_subdirectory (ext_framebuffer_multisample) diff --git a/tests/spec/arb_viewport_array/CMakeLists.gl.txt b/tests/spec/arb_viewport_array/CMakeLists.gl.txt new file mode 100644 index 000..73d90f3 --- /dev/null +++ b/tests/spec/arb_viewport_array/CMakeLists.gl.txt @@ -0,0 +1,14 @@ +include_directories( + ${GLEXT_INCLUDE_DIR} + ${OPENGL_INCLUDE_PATH} + ) + +link_libraries( + piglitutil_${piglit_target_api} + ${OPENGL_gl_LIBRARY} + ${OPENGL_glu_LIBRARY} + ) + +piglit_add_executable(arb_viewport_array-indices indices.c) + +# vim: ft=cmake: diff --git a/tests/spec/arb_viewport_array/CMakeLists.txt b/tests/spec/arb_viewport_array/CMakeLists.txt new file mode 100644 index 000..144a306 --- /dev/null +++ b/tests/spec/arb_viewport_array/CMakeLists.txt @@ -0,0 +1 @@ +piglit_include_target_api() diff --git a/tests/spec/arb_viewport_array/indices.c b/tests/spec/arb_viewport_array/indices.c new file mode 100644 index 000..63d0275 --- /dev/null +++ b/tests/spec/arb_viewport_array/indices.c @@ -0,0 +1,329 @@ +/* + * Copyright © 2013 LunarG, 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. + * + * Author: Jon Ashburn + */ + +/** + * Tests GL_ARB_viewport_array Validity for indices. + * Use both valid and invalid parameters (index, first, count) + * for all the new API entry points: + * glViewportArrayv, glViewportIndexedf, glViewportIndexedfv + * glScissorArrayv, glScissorIndexed, glScissorIndexedv + * glDepthRangeArrayv, glDepthRangeIndexed + * glGetFloati_v, glGetDoublei_v + * + */ + +#include "piglit-util-gl-common.h" +#include + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 32; + config.supports_gl_core_version = 32; + + config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + +/** + * Test that ViewportArrayv, ViewportIndexedf(v), GetFloati_v give the + * "expected_error" gl error. Given the values for "first" and "count" + * or "index" in range
Re: [Piglit] [PATCH 4/4] arb_transform_feedback2: Misc. API error checks
On Friday, October 04, 2013 06:11:01 PM Ian Romanick wrote: > From: Ian Romanick > > This covers most of the errors mentioned in the spec that aren't > already covered in cannot-bind-when-active.c and gen-names-only.c. > Most of the other errors should be covered by existing > EXT_transform_feedback tests. > > Mesa currently passes all of these tests. > > NVIDIA (304.64 on GTX 260) fails several subtests. > > Pause active feedback only: Incorrectly generates error in > glEndTransformFeedback. > > TransformFeedbackVaryings only when inactive: Doesn't generate any > errors when it should. > > Draw only from "ended" object: Generates GL_INVALID_VALUE instead > of GL_INVALID_OPERATION. > > AMD has not been tested. > > v2: Convert to use piglit subtest reporting. Fix fs_only_prog to > actually only have a fragment shader attached. > > v3: Quite significant re-write. Per Paul's suggestion, each of the > tests is no a subtest that can be individually selected from the command > line. This uses infrastructure in piglit-framework-gl to handle the > subtests. This also eliminates the work-around for NVIDIA's > glEndTransformFeedback-while-paused bug. > > The code currently in all.tests for getting the list of subtests is > just a place holder. We'll want to refactor this out somewhere else > before pushing. > > Signed-off-by: Ian Romanick > Cc: Kenneth Graunke > Cc: Paul Berry > Cc: Dylan Baker > --- > tests/all.tests| 9 + > .../spec/arb_transform_feedback2/CMakeLists.gl.txt | 1 + > tests/spec/arb_transform_feedback2/api-errors.c| 626 > + 3 files changed, 636 insertions(+) > create mode 100644 tests/spec/arb_transform_feedback2/api-errors.c > > diff --git a/tests/all.tests b/tests/all.tests > index ac95e7a..60128ec 100644 > --- a/tests/all.tests > +++ b/tests/all.tests > @@ -6,6 +6,7 @@ import os > import os.path as path > import platform > import shlex > +import subprocess > > from framework.core import Group, TestProfile > from framework.exectest import PlainExecTest > @@ -2306,6 +2307,14 @@ arb_transform_feedback2['draw-auto'] = > PlainExecTest(['arb_transform_feedback2-d > arb_transform_feedback2['istranformfeedback'] = > PlainExecTest(['arb_transform_feedback2-istransformfeedback', '-auto']) > arb_transform_feedback2['glGenTransformFeedbacks names only'] = > concurrent_test('arb_transform_feedback2-gen-names-only') > arb_transform_feedback2['cannot bind when another object is active'] = > concurrent_test('arb_transform_feedback2-cannot-bind-when-active') + > +process = subprocess.Popen([path.join(testBinDir, > 'arb_transform_feedback2-api-errors'), '-list-subtests'], > stdout=subprocess.PIPE) + > +arb_transform_feedback2['misc. API error checks'] = {} You shoudl probably use Group() instead of {} here, since that's what is done in the rest of all.tests > +for line in process.stdout: > +[option, name] = line.split(":") > +arb_transform_feedback2['misc. API error checks'][name.strip()] = > concurrent_test('arb_transform_feedback2-api-errors -subtest > {0}'.format(option.strip())) + > arb_transform_feedback2['misc. API queries'] = If you want this to be a standard interface you should use helper functions. I've split this into two functions, so that the add_subtests could be used by tests that don't use the -list-subtests option Here's an example: def get_subtests(binary): """ Return a list of subtests """ # Universal_newlines causes python to return \n for newlines regardless of # the platform output = subprocess.check_output([path.join(testBinDir, binary), '-list-subtests'], universal_newlines=True) # Strip the last newline so element[-1] != [''] return [l.split(": ") for l in output.strip().split('\n')] def add_subtests(group, binary, subtests, test_type=concurrent_test): """ helper for adding tests with subtests group: a group object to store the tests in binary: The name of the test binary subtests: An iterable contains iterable pairs in the form: (, concurrent_test('arb_transform_feedback2-api-queries') > arb_transform_feedback2['counting with pause'] = > concurrent_test('arb_transform_feedback2-pause-counting') > > diff --git a/tests/spec/arb_transform_feedback2/CMakeLists.gl.txt > b/tests/spec/arb_transform_feedback2/CMakeLists.gl.txt index > c6287a1..3d74f91 100644 > --- a/tests/spec/arb_transform_feedback2/CMakeLists.gl.txt > +++ b/tests/spec/arb_transform_feedback2/CMakeLists.gl.txt > @@ -9,6 +9,7 @@ link_libraries ( > ${OPENGL_glu_LIBRARY} > ) > > +piglit_add_executable (arb_transform_feedback2-api-errors api-errors.c) > piglit_add_executable (arb_transform_feedback2-api-queries api-queries.c) > piglit_add_executable (arb_transform_feedback2-cannot-bind-when-active > cannot-bind-when-active.c) piglit_add_executable > (arb_tran
[Piglit] [PATCH] util/x11: Propagate window resize events to piglit_width/height
When I switched Piglit from GLUT to Waffle, I broke detection of X11 window resizes. When the user resized the window, Piglit called piglit_display() but neglected to update piglit_width/height. This patch ensures that Piglit updates piglit_width/height correctly. (It's amazing that it took this long for anyone to fix it. People must rarely resize Piglit windows). CC: Jordan Justen Signed-off-by: Chad Versace --- tests/util/piglit-framework-gl/piglit_x11_framework.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/tests/util/piglit-framework-gl/piglit_x11_framework.c b/tests/util/piglit-framework-gl/piglit_x11_framework.c index 95c46c4..8b3d3d7 100644 --- a/tests/util/piglit-framework-gl/piglit_x11_framework.c +++ b/tests/util/piglit-framework-gl/piglit_x11_framework.c @@ -72,6 +72,23 @@ piglit_x11_framework(struct piglit_gl_framework *gl_fw) } static void +get_window_size(struct piglit_x11_framework *x11_fw) +{ + unsigned width, height; + + Window wjunk; + int ijunk; + unsigned ujunk; + + XGetGeometry(x11_fw->display, x11_fw->window, +&wjunk, &ijunk, &ijunk, +&width, &height, &ujunk, &ujunk); + + piglit_width = width; + piglit_height = height; +} + +static void process_next_event(struct piglit_x11_framework *x11_fw) { struct piglit_winsys_framework *winsys_fw = &x11_fw->winsys_fw; @@ -84,9 +101,11 @@ process_next_event(struct piglit_x11_framework *x11_fw) switch (event.type) { case Expose: + get_window_size(x11_fw); winsys_fw->need_redisplay = true; break; case ConfigureNotify: + get_window_size(x11_fw); if (winsys_fw->user_reshape_func) winsys_fw->user_reshape_func(event.xconfigure.width, event.xconfigure.height); -- 1.8.3.1 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] util/x11: Propagate window resize events to piglit_width/height
Reviewed-by: Jordan Justen On Fri, 2013-10-18 at 11:12 -0700, Chad Versace wrote: > When I switched Piglit from GLUT to Waffle, I broke detection of X11 > window resizes. When the user resized the window, Piglit called > piglit_display() but neglected to update piglit_width/height. > > This patch ensures that Piglit updates piglit_width/height correctly. > > (It's amazing that it took this long for anyone to fix it. People must > rarely resize Piglit windows). > > CC: Jordan Justen > Signed-off-by: Chad Versace > --- > tests/util/piglit-framework-gl/piglit_x11_framework.c | 19 > +++ > 1 file changed, 19 insertions(+) > > diff --git a/tests/util/piglit-framework-gl/piglit_x11_framework.c > b/tests/util/piglit-framework-gl/piglit_x11_framework.c > index 95c46c4..8b3d3d7 100644 > --- a/tests/util/piglit-framework-gl/piglit_x11_framework.c > +++ b/tests/util/piglit-framework-gl/piglit_x11_framework.c > @@ -72,6 +72,23 @@ piglit_x11_framework(struct piglit_gl_framework *gl_fw) > } > > static void > +get_window_size(struct piglit_x11_framework *x11_fw) > +{ > + unsigned width, height; > + > + Window wjunk; > + int ijunk; > + unsigned ujunk; > + > + XGetGeometry(x11_fw->display, x11_fw->window, > + &wjunk, &ijunk, &ijunk, > + &width, &height, &ujunk, &ujunk); > + > + piglit_width = width; > + piglit_height = height; > +} > + > +static void > process_next_event(struct piglit_x11_framework *x11_fw) > { > struct piglit_winsys_framework *winsys_fw = &x11_fw->winsys_fw; > @@ -84,9 +101,11 @@ process_next_event(struct piglit_x11_framework *x11_fw) > > switch (event.type) { > case Expose: > + get_window_size(x11_fw); > winsys_fw->need_redisplay = true; > break; > case ConfigureNotify: > + get_window_size(x11_fw); > if (winsys_fw->user_reshape_func) > winsys_fw->user_reshape_func(event.xconfigure.width, >event.xconfigure.height); ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] util/x11: Propagate window resize events to piglit_width/height
On 10/18/2013 11:21 AM, Jordan Justen wrote: Reviewed-by: Jordan Justen On Fri, 2013-10-18 at 11:12 -0700, Chad Versace wrote: When I switched Piglit from GLUT to Waffle, I broke detection of X11 window resizes. When the user resized the window, Piglit called piglit_display() but neglected to update piglit_width/height. This patch ensures that Piglit updates piglit_width/height correctly. (It's amazing that it took this long for anyone to fix it. People must rarely resize Piglit windows). CC: Jordan Justen Signed-off-by: Chad Versace --- tests/util/piglit-framework-gl/piglit_x11_framework.c | 19 +++ 1 file changed, 19 insertions(+) Committed to master. Jordan confirmed that this patch fixed his bug. ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 1/3] ARB_texture_view: Test for API coverage of subset of input params
On 10/17/2013 01:29 PM, Jon Ashburn wrote: > RE: > "This test doesn't appear to use integer textures or floating-point > textures." > +piglit_require_extension("GL_EXT_texture_integer"); > +piglit_require_extension("GL_ARB_texture_float"); > > > I think it does but maybe wrong in my understanding of texture formats > and which extension (if any) they map to: > glTexStorage2D(GL_TEXTURE_2D,2, GL_RGBA32F, 16, 16); > > > glTextureView(tex[2], GL_TEXTURE_2D, 0, GL_RGBA32UI, 0, 1, 0, 1); No, you're correct. I missed those because I searched for FLOAT and INTEGER (as you would see with glTexImage2D). > On 10/17/2013 12:38 PM, Ian Romanick wrote: >> On 10/16/2013 04:37 PM, Jon Ashburn wrote: >>> Tests GL_ARB_texture_view and validity of input parameters. >>> Use both valid and invalid parameters, although mostly invalid >>> parameters are tested since other tests will use valid parameters. >>> Only the parameters "texture", "origtexture", "minlevel", "numlevels", >>> "minlayer", "numlayers" are tested for validity as per section 8.18 of >>> OpenGL 4.3 Core spec. >>> >>> Tested on Nvidia Quadro 600 and it passes. >>> --- >>> tests/all.tests | 5 + >>> tests/spec/arb_texture_view/CMakeLists.gl.txt | 1 + >>> tests/spec/arb_texture_view/params.c | 241 >>> ++ >>> 3 files changed, 247 insertions(+) >>> create mode 100644 tests/spec/arb_texture_view/params.c >>> >>> diff --git a/tests/all.tests b/tests/all.tests >>> index c919f19..2bb6aed 100644 >>> --- a/tests/all.tests >>> +++ b/tests/all.tests >>> @@ -1469,6 +1469,11 @@ spec['ARB_texture_storage_multisample'] = >>> arb_texture_storage_multisample >>> arb_texture_storage_multisample['tex-storage'] = >>> concurrent_test('arb_texture_storage_multisample-tex-storage') >>> arb_texture_storage_multisample['tex-param'] = >>> concurrent_test('arb_texture_storage_multisample-tex-param') >>> +arb_texture_view = Group() >>> +spec['ARB_texture_view'] = arb_texture_view >>> +arb_texture_view['immutable_levels'] = >>> concurrent_test('arb_texture_view-texture-immutable-levels') >>> +arb_texture_view['params'] = concurrent_test('arb_texture_view-params') >>> + >>> tdfx_texture_compression_fxt1 = Group() >>> spec['3DFX_texture_compression_FXT1'] = tdfx_texture_compression_fxt1 >>> add_concurrent_test(tdfx_texture_compression_fxt1, >>> 'compressedteximage GL_COMPRESSED_RGB_FXT1_3DFX') >>> diff --git a/tests/spec/arb_texture_view/CMakeLists.gl.txt >>> b/tests/spec/arb_texture_view/CMakeLists.gl.txt >>> index c400759..4f2b1ef 100644 >>> --- a/tests/spec/arb_texture_view/CMakeLists.gl.txt >>> +++ b/tests/spec/arb_texture_view/CMakeLists.gl.txt >>> @@ -10,5 +10,6 @@ link_libraries( >>> ) >>> piglit_add_executable(arb_texture_view-texture-immutable-levels >>> texture-immutable-levels.c) >>> +piglit_add_executable(arb_texture_view-params params.c) >>> # vim: ft=cmake: >>> diff --git a/tests/spec/arb_texture_view/params.c >>> b/tests/spec/arb_texture_view/params.c >>> new file mode 100644 >>> index 000..b458a03This test doesn't appear to use integer >>> textures or floating-point textures. >>> >>> --- /dev/null >>> +++ b/tests/spec/arb_texture_view/params.c >>> @@ -0,0 +1,241 @@ >>> +/* >>> + * Copyright © 2013 LunarG, 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. >>> + * >>> + * Author: Jon Ashburn >>> + */ >>> + >>> +/** >>> + * Tests GL_ARB_texture_view and validity of input parameters. >>> + * Use both valid and invalid parameters, although mostly invalid >>> + * parameters are tested since other tests use valid parameters. >>> + * Only the parameters "texture", "origtexture", "minlevel", >>> "numlevels", >>> + * "minlayer", "numlayers" are tested for validity as
Re: [Piglit] [PATCH 2/2] depthstencil-render-miplevels: Fix stencil drawing for width %4 != 0.
On 9 October 2013 13:33, Eric Anholt wrote: > It didn't affect test results, since we don't probe this data and it's > only in manual mode, but it did cause buffer overflow. > --- > tests/texturing/depthstencil-render-miplevels.cpp | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/tests/texturing/depthstencil-render-miplevels.cpp > b/tests/texturing/depthstencil-render-miplevels.cpp > index 813ca6f..f1ba658 100644 > --- a/tests/texturing/depthstencil-render-miplevels.cpp > +++ b/tests/texturing/depthstencil-render-miplevels.cpp > @@ -339,6 +339,9 @@ piglit_init(int argc, char **argv) > print_usage_and_exit(argv[0]); > } > > + glPixelStorei(GL_PACK_ALIGNMENT, 1); > + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); > + > /* argv[1]: texture size */ > { > char *endptr = NULL; > -- > 1.8.4.rc3 > Reviewed-by: Paul Berry ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 2/3] arb_texture_view: Test valid and invalid formats
On 10/17/2013 01:39 PM, Jon Ashburn wrote: > > On 10/17/2013 12:46 PM, Ian Romanick wrote: >> On 10/16/2013 04:37 PM, Jon Ashburn wrote: >>> diff --git a/tests/spec/arb_texture_view/common.c >>> b/tests/spec/arb_texture_view/common.c >>> new file mode 100644 >>> index 000..c5f5a23 >>> --- /dev/null >>> +++ b/tests/spec/arb_texture_view/common.c >>> @@ -0,0 +1,48 @@ >>> +/* >>> + * Copyright © 2013 LunarG, 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. >>> + * >>> + * Author: Jon Ashburn >>> + */ >>> + >>> +#include "GL/gl.h" >>> +#include >>> + >>> + >>> +void update_valid_arrays(GLenum *valid, GLenum *invalid, >>> + unsigned int numInvalid, unsigned int >>> numValid, ... ) >> I the same review feedback where I suggested refactoring this function >> to a common place, I also suggested changing the signature to: >> >> unsigned update_valid_arrays(GLenum *valid, GLenum *invalid, >> unsigned int numInvalid, ... ); >> >> Is there a reason you didn't also do that? > Which common place are you referring to? tests/util directory? I just > used > shared file within the test directory for "common" place. What you've done here is fine... and exactly what I meant. > Why change the signature to return unsigned? Error return value? Ugh... I blame Thunderbird. It apparently decided to not send that message, which is still sitting in my drafts folder. :( In addition to suggesting that you refactor update_valid_arrays out into its own file (so that it can be used by other tests in the same folder), I also said: > This is fragile. Other varargs functions (e.g., sprintf) return the > number of parameters consumed and use a sentinel or formatting to note > the end of the list. Ending the list of targets with, say, 0 is much > less susceptible to copy-and-paste bugs. With this interface, if I > copy-and-paste, delete an item, and forget to change num_targets, I > lose. > > Something like: > > num_targets = update_valid_arrays(legal_targets, > illegal_targets, > ARRAY_SIZE(illegal_targets), > GL_TEXTURE_1D, > GL_TEXTURE_1D_ARRAY, > 0); I'll check and see if there are any other comments in that message that I haven't already repeated. >>> +{ >>> +va_list args; >>> +GLenum val; >>> +unsigned int i,j; >>> + >>> +va_start(args, numValid); >>> +for (i = 0; i < numValid; i++) { >>> +val = va_arg(args, GLenum); >>> +valid[i] = val; >>> +/* remove the valid enum from the invalid array */ >>> +for (j= 0; j < numInvalid; j++) { >>> +if (invalid[j] == val) >>> +invalid[j] = 0; >>> +} >>> +} >>> +va_end(args); >>> +} ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 2/3] arb_texture_view: Test valid and invalid formats
On 10/16/2013 04:37 PM, Jon Ashburn wrote: > When calling glTextureView() only certain formats are valid based on the > format > of the original texture. This tests valid/invalid combinations. > > Tested on Nvidia Quadro 600, all tests pass. > --- > tests/all.tests | 1 + > tests/spec/arb_texture_view/CMakeLists.gl.txt | 1 + > tests/spec/arb_texture_view/common.c | 48 > tests/spec/arb_texture_view/formats.c | 309 > ++ > 4 files changed, 359 insertions(+) > create mode 100644 tests/spec/arb_texture_view/common.c > create mode 100644 tests/spec/arb_texture_view/formats.c > > diff --git a/tests/all.tests b/tests/all.tests > index 2bb6aed..4d089b4 100644 > --- a/tests/all.tests > +++ b/tests/all.tests > @@ -1473,6 +1473,7 @@ arb_texture_view = Group() > spec['ARB_texture_view'] = arb_texture_view > arb_texture_view['immutable_levels'] = > concurrent_test('arb_texture_view-texture-immutable-levels') > arb_texture_view['params'] = concurrent_test('arb_texture_view-params') > +arb_texture_view['formats'] = concurrent_test('arb_texture_view-formats') > > tdfx_texture_compression_fxt1 = Group() > spec['3DFX_texture_compression_FXT1'] = tdfx_texture_compression_fxt1 > diff --git a/tests/spec/arb_texture_view/CMakeLists.gl.txt > b/tests/spec/arb_texture_view/CMakeLists.gl.txt > index 4f2b1ef..44b6a64 100644 > --- a/tests/spec/arb_texture_view/CMakeLists.gl.txt > +++ b/tests/spec/arb_texture_view/CMakeLists.gl.txt > @@ -11,5 +11,6 @@ link_libraries( > > piglit_add_executable(arb_texture_view-texture-immutable-levels > texture-immutable-levels.c) > piglit_add_executable(arb_texture_view-params params.c) > +piglit_add_executable(arb_texture_view-formats formats.c common.c) > > # vim: ft=cmake: > diff --git a/tests/spec/arb_texture_view/common.c > b/tests/spec/arb_texture_view/common.c > new file mode 100644 > index 000..c5f5a23 > --- /dev/null > +++ b/tests/spec/arb_texture_view/common.c > @@ -0,0 +1,48 @@ > +/* > + * Copyright © 2013 LunarG, 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. > + * > + * Author: Jon Ashburn > + */ > + > +#include "GL/gl.h" > +#include > + > + > +void update_valid_arrays(GLenum *valid, GLenum *invalid, > + unsigned int numInvalid, > unsigned int numValid, ... ) > +{ > + va_list args; > + GLenum val; > + unsigned int i,j; > + > + va_start(args, numValid); > + for (i = 0; i < numValid; i++) { > + val = va_arg(args, GLenum); > + valid[i] = val; > + /* remove the valid enum from the invalid array */ > + for (j= 0; j < numInvalid; j++) { > + if (invalid[j] == val) > + invalid[j] = 0; > + } > + } > + va_end(args); > +} > diff --git a/tests/spec/arb_texture_view/formats.c > b/tests/spec/arb_texture_view/formats.c > new file mode 100644 > index 000..96c3a3e > --- /dev/null > +++ b/tests/spec/arb_texture_view/formats.c > @@ -0,0 +1,309 @@ > +/* > + * Copyright © 2013 LunarG, 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 A
Re: [Piglit] [PATCH 3/3] ARB_texture_view:Test valid and invalid targets for TextureView
On 10/16/2013 04:37 PM, Jon Ashburn wrote: > The new target supplied with textureView must be compatible with the > original textures target. This tests valid and invalid combinations. > > Tested on Nvidia Quadro 600, all tests pass. > --- > tests/all.tests | 1 + > tests/spec/arb_texture_view/CMakeLists.gl.txt | 1 + > tests/spec/arb_texture_view/targets.c | 234 > ++ > 3 files changed, 236 insertions(+) > create mode 100644 tests/spec/arb_texture_view/targets.c > > diff --git a/tests/all.tests b/tests/all.tests > index 4d089b4..83d53c6 100644 > --- a/tests/all.tests > +++ b/tests/all.tests > @@ -1474,6 +1474,7 @@ spec['ARB_texture_view'] = arb_texture_view > arb_texture_view['immutable_levels'] = > concurrent_test('arb_texture_view-texture-immutable-levels') > arb_texture_view['params'] = concurrent_test('arb_texture_view-params') > arb_texture_view['formats'] = concurrent_test('arb_texture_view-formats') > +arb_texture_view['targets'] = concurrent_test('arb_texture_view-targets') > > tdfx_texture_compression_fxt1 = Group() > spec['3DFX_texture_compression_FXT1'] = tdfx_texture_compression_fxt1 > diff --git a/tests/spec/arb_texture_view/CMakeLists.gl.txt > b/tests/spec/arb_texture_view/CMakeLists.gl.txt > index 44b6a64..193aff9 100644 > --- a/tests/spec/arb_texture_view/CMakeLists.gl.txt > +++ b/tests/spec/arb_texture_view/CMakeLists.gl.txt > @@ -12,5 +12,6 @@ link_libraries( > piglit_add_executable(arb_texture_view-texture-immutable-levels > texture-immutable-levels.c) > piglit_add_executable(arb_texture_view-params params.c) > piglit_add_executable(arb_texture_view-formats formats.c common.c) > +piglit_add_executable(arb_texture_view-targets targets.c common.c) > > # vim: ft=cmake: > diff --git a/tests/spec/arb_texture_view/targets.c > b/tests/spec/arb_texture_view/targets.c > new file mode 100644 > index 000..d2c0c19 > --- /dev/null > +++ b/tests/spec/arb_texture_view/targets.c > @@ -0,0 +1,234 @@ > +/* > + * Copyright © 2013 LunarG, 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. > + * > + * Author: Jon Ashburn > + */ > + > +/** > + * \file > + * This (arb_texture_view-targets) tests valid and invalid new TextureView > + * targets based on the original textures target. > + * > + * Section 8.18 (Texture Views) of OpenGL 4.3 Core says: > + *"The new texture’s target must be compatible with the target of > + * origtexture, as defined by table 8.20." > + * > + */ > + > +#include "piglit-util-gl-common.h" > + > +PIGLIT_GL_TEST_CONFIG_BEGIN > + > + config.supports_gl_compat_version = 12; > + config.supports_gl_core_version = 31; > + > + config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE; > + > +PIGLIT_GL_TEST_CONFIG_END > + > +static const char *TestName = "arb_texture_view-targets"; > + > + > +/** > + * Do error-check tests for texture targets > + */ > +static bool > +test_target_errors(GLenum target) > +{ > + GLint width = 64, height = 14, depth = 8; > + const GLsizei levels = 1; > + GLuint tex; > + enum piglit_result pass = true; > + GLenum legalTargets[4]; > + unsigned int numTargets, i; > + GLenum illegalTargets[] = { > + /* skip multisample */ > + GL_TEXTURE_1D, > + GL_TEXTURE_2D, > + GL_TEXTURE_3D, > + GL_TEXTURE_CUBE_MAP, > + GL_TEXTURE_RECTANGLE, > + GL_TEXTURE_1D_ARRAY, > + GL_TEXTURE_2D_ARRAY, > + GL_TEXTURE_CUBE_MAP_ARRAY, > + }; > + > + /* skip 2d_multisample targets for now */ > + assert(target == GL_TEXTURE_1D || > +target == GL_TEXTURE_2D || > +target == GL_TEXTURE_3D || > +target == GL_TEXTURE_CUBE_MAP || > +target == GL_TEXTURE_RECTANGLE || >
Re: [Piglit] [PATCH 1/2] shader_runner: support SIZE in requirement section of a shader_test
On 11 October 2013 10:38, Jordan Justen wrote: > If a test requires a certain size, it adds 'SIZE Width Height' to > the requirements section. Width and Height must be unsigned > integers. > > Signed-off-by: Jordan Justen > --- > tests/shaders/shader_runner.c | 40 > +++- > 1 file changed, 27 insertions(+), 13 deletions(-) > > diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c > index fbc1964..2667aed 100644 > --- a/tests/shaders/shader_runner.c > +++ b/tests/shaders/shader_runner.c > @@ -38,22 +38,25 @@ > #include "parser_utils.h" > > static void > -get_required_versions(const char *script_name, > - struct piglit_gl_test_config *config); > +get_required_config(const char *script_name, > + struct piglit_gl_test_config *config); > GLenum > decode_drawing_mode(const char *mode_str); > > -PIGLIT_GL_TEST_CONFIG_BEGIN > +void > +get_uints(const char *line, unsigned *uints, unsigned count); > > - if (argc > 1) > - get_required_versions(argv[1], &config); > - else > - config.supports_gl_compat_version = 10; > +PIGLIT_GL_TEST_CONFIG_BEGIN > > config.window_width = 250; > config.window_height = 250; > Once we've identified all the piglit tests that require a specific size, we should come back and delete these two lines, so that shader tests that don't require a specific size will run with the piglit default window size. > config.window_visual = PIGLIT_GL_VISUAL_RGBA | > PIGLIT_GL_VISUAL_DOUBLE; > > + if (argc > 1) > + get_required_config(argv[1], &config); > + else > + config.supports_gl_compat_version = 10; > + > PIGLIT_GL_TEST_CONFIG_END > > const char passthrough_vertex_shader_source[] = > @@ -934,13 +937,15 @@ process_test_script(const char *script_name) > struct requirement_parse_results { > bool found_gl; > bool found_glsl; > + bool found_size; > struct component_version gl_version; > struct component_version glsl_version; > + unsigned size[2]; > }; > > static void > -parse_required_versions(struct requirement_parse_results *results, > -const char *script_name) > +parse_required_config(struct requirement_parse_results *results, > + const char *script_name) > { > unsigned text_size; > char *text = piglit_load_text_file(script_name, &text_size); > @@ -949,6 +954,7 @@ parse_required_versions(struct > requirement_parse_results *results, > > results->found_gl = false; > results->found_glsl = false; > + results->found_size = false; > > if (line == NULL) { > printf("could not read file \"%s\"\n", script_name); > @@ -993,6 +999,9 @@ parse_required_versions(struct > requirement_parse_results *results, > results->found_gl = true; > version_copy(&results->gl_version, > &version); > } > + } else if (string_match("SIZE", line)) { > + results->found_size = true; > + get_uints(line+4, results->size, 2); > } > } > > @@ -1018,7 +1027,7 @@ parse_required_versions(struct > requirement_parse_results *results, > > static void > choose_required_gl_version(struct requirement_parse_results > *parse_results, > - struct component_version *gl_version) > + struct component_version *gl_version) > Spurious whitespace change here. With that fixed, this patch is: Reviewed-by: Paul Berry > { > if (parse_results->found_gl) { > version_copy(gl_version, &parse_results->gl_version); > @@ -1053,15 +1062,20 @@ choose_required_gl_version(struct > requirement_parse_results *parse_results, > * the GL and GLSL version requirements. Use these to guide context > creation. > */ > void > -get_required_versions(const char *script_name, > - struct piglit_gl_test_config *config) > +get_required_config(const char *script_name, > + struct piglit_gl_test_config *config) > { > struct requirement_parse_results parse_results; > struct component_version required_gl_version; > > - parse_required_versions(&parse_results, script_name); > + parse_required_config(&parse_results, script_name); > choose_required_gl_version(&parse_results, &required_gl_version); > > + if (parse_results.found_size) { > + config->window_width = parse_results.size[0]; > + config->window_height = parse_results.size[1]; > + } > + > if (required_gl_version.es) { > config->supports_gl_es_version = required_gl_version.num; > } else if (required_gl_version.num >= 31) { > -
Re: [Piglit] [PATCH 2/2] glsl-1.50: add size requirements to 3 shader_test tests
On 11 October 2013 10:38, Jordan Justen wrote: > Signed-off-by: Jordan Justen > --- > .../spec/glsl-1.50/execution/geometry/point-size-out.shader_test |5 > +++-- > .../execution/redeclare-pervertex-out-subset-gs.shader_test |5 > +++-- > .../glsl-1.50/execution/redeclare-pervertex-subset-vs.shader_test |5 > +++-- > 3 files changed, 9 insertions(+), 6 deletions(-) > Reviewed-by: Paul Berry > > diff --git > a/tests/spec/glsl-1.50/execution/geometry/point-size-out.shader_test > b/tests/spec/glsl-1.50/execution/geometry/point-size-out.shader_test > index d5fc03c..fefdc2a 100644 > --- a/tests/spec/glsl-1.50/execution/geometry/point-size-out.shader_test > +++ b/tests/spec/glsl-1.50/execution/geometry/point-size-out.shader_test > @@ -7,11 +7,12 @@ > # > # NOTE: since gl_PointSize is expressed in pixels, but gl_Position is > # expressed relative to the window size, this test is dependent upon > -# the window size. It assumes a window size of 250x250, which is the > -# shader_runner default. > +# the window size. It uses a window size of 250x250, which is > +# specified as the size requirement for the test. > > [require] > GLSL >= 1.50 > +SIZE 250 250 > > [vertex shader] > #version 150 > diff --git > a/tests/spec/glsl-1.50/execution/redeclare-pervertex-out-subset-gs.shader_test > b/tests/spec/glsl-1.50/execution/redeclare-pervertex-out-subset-gs.shader_test > index 77309cf..ce6afbc 100644 > --- > a/tests/spec/glsl-1.50/execution/redeclare-pervertex-out-subset-gs.shader_test > +++ > b/tests/spec/glsl-1.50/execution/redeclare-pervertex-out-subset-gs.shader_test > @@ -34,11 +34,12 @@ > # > # NOTE: since gl_PointSize is expressed in pixels, but gl_Position is > # expressed relative to the window size, this test is dependent upon > -# the window size. It assumes a window size of 250x250, which is the > -# shader_runner default. > +# the window size. It uses a window size of 250x250, which is the > +# specified as the size requirement for the test. > > [require] > GLSL >= 1.50 > +SIZE 250 250 > > [vertex shader] > void main() > diff --git > a/tests/spec/glsl-1.50/execution/redeclare-pervertex-subset-vs.shader_test > b/tests/spec/glsl-1.50/execution/redeclare-pervertex-subset-vs.shader_test > index 416bb7f..e34f016 100644 > --- > a/tests/spec/glsl-1.50/execution/redeclare-pervertex-subset-vs.shader_test > +++ > b/tests/spec/glsl-1.50/execution/redeclare-pervertex-subset-vs.shader_test > @@ -34,11 +34,12 @@ > # > # NOTE: since gl_PointSize is expressed in pixels, but gl_Position is > # expressed relative to the window size, this test is dependent upon > -# the window size. It assumes a window size of 250x250, which is the > -# shader_runner default. > +# the window size. It uses a window size of 250x250, which is > +# specified as the size requirement for the test. > > [require] > GLSL >= 1.50 > +SIZE 250 250 > > [vertex shader] > in vec4 pos; > -- > 1.7.10.4 > > ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 00/10] shader_runner support for micro benchmarks
On 16 October 2013 13:33, Jordan Justen wrote: > On Wed, Oct 16, 2013 at 10:58 AM, Eric Anholt wrote: > > Jordan Justen writes: > > > >> git://people.freedesktop.org/~jljusten/piglit shader_runner-time-v1 > >> > >> I think shader_runner could be an easy way to develop > >> quick micro-benchmarks when working on performance. > >> > >> I found shader_runner only required a few tweaks to > >> be usable for this with depth clears. > >> > >> I'm not suggesting (at least in this series), that > >> we add any micro benchmark scripts to the tree. Rather > >> I would just like to make it possible to write such > >> scripts for shader_runner. > >> > >> The last patch in this series provides an example > >> usage, but I don't want that patch to be added to piglit. > > > > I don't think we should add this to shader_runner. > > So, none of the patches? > > For example, are 1 & 2 valuable? My thought is, aren't many/most > shader_test's indifferent to the window size? So, perhaps we could > shrink the default size down smaller for Linux runs? (I know windows > has some lower bound for size.) > I think patches 1 and 2 are valuable and should be kept. > > > You spent more code > > putting this in shader_runner than it would have taken to just hack > > something up standalone, > > Possibly. The shader_runner changes aren't that fancy though. > > But, I find tweaking and re-running a shader_test is faster/easier. > > Regarding the 'time' commands, I thought it might be an convenient way > to micro benchmark shader code issue, although my series doesn't do > this. But, if you don't agree that this is valuable, well, then it > probably isn't. > > > and shader_runner is already a frankenstein. > > Without a doubt. Have we officially drawn a line that shader_runner is > too much of a monster, and we should avoid adding new features to it? > I don't think we've drawn that line. Yes, shader_runner is ugly and hacky, but there's a large class of tests where it's way easier to write shader_runner tests than to write c tests. If we can broaden this class by small, incremental improvements to shader_runner, I'm all for it. If someone wants to submit some patches that make shader_runner less hacky, I'm in favor of that too. > > > I do most of my throwaway microbenchmarks in the mesa-demos repo. > > Would you be willing to consider ways to make this convenient in > piglit, such as patch 3/piglit_get_microseconds? > > -Jordan > ___ > 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 3/3] ARB_texture_view:Test valid and invalid targets for TextureView
On 10/18/2013 12:43 PM, Ian Romanick wrote: On 10/16/2013 04:37 PM, Jon Ashburn wrote: The new target supplied with textureView must be compatible with the original textures target. This tests valid and invalid combinations. Tested on Nvidia Quadro 600, all tests pass. --- tests/all.tests | 1 + tests/spec/arb_texture_view/CMakeLists.gl.txt | 1 + tests/spec/arb_texture_view/targets.c | 234 ++ 3 files changed, 236 insertions(+) create mode 100644 tests/spec/arb_texture_view/targets.c diff --git a/tests/all.tests b/tests/all.tests index 4d089b4..83d53c6 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -1474,6 +1474,7 @@ spec['ARB_texture_view'] = arb_texture_view arb_texture_view['immutable_levels'] = concurrent_test('arb_texture_view-texture-immutable-levels') arb_texture_view['params'] = concurrent_test('arb_texture_view-params') arb_texture_view['formats'] = concurrent_test('arb_texture_view-formats') +arb_texture_view['targets'] = concurrent_test('arb_texture_view-targets') tdfx_texture_compression_fxt1 = Group() spec['3DFX_texture_compression_FXT1'] = tdfx_texture_compression_fxt1 diff --git a/tests/spec/arb_texture_view/CMakeLists.gl.txt b/tests/spec/arb_texture_view/CMakeLists.gl.txt index 44b6a64..193aff9 100644 --- a/tests/spec/arb_texture_view/CMakeLists.gl.txt +++ b/tests/spec/arb_texture_view/CMakeLists.gl.txt @@ -12,5 +12,6 @@ link_libraries( piglit_add_executable(arb_texture_view-texture-immutable-levels texture-immutable-levels.c) piglit_add_executable(arb_texture_view-params params.c) piglit_add_executable(arb_texture_view-formats formats.c common.c) +piglit_add_executable(arb_texture_view-targets targets.c common.c) # vim: ft=cmake: diff --git a/tests/spec/arb_texture_view/targets.c b/tests/spec/arb_texture_view/targets.c new file mode 100644 index 000..d2c0c19 --- /dev/null +++ b/tests/spec/arb_texture_view/targets.c @@ -0,0 +1,234 @@ +/* + * Copyright © 2013 LunarG, 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. + * + * Author: Jon Ashburn + */ + +/** + * \file + * This (arb_texture_view-targets) tests valid and invalid new TextureView + * targets based on the original textures target. + * + * Section 8.18 (Texture Views) of OpenGL 4.3 Core says: + *"The new texture’s target must be compatible with the target of + * origtexture, as defined by table 8.20." + * + */ + +#include "piglit-util-gl-common.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 12; + config.supports_gl_core_version = 31; + + config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + +static const char *TestName = "arb_texture_view-targets"; + + +/** + * Do error-check tests for texture targets + */ +static bool +test_target_errors(GLenum target) +{ + GLint width = 64, height = 14, depth = 8; + const GLsizei levels = 1; + GLuint tex; + enum piglit_result pass = true; + GLenum legalTargets[4]; + unsigned int numTargets, i; + GLenum illegalTargets[] = { + /* skip multisample */ + GL_TEXTURE_1D, + GL_TEXTURE_2D, + GL_TEXTURE_3D, + GL_TEXTURE_CUBE_MAP, + GL_TEXTURE_RECTANGLE, + GL_TEXTURE_1D_ARRAY, + GL_TEXTURE_2D_ARRAY, + GL_TEXTURE_CUBE_MAP_ARRAY, + }; + + /* skip 2d_multisample targets for now */ + assert(target == GL_TEXTURE_1D || + target == GL_TEXTURE_2D || + target == GL_TEXTURE_3D || + target == GL_TEXTURE_CUBE_MAP || + target == GL_TEXTURE_RECTANGLE || + target == GL_TEXTURE_1D_ARRAY || + target == GL_TEXTURE_2D_ARRAY || + target == GL_TE
[Piglit] (no subject)
If these look okay can someone push them to fd.o public repo for me? ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 2/4] arb_texture_view: Test valid and invalid formats
When calling glTextureView() only certain formats are valid based on the format of the original texture. This tests valid/invalid combinations. Tested on Nvidia Quadro 600, all tests pass. --- tests/all.tests | 1 + tests/spec/arb_texture_view/CMakeLists.gl.txt | 1 + tests/spec/arb_texture_view/common.c | 60 + tests/spec/arb_texture_view/common.h | 28 +++ tests/spec/arb_texture_view/formats.c | 318 ++ 5 files changed, 408 insertions(+) create mode 100644 tests/spec/arb_texture_view/common.c create mode 100644 tests/spec/arb_texture_view/common.h create mode 100644 tests/spec/arb_texture_view/formats.c diff --git a/tests/all.tests b/tests/all.tests index 2bb6aed..4d089b4 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -1473,6 +1473,7 @@ arb_texture_view = Group() spec['ARB_texture_view'] = arb_texture_view arb_texture_view['immutable_levels'] = concurrent_test('arb_texture_view-texture-immutable-levels') arb_texture_view['params'] = concurrent_test('arb_texture_view-params') +arb_texture_view['formats'] = concurrent_test('arb_texture_view-formats') tdfx_texture_compression_fxt1 = Group() spec['3DFX_texture_compression_FXT1'] = tdfx_texture_compression_fxt1 diff --git a/tests/spec/arb_texture_view/CMakeLists.gl.txt b/tests/spec/arb_texture_view/CMakeLists.gl.txt index 4f2b1ef..44b6a64 100644 --- a/tests/spec/arb_texture_view/CMakeLists.gl.txt +++ b/tests/spec/arb_texture_view/CMakeLists.gl.txt @@ -11,5 +11,6 @@ link_libraries( piglit_add_executable(arb_texture_view-texture-immutable-levels texture-immutable-levels.c) piglit_add_executable(arb_texture_view-params params.c) +piglit_add_executable(arb_texture_view-formats formats.c common.c) # vim: ft=cmake: diff --git a/tests/spec/arb_texture_view/common.c b/tests/spec/arb_texture_view/common.c new file mode 100644 index 000..d45295a --- /dev/null +++ b/tests/spec/arb_texture_view/common.c @@ -0,0 +1,60 @@ +/* + * Copyright © 2013 LunarG, 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. + * + * Author: Jon Ashburn + */ + +#include "GL/gl.h" +#include + +/** + * This function takes an array of valid and invalid GLenums. The invalid + * enums array starts fully populated and the valid array is empty. + * It adds the varargs GLenum values to the valid array and removes them + * from the invalid array. + * @param numInvalid the size of array invalid + * An variable argument equal to zero will signal the end of + * the variable parameters. + */ + +unsigned int update_valid_arrays(GLenum *valid, GLenum *invalid, +unsigned int numInvalid, ... ) +{ + va_list args; + GLenum val; + unsigned int j, num; + + va_start(args, numInvalid); + val = va_arg(args, GLenum); + num = 0; + while (val) { + valid[num++] = val; + /* remove the valid enum from the invalid array */ + for (j= 0; j < numInvalid; j++) { + if (invalid[j] == val) + invalid[j] = 0; + } + val = va_arg(args, GLenum); + } + va_end(args); + return num; +} diff --git a/tests/spec/arb_texture_view/common.h b/tests/spec/arb_texture_view/common.h new file mode 100644 index 000..1ffcaea --- /dev/null +++ b/tests/spec/arb_texture_view/common.h @@ -0,0 +1,28 @@ +/* + * Copyright © 2013 LunarG, 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, subje
[Piglit] [PATCH 1/4] ARB_texture_view: Test for API coverage of subset of input params
Tests GL_ARB_texture_view and validity of input parameters. Use both valid and invalid parameters, although mostly invalid parameters are tested since other tests will use valid parameters. Only the parameters "texture", "origtexture", "minlevel", "numlevels", "minlayer", "numlayers" are tested for validity as per section 8.18 of OpenGL 4.3 Core spec. Tested on Nvidia Quadro 600 and it passes. --- tests/all.tests | 5 + tests/spec/arb_texture_view/CMakeLists.gl.txt | 1 + tests/spec/arb_texture_view/params.c | 341 ++ 3 files changed, 347 insertions(+) create mode 100644 tests/spec/arb_texture_view/params.c diff --git a/tests/all.tests b/tests/all.tests index c919f19..2bb6aed 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -1469,6 +1469,11 @@ spec['ARB_texture_storage_multisample'] = arb_texture_storage_multisample arb_texture_storage_multisample['tex-storage'] = concurrent_test('arb_texture_storage_multisample-tex-storage') arb_texture_storage_multisample['tex-param'] = concurrent_test('arb_texture_storage_multisample-tex-param') +arb_texture_view = Group() +spec['ARB_texture_view'] = arb_texture_view +arb_texture_view['immutable_levels'] = concurrent_test('arb_texture_view-texture-immutable-levels') +arb_texture_view['params'] = concurrent_test('arb_texture_view-params') + tdfx_texture_compression_fxt1 = Group() spec['3DFX_texture_compression_FXT1'] = tdfx_texture_compression_fxt1 add_concurrent_test(tdfx_texture_compression_fxt1, 'compressedteximage GL_COMPRESSED_RGB_FXT1_3DFX') diff --git a/tests/spec/arb_texture_view/CMakeLists.gl.txt b/tests/spec/arb_texture_view/CMakeLists.gl.txt index c400759..4f2b1ef 100644 --- a/tests/spec/arb_texture_view/CMakeLists.gl.txt +++ b/tests/spec/arb_texture_view/CMakeLists.gl.txt @@ -10,5 +10,6 @@ link_libraries( ) piglit_add_executable(arb_texture_view-texture-immutable-levels texture-immutable-levels.c) +piglit_add_executable(arb_texture_view-params params.c) # vim: ft=cmake: diff --git a/tests/spec/arb_texture_view/params.c b/tests/spec/arb_texture_view/params.c new file mode 100644 index 000..35de9b2 --- /dev/null +++ b/tests/spec/arb_texture_view/params.c @@ -0,0 +1,341 @@ +/* + * Copyright © 2013 LunarG, 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. + * + * Author: Jon Ashburn + */ + +/** + * Tests GL_ARB_texture_view and validity of input parameters. + * Use both valid and invalid parameters, although mostly invalid + * parameters are tested since other tests use valid parameters. + * Only the parameters "texture", "origtexture", "minlevel", "numlevels", + * "minlayer", "numlayers" are tested for validity as per section 8.18 of + * OpenGL 4.3 Core spec. + * Tests formats.c and targets.c test the valid and invalid "format" and + * "target" input parameters respectively. + * + */ + +#include "piglit-util-gl-common.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 10; + config.supports_gl_core_version = 31; + + config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + +static const char *TestName = "arb_texture_view-params"; + +/** + * Test TextureView with various invalid arguments for "texture" + * and "origtexture". + * Errors as per OpenGL core 4.3 spec section 8.18: + * "An INVALID_VALUE error is generated if origtexture is not the + * name of a texture." + * "An INVALID_OPERATION error is generated if the value of + * TEXTURE_IMMUTABLE_FORMAT for origtexture is not TRUE." + * "An INVALID_VALUE error is generated if texture is zero." + * "An INVALID_OPERATION error is generated if texture is not a valid name + * returned by GenTextures, or if texture has already been bound and + * given a target." + */ +static bool +invalid_texture_param() +{ + bool
[Piglit] [PATCH 3/4] ARB_texture_view:Test valid and invalid targets for TextureView
The new target supplied with textureView must be compatible with the original textures target. This tests valid and invalid combinations. Tested on Nvidia Quadro 600, all tests pass. --- tests/all.tests | 1 + tests/spec/arb_texture_view/CMakeLists.gl.txt | 1 + tests/spec/arb_texture_view/targets.c | 240 ++ 3 files changed, 242 insertions(+) create mode 100644 tests/spec/arb_texture_view/targets.c diff --git a/tests/all.tests b/tests/all.tests index 4d089b4..83d53c6 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -1474,6 +1474,7 @@ spec['ARB_texture_view'] = arb_texture_view arb_texture_view['immutable_levels'] = concurrent_test('arb_texture_view-texture-immutable-levels') arb_texture_view['params'] = concurrent_test('arb_texture_view-params') arb_texture_view['formats'] = concurrent_test('arb_texture_view-formats') +arb_texture_view['targets'] = concurrent_test('arb_texture_view-targets') tdfx_texture_compression_fxt1 = Group() spec['3DFX_texture_compression_FXT1'] = tdfx_texture_compression_fxt1 diff --git a/tests/spec/arb_texture_view/CMakeLists.gl.txt b/tests/spec/arb_texture_view/CMakeLists.gl.txt index 44b6a64..193aff9 100644 --- a/tests/spec/arb_texture_view/CMakeLists.gl.txt +++ b/tests/spec/arb_texture_view/CMakeLists.gl.txt @@ -12,5 +12,6 @@ link_libraries( piglit_add_executable(arb_texture_view-texture-immutable-levels texture-immutable-levels.c) piglit_add_executable(arb_texture_view-params params.c) piglit_add_executable(arb_texture_view-formats formats.c common.c) +piglit_add_executable(arb_texture_view-targets targets.c common.c) # vim: ft=cmake: diff --git a/tests/spec/arb_texture_view/targets.c b/tests/spec/arb_texture_view/targets.c new file mode 100644 index 000..a2462e7 --- /dev/null +++ b/tests/spec/arb_texture_view/targets.c @@ -0,0 +1,240 @@ +/* + * Copyright © 2013 LunarG, 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. + * + * Author: Jon Ashburn + */ + +/** + * \file + * This (arb_texture_view-targets) tests valid and invalid new TextureView + * targets based on the original textures target. + * + * Section 8.18 (Texture Views) of OpenGL 4.3 Core says: + *"The new texture’s target must be compatible with the target of + * origtexture, as defined by table 8.20." + * + */ + +#include "piglit-util-gl-common.h" +#include "common.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 12; + config.supports_gl_core_version = 31; + + config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + +static const char *TestName = "arb_texture_view-targets"; + +/** + * Iterate through array of texture targets and check if call to TextureView + * causes the gl error "err" + */ +static bool check_target_array(const GLenum err, const unsigned int numTargets, + const GLenum *targetArray, const GLenum format, + const GLuint tex, const GLuint levels) +{ + unsigned int i; + bool pass = true; + + for (i = 0; i < numTargets; i++) { + GLenum target; + GLuint newTex, layers=1; + target = targetArray[i]; + if (target == 0) + continue; + glGenTextures(1, &newTex); + if (target== GL_TEXTURE_CUBE_MAP) + layers = 6; + else if (target == GL_TEXTURE_CUBE_MAP_ARRAY) + layers = 12; + + glTextureView(newTex, target, tex, format, 0, levels, 0, + layers); + glDeleteTextures(1, &newTex); + if (!piglit_check_gl_error(err)) { + pass = false; + break; + } + } + return pass; +} + +/** + * Do error-ch
[Piglit] [PATCH 4/4] ARB_texture_view: Add query tests for gl state effected by this extension
Tests the queryable state from ARB_texture_view extension is correct. Includes GL_TEXTURE_IMMUTABLE_LEVELS,GL_TEXTURE_VIEW_MIN_LEVEL, GL_TEXTURE_VIEW_NUM_LEVELS, GL_TEXTURE_IMMUTABLE_FORMAT. Tested on Nvidia Quadro 600, all subtests pass. --- tests/all.tests | 1 + tests/spec/arb_texture_view/CMakeLists.gl.txt | 1 + tests/spec/arb_texture_view/queries.c | 311 ++ 3 files changed, 313 insertions(+) create mode 100644 tests/spec/arb_texture_view/queries.c diff --git a/tests/all.tests b/tests/all.tests index 83d53c6..8784e24 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -1475,6 +1475,7 @@ arb_texture_view['immutable_levels'] = concurrent_test('arb_texture_view-texture arb_texture_view['params'] = concurrent_test('arb_texture_view-params') arb_texture_view['formats'] = concurrent_test('arb_texture_view-formats') arb_texture_view['targets'] = concurrent_test('arb_texture_view-targets') +arb_texture_view['queries'] = concurrent_test('arb_texture_view-queries') tdfx_texture_compression_fxt1 = Group() spec['3DFX_texture_compression_FXT1'] = tdfx_texture_compression_fxt1 diff --git a/tests/spec/arb_texture_view/CMakeLists.gl.txt b/tests/spec/arb_texture_view/CMakeLists.gl.txt index 193aff9..6945a05 100644 --- a/tests/spec/arb_texture_view/CMakeLists.gl.txt +++ b/tests/spec/arb_texture_view/CMakeLists.gl.txt @@ -13,5 +13,6 @@ piglit_add_executable(arb_texture_view-texture-immutable-levels texture-immutabl piglit_add_executable(arb_texture_view-params params.c) piglit_add_executable(arb_texture_view-formats formats.c common.c) piglit_add_executable(arb_texture_view-targets targets.c common.c) +piglit_add_executable(arb_texture_view-queries queries.c) # vim: ft=cmake: diff --git a/tests/spec/arb_texture_view/queries.c b/tests/spec/arb_texture_view/queries.c new file mode 100644 index 000..628aa79 --- /dev/null +++ b/tests/spec/arb_texture_view/queries.c @@ -0,0 +1,311 @@ +/* + * Copyright © 2013 LunarG, 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. + * + * Author: Jon Ashburn + */ + +/** + * Tests GL_ARB_texture_view queries of new state added by this extension + * + */ + +#include "piglit-util-gl-common.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 10; + config.supports_gl_core_version = 31; + + config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + +/** + * make sure default intial state is correct for textureView + * In OpenGL Core 4.3 spec see table 23.15 for default values. + */ +static bool +query_default_state(void) +{ + bool pass = true; + GLuint tex[2]; + GLint param; + + glGenTextures(2,tex); + glBindTexture(GL_TEXTURE_CUBE_MAP, tex[0]); + glTexStorage2D(GL_TEXTURE_CUBE_MAP, 7, GL_R32F, 64, 64); + glTextureView(tex[1], GL_TEXTURE_CUBE_MAP, tex[0], GL_RG16I, 2, 4, 0, 6); + glBindTexture(GL_TEXTURE_CUBE_MAP, tex[1]); + glDeleteTextures(1, &tex[1]); + /* tex[1] which is bound to GL_TEXTURE_CUBE_MAP is deleted */ + + glGetTexParameteriv(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_VIEW_MIN_LEVEL, + ¶m); + if (param != 0) { + printf("bad default of min_level, expected 0 got %u\n", param); + pass = false; + } + glGetTexParameteriv(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_VIEW_NUM_LEVELS, + ¶m); + if (param != 0) { + printf("bad default of num_levels, expected 0 got %u\n", param); + pass = false; + } + glGetTexParameteriv(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_VIEW_MIN_LAYER, + ¶m); + if (param != 0) { + printf("bad default of min_layer, expected 0
Re: [Piglit] [PATCH 1/4] ARB_texture_view: Test for API coverage of subset of input params
On 10/18/2013 05:06 PM, Jon Ashburn wrote: Tests GL_ARB_texture_view and validity of input parameters. Use both valid and invalid parameters, although mostly invalid parameters are tested since other tests will use valid parameters. Only the parameters "texture", "origtexture", "minlevel", "numlevels", "minlayer", "numlayers" are tested for validity as per section 8.18 of OpenGL 4.3 Core spec. Tested on Nvidia Quadro 600 and it passes. --- tests/all.tests | 5 + tests/spec/arb_texture_view/CMakeLists.gl.txt | 1 + tests/spec/arb_texture_view/params.c | 341 ++ 3 files changed, 347 insertions(+) create mode 100644 tests/spec/arb_texture_view/params.c diff --git a/tests/all.tests b/tests/all.tests index c919f19..2bb6aed 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -1469,6 +1469,11 @@ spec['ARB_texture_storage_multisample'] = arb_texture_storage_multisample arb_texture_storage_multisample['tex-storage'] = concurrent_test('arb_texture_storage_multisample-tex-storage') arb_texture_storage_multisample['tex-param'] = concurrent_test('arb_texture_storage_multisample-tex-param') +arb_texture_view = Group() +spec['ARB_texture_view'] = arb_texture_view +arb_texture_view['immutable_levels'] = concurrent_test('arb_texture_view-texture-immutable-levels') +arb_texture_view['params'] = concurrent_test('arb_texture_view-params') + tdfx_texture_compression_fxt1 = Group() spec['3DFX_texture_compression_FXT1'] = tdfx_texture_compression_fxt1 add_concurrent_test(tdfx_texture_compression_fxt1, 'compressedteximage GL_COMPRESSED_RGB_FXT1_3DFX') diff --git a/tests/spec/arb_texture_view/CMakeLists.gl.txt b/tests/spec/arb_texture_view/CMakeLists.gl.txt index c400759..4f2b1ef 100644 --- a/tests/spec/arb_texture_view/CMakeLists.gl.txt +++ b/tests/spec/arb_texture_view/CMakeLists.gl.txt @@ -10,5 +10,6 @@ link_libraries( ) piglit_add_executable(arb_texture_view-texture-immutable-levels texture-immutable-levels.c) +piglit_add_executable(arb_texture_view-params params.c) # vim: ft=cmake: diff --git a/tests/spec/arb_texture_view/params.c b/tests/spec/arb_texture_view/params.c new file mode 100644 index 000..35de9b2 --- /dev/null +++ b/tests/spec/arb_texture_view/params.c @@ -0,0 +1,341 @@ +/* + * Copyright © 2013 LunarG, 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. + * + * Author: Jon Ashburn + */ + +/** + * Tests GL_ARB_texture_view and validity of input parameters. + * Use both valid and invalid parameters, although mostly invalid + * parameters are tested since other tests use valid parameters. + * Only the parameters "texture", "origtexture", "minlevel", "numlevels", + * "minlayer", "numlayers" are tested for validity as per section 8.18 of + * OpenGL 4.3 Core spec. + * Tests formats.c and targets.c test the valid and invalid "format" and + * "target" input parameters respectively. + * + */ + +#include "piglit-util-gl-common.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 10; + config.supports_gl_core_version = 31; + + config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + +static const char *TestName = "arb_texture_view-params"; + +/** + * Test TextureView with various invalid arguments for "texture" + * and "origtexture". + * Errors as per OpenGL core 4.3 spec section 8.18: + * "An INVALID_VALUE error is generated if origtexture is not the + * name of a texture." + * "An INVALID_OPERATION error is generated if the value of + * TEXTURE_IMMUTABLE_FORMAT for origtexture is not TRUE." + * "An INVALID_VALUE error is generated if texture is zero." + * "An INVALID_OPERATION error is generated if texture is not a valid name + * returned by GenTextures, or if texture has already been bound and + * given a target." + */
Re: [Piglit] [PATCH 2/4] arb_texture_view: Test valid and invalid formats
The same formatting nitpicks from patch 1 apply to this patch and #3. More below. On 10/18/2013 05:06 PM, Jon Ashburn wrote: When calling glTextureView() only certain formats are valid based on the format of the original texture. This tests valid/invalid combinations. Tested on Nvidia Quadro 600, all tests pass. --- tests/all.tests | 1 + tests/spec/arb_texture_view/CMakeLists.gl.txt | 1 + tests/spec/arb_texture_view/common.c | 60 + tests/spec/arb_texture_view/common.h | 28 +++ tests/spec/arb_texture_view/formats.c | 318 ++ 5 files changed, 408 insertions(+) create mode 100644 tests/spec/arb_texture_view/common.c create mode 100644 tests/spec/arb_texture_view/common.h create mode 100644 tests/spec/arb_texture_view/formats.c diff --git a/tests/all.tests b/tests/all.tests index 2bb6aed..4d089b4 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -1473,6 +1473,7 @@ arb_texture_view = Group() spec['ARB_texture_view'] = arb_texture_view arb_texture_view['immutable_levels'] = concurrent_test('arb_texture_view-texture-immutable-levels') arb_texture_view['params'] = concurrent_test('arb_texture_view-params') +arb_texture_view['formats'] = concurrent_test('arb_texture_view-formats') tdfx_texture_compression_fxt1 = Group() spec['3DFX_texture_compression_FXT1'] = tdfx_texture_compression_fxt1 diff --git a/tests/spec/arb_texture_view/CMakeLists.gl.txt b/tests/spec/arb_texture_view/CMakeLists.gl.txt index 4f2b1ef..44b6a64 100644 --- a/tests/spec/arb_texture_view/CMakeLists.gl.txt +++ b/tests/spec/arb_texture_view/CMakeLists.gl.txt @@ -11,5 +11,6 @@ link_libraries( piglit_add_executable(arb_texture_view-texture-immutable-levels texture-immutable-levels.c) piglit_add_executable(arb_texture_view-params params.c) +piglit_add_executable(arb_texture_view-formats formats.c common.c) # vim: ft=cmake: diff --git a/tests/spec/arb_texture_view/common.c b/tests/spec/arb_texture_view/common.c new file mode 100644 index 000..d45295a --- /dev/null +++ b/tests/spec/arb_texture_view/common.c @@ -0,0 +1,60 @@ +/* + * Copyright © 2013 LunarG, 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. + * + * Author: Jon Ashburn + */ + +#include "GL/gl.h" +#include + +/** + * This function takes an array of valid and invalid GLenums. The invalid + * enums array starts fully populated and the valid array is empty. + * It adds the varargs GLenum values to the valid array and removes them + * from the invalid array. + * @param numInvalid the size of array invalid + * An variable argument equal to zero will signal the end of + * the variable parameters. + */ + +unsigned int update_valid_arrays(GLenum *valid, GLenum *invalid, +unsigned int numInvalid, ... ) +{ + va_list args; + GLenum val; + unsigned int j, num; + + va_start(args, numInvalid); + val = va_arg(args, GLenum); + num = 0; + while (val) { + valid[num++] = val; + /* remove the valid enum from the invalid array */ + for (j= 0; j < numInvalid; j++) { + if (invalid[j] == val) + invalid[j] = 0; + } + val = va_arg(args, GLenum); + } + va_end(args); + return num; +} diff --git a/tests/spec/arb_texture_view/common.h b/tests/spec/arb_texture_view/common.h new file mode 100644 index 000..1ffcaea --- /dev/null +++ b/tests/spec/arb_texture_view/common.h @@ -0,0 +1,28 @@ +/* + * Copyright © 2013 LunarG, 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, publi
Re: [Piglit] [PATCH] Test that all desktop GLSL versions can be cross-linked.
Paul Berry writes: > Verified using the NVIDIA proprietary driver for Linux (version > 313.18). Reviewed-by: Eric Anholt pgpp0KT1pe0lv.pgp Description: PGP signature ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] util/x11: Propagate window resize events to piglit_width/height
Chad Versace writes: > When I switched Piglit from GLUT to Waffle, I broke detection of X11 > window resizes. When the user resized the window, Piglit called > piglit_display() but neglected to update piglit_width/height. > > This patch ensures that Piglit updates piglit_width/height correctly. > > (It's amazing that it took this long for anyone to fix it. People must > rarely resize Piglit windows). ConfigureNotify tells you the new size. And I'm not clear why you'd need to update the size at Expose time. pgpsURY4HoUGV.pgp Description: PGP signature ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 00/10] shader_runner support for micro benchmarks
Paul Berry writes: > On 16 October 2013 13:33, Jordan Justen wrote: > >> On Wed, Oct 16, 2013 at 10:58 AM, Eric Anholt wrote: >> > Jordan Justen writes: >> > >> >> git://people.freedesktop.org/~jljusten/piglit shader_runner-time-v1 >> >> >> >> I think shader_runner could be an easy way to develop >> >> quick micro-benchmarks when working on performance. >> >> >> >> I found shader_runner only required a few tweaks to >> >> be usable for this with depth clears. >> >> >> >> I'm not suggesting (at least in this series), that >> >> we add any micro benchmark scripts to the tree. Rather >> >> I would just like to make it possible to write such >> >> scripts for shader_runner. >> >> >> >> The last patch in this series provides an example >> >> usage, but I don't want that patch to be added to piglit. >> > >> > I don't think we should add this to shader_runner. >> >> So, none of the patches? >> >> For example, are 1 & 2 valuable? My thought is, aren't many/most >> shader_test's indifferent to the window size? So, perhaps we could >> shrink the default size down smaller for Linux runs? (I know windows >> has some lower bound for size.) >> > > I think patches 1 and 2 are valuable and should be kept. > > >> >> > You spent more code >> > putting this in shader_runner than it would have taken to just hack >> > something up standalone, >> >> Possibly. The shader_runner changes aren't that fancy though. >> >> But, I find tweaking and re-running a shader_test is faster/easier. >> >> Regarding the 'time' commands, I thought it might be an convenient way >> to micro benchmark shader code issue, although my series doesn't do >> this. But, if you don't agree that this is valuable, well, then it >> probably isn't. >> >> > and shader_runner is already a frankenstein. >> >> Without a doubt. Have we officially drawn a line that shader_runner is >> too much of a monster, and we should avoid adding new features to it? >> > > I don't think we've drawn that line. Yes, shader_runner is ugly and hacky, > but there's a large class of tests where it's way easier to write > shader_runner tests than to write c tests. If we can broaden this class by > small, incremental improvements to shader_runner, I'm all for it. > > If someone wants to submit some patches that make shader_runner less hacky, > I'm in favor of that too. Agreed -- shader_runner should get new features when it lets us write piglit tests more easily/understandably. But I do think there should be a line drawn at "features not required for piglit tests" -- we have mesa-demos for misc GL things that aren't related to automated regression testing. pgp11qVngiK_e.pgp Description: PGP signature ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] util/x11: Propagate window resize events to piglit_width/height
On 10/18/2013 05:19 PM, Eric Anholt wrote: Chad Versace writes: When I switched Piglit from GLUT to Waffle, I broke detection of X11 window resizes. When the user resized the window, Piglit called piglit_display() but neglected to update piglit_width/height. This patch ensures that Piglit updates piglit_width/height correctly. (It's amazing that it took this long for anyone to fix it. People must rarely resize Piglit windows). ConfigureNotify tells you the new size. And I'm not clear why you'd need to update the size at Expose time. I admit that I don't understand X protocol. I knew that ConfigureNotify tells us the size, and I was unsure if Expose did also. So I played it safe and updated the size on both events. So, the size update on Event needs to get removed. Is there a cleaner way to get the window size from the ConfigureNotify event than calling XGetGeometry? ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit