Re: [Piglit] [PATCH] arb_arrays_of_arrays: compile test basic types
On 31/03/15 00:17, Timothy Arceri wrote: On Mon, 2015-03-30 at 10:51 +0300, Martin Peres wrote: On 30/03/15 10:29, Timothy Arceri wrote: Test results: Nvidia GeForce 840M - NVIDIA 346.47: pass --- This is just /tests/spec/glsl-1.20/compiler/structure-and-array-operations/array-of-any-type.vert with an extra dimension added. Do you have any other test that would cover more than just the grammar? Maybe you already sent them (possibly a while ago), sorry if this is the case. Yeah there are a bunch of tests already in piglit that I've submitted over the past year. The main reason for this test is that I haven't got any tests for sampler arrays of arrays so this seemed like a nice test to start things off with. Good luck with it then. ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] arb_arrays_of_arrays: compile test basic types
On 30/03/15 10:29, Timothy Arceri wrote: Test results: Nvidia GeForce 840M - NVIDIA 346.47: pass --- This is just /tests/spec/glsl-1.20/compiler/structure-and-array-operations/array-of-any-type.vert with an extra dimension added. .../compiler/arrays-of-any-type.vert | 44 ++ 1 file changed, 44 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert diff --git a/tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert b/tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert new file mode 100644 index 000..0ce45da --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert @@ -0,0 +1,44 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "All basic types and structures can be formed into arrays." + */ +#version 120 +#extension GL_ARB_arrays_of_arrays: enable + +uniform float array01[1][1]; +uniform int array02[1][1]; For the sake of completeness: uint and double are missing here. +uniform bool array03[1][1]; +uniform vec2 array04[1][1]; +uniform vec3 array05[1][1]; +uniform vec4 array06[1][1]; +uniform ivec2 array07[1][1]; +uniform ivec3 array08[1][1]; +uniform ivec4 array09[1][1]; uvec and dvec? +uniform bvec2 array10[1][1]; +uniform bvec3 array11[1][1]; +uniform bvec4 array12[1][1]; +uniform mat2 array13[1][1]; +uniform mat2x2 array14[1][1]; +uniform mat2x3 array15[1][1]; +uniform mat2x4 array16[1][1]; +uniform mat3 array17[1][1]; +uniform mat3x2 array18[1][1]; +uniform mat3x3 array19[1][1]; +uniform mat3x4 array20[1][1]; +uniform mat4 array21[1][1]; +uniform mat4x2 array22[1][1]; +uniform mat4x3 array23[1][1]; +uniform mat4x4 array24[1][1]; +uniform sampler1D array25[1][1]; +uniform sampler2D array26[1][1]; +uniform sampler3D array27[1][1]; +uniform samplerCube array28[1][1]; +uniform sampler1DShadow array29[1][1]; +uniform sampler2DShadow array30[1][1]; There quite a few missing here: samplerCubeShadow, sampler2DRectShadow, sampler1DArrayShadow, sampler2DArrayShadow, samplerCubeArrayShadow, sampler2DRect, and more. Also, you do not test samplers for integers and unsigned. I know it is boring but only by increasing coverage can we really test for non-regression in non-trivial cases (AKA, the ones that make us loose time when debugging). It would be great if you could already add tests for image load store and atomic counters so at it puts the burden of making sure this extension still works when they get enabled. Of course, they would need to be in separate tests. Other than that, I like the idea. Plain simple but quite necessary. + +void main() { gl_Position = vec4(0.0); } ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 05/14] arb_direct_state_access: Add a test for glVertexArrayAttrib[I|L]Format
This test verifies that glVertexArrayAttribFormat, glVertexArrayAttribIFormat and glVertexArrayAttribLFormat work as expected. --- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + .../arb_direct_state_access/vao-attrib-format.c| 791 + 3 files changed, 793 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/vao-attrib-format.c diff --git a/tests/all.py b/tests/all.py index cfa2a96..9f2f3ef 100755 --- a/tests/all.py +++ b/tests/all.py @@ -4282,6 +4282,7 @@ with profile.group_manager( g(['arb_direct_state_access-create-queries'], 'create-queries') g(['arb_direct_state_access-vao-create'], 'vao-create') g(['arb_direct_state_access-vao-attrib-enabledisable'], 'vao-attrib-enabledisable') +g(['arb_direct_state_access-vao-attrib-format'], 'vao-attrib-format') with profile.group_manager( PiglitGLTest, diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index 4ee9c0c..e5596be 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -38,4 +38,5 @@ piglit_add_executable (arb_direct_state_access-create-programpipelines create-pr piglit_add_executable (arb_direct_state_access-create-queries create-queries.c) piglit_add_executable (arb_direct_state_access-vao-create vao-create.c) piglit_add_executable (arb_direct_state_access-vao-attrib-enabledisable vao-attrib-enabledisable.c dsa-utils.c) +piglit_add_executable (arb_direct_state_access-vao-attrib-format vao-attrib-format.c dsa-utils.c) # vim: ft=cmake: diff --git a/tests/spec/arb_direct_state_access/vao-attrib-format.c b/tests/spec/arb_direct_state_access/vao-attrib-format.c new file mode 100644 index 000..807176f --- /dev/null +++ b/tests/spec/arb_direct_state_access/vao-attrib-format.c @@ -0,0 +1,791 @@ +/* + * Copyright (C) 2015 Fredrik Höglund + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * @file vao-attrib-format.c + * + * Verifies that glVertexArrayAttribFormat, glVertexArrayAttribIFormat and + * glVertexArrayAttribLFormat work as expected. + */ + +#include "piglit-util-gl.h" +#include "dsa-utils.h" + + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_core_version = 31; + config.supports_gl_compat_version = 20; + + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + + +static bool ARB_ES2_compatibility; +static bool ARB_half_float_vertex; +static bool ARB_vertex_type_2_10_10_10_rev; +static bool ARB_vertex_type_10f_11f_11f_rev; +static bool ARB_vertex_array_64bit; +static bool ARB_vertex_array_bgra; + + +enum piglit_result +piglit_display(void) +{ + /* unreached */ + return PIGLIT_FAIL; +} + + +/** + * Returns true if the format of attribindex matches the expected + * format, and false otherwise. + */ +bool +check_attrib_format_(GLuint vao, GLuint attribindex, GLuint size, GLenum type, + GLboolean normalized, GLboolean integer, GLboolean _long, + GLuint relativeOffset, int line) +{ + bool ret = true; + + ret = check_indexed_vao_param_(vao, attribindex, + GL_VERTEX_ATTRIB_ARRAY_SIZE, + size, __FILE__, line) && ret; + ret = check_indexed_vao_param_(vao, attribindex, + GL_VERTEX_ATTRIB_ARRAY_TYPE, + type, __FILE__, line) && ret; + ret = check_indexed_vao_param_(vao, attribindex, + GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, + normalized, __FILE__, line) && ret; + + if (piglit_get_gl_version() >= 30) { + ret = check_in
[Piglit] [PATCH 09/14] arb_direct_state_access: Add a test for glVertexArrayVertexBuffer
This test verifies that glVertexArrayVertexBuffer works as expected. --- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + .../arb_direct_state_access/vao-vertex-buffer.c| 140 + 3 files changed, 142 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/vao-vertex-buffer.c diff --git a/tests/all.py b/tests/all.py index 6b44069..b972610 100755 --- a/tests/all.py +++ b/tests/all.py @@ -4286,6 +4286,7 @@ with profile.group_manager( g(['arb_direct_state_access-vao-attrib-binding'], 'vao-attrib-binding') g(['arb_direct_state_access-vao-binding-divisor'], 'vao-binding-divisor') g(['arb_direct_state_access-vao-element-array-buffer'], 'vao-element-array-buffer') +g(['arb_direct_state_access-vao-vertex-buffer'], 'vao-vertex-buffer') with profile.group_manager( PiglitGLTest, diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index fe17530..820971f 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -42,4 +42,5 @@ piglit_add_executable (arb_direct_state_access-vao-attrib-format vao-attrib-form piglit_add_executable (arb_direct_state_access-vao-attrib-binding vao-attrib-binding.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-vao-binding-divisor vao-binding-divisor.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-vao-element-array-buffer vao-element-array-buffer.c) +piglit_add_executable (arb_direct_state_access-vao-vertex-buffer vao-vertex-buffer.c dsa-utils.c) # vim: ft=cmake: diff --git a/tests/spec/arb_direct_state_access/vao-vertex-buffer.c b/tests/spec/arb_direct_state_access/vao-vertex-buffer.c new file mode 100644 index 000..dde03fb --- /dev/null +++ b/tests/spec/arb_direct_state_access/vao-vertex-buffer.c @@ -0,0 +1,140 @@ +/* + * Copyright (C) 2015 Fredrik Höglund + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * @file vao-vertex-buffer.c + * + * Verifies that glVertexArrayVertexBuffer works as expected. + */ + +#include "piglit-util-gl.h" +#include "dsa-utils.h" + +#include + + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_core_version = 31; + config.supports_gl_compat_version = 20; + + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + + +enum piglit_result +piglit_display(void) +{ + /* unreached */ + return PIGLIT_FAIL; +} + + +void +piglit_init(int argc, char *argv[]) +{ + GLuint vao, buffers[4]; + bool pass = true; + int i; + + /* See table 23.55 in the OpenGL 4.5 (Core Profile) spec */ + GLuint maxStride = 2048; + GLuint maxBindings; + + piglit_require_extension("GL_ARB_direct_state_access"); + piglit_require_extension("GL_ARB_vertex_array_object"); + piglit_require_extension("GL_ARB_vertex_attrib_binding"); + + glGetIntegerv(GL_MAX_VERTEX_ATTRIB_BINDINGS, (GLint *) &maxBindings); + + if (piglit_get_gl_version() >= 44) + glGetIntegerv(GL_MAX_VERTEX_ATTRIB_STRIDE, (GLint *) &maxStride); + + /* Create a VAO */ + glCreateVertexArrays(1, &vao); + + /* Create a set of buffer objects */ + glCreateBuffers(ARRAY_SIZE(buffers), buffers); + + for (i = 0; i < maxBindings; i++) { + const GLintptr offset = rand() % INT_MAX; + const GLsizeiptr stride = rand() % (maxStride + 1); + const GLuint vbo = buffers[rand() % ARRAY_SIZE(buffers)]; + + /* Verify that no VBO is bound by default */ + pass = check_vbo_binding(vao, i, 0, 0, 16) && pass; + + /* Change the VBO binding and verify that it was changed */ + glVertexArrayVerte
[Piglit] [PATCH 03/14] arb_direct_state_access: Add a test for glCreateVertexArrays
This test verifies that glCreateVertexArrays works as expected. --- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + tests/spec/arb_direct_state_access/vao-create.c| 143 + 3 files changed, 145 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/vao-create.c diff --git a/tests/all.py b/tests/all.py index d0815da..441ea77 100755 --- a/tests/all.py +++ b/tests/all.py @@ -4280,6 +4280,7 @@ with profile.group_manager( g(['arb_direct_state_access-create-programpipelines'], 'create-programpipelines') g(['arb_direct_state_access-create-queries'], 'create-queries') +g(['arb_direct_state_access-vao-create'], 'vao-create') with profile.group_manager( PiglitGLTest, diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index a5ae423..9fcbf7e 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -36,4 +36,5 @@ piglit_add_executable (arb_direct_state_access-texture-buffer texture-buffer.c) piglit_add_executable (arb_direct_state_access-create-samplers create-samplers.c) piglit_add_executable (arb_direct_state_access-create-programpipelines create-programpipelines.c) piglit_add_executable (arb_direct_state_access-create-queries create-queries.c) +piglit_add_executable (arb_direct_state_access-vao-create vao-create.c) # vim: ft=cmake: diff --git a/tests/spec/arb_direct_state_access/vao-create.c b/tests/spec/arb_direct_state_access/vao-create.c new file mode 100644 index 000..1a124e7 --- /dev/null +++ b/tests/spec/arb_direct_state_access/vao-create.c @@ -0,0 +1,143 @@ +/* + * Copyright (C) 2015 Fredrik Höglund + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * @file vao-create.c + * + * Verifies that glCreateVertexArrays works as expected. + */ + +#include "piglit-util-gl.h" + + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_core_version = 32; + config.supports_gl_compat_version = 20; + + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + + +enum piglit_result +piglit_display(void) +{ + /* unreached */ + return PIGLIT_FAIL; +} + + +/** + * Returns true if expected is bound as the current VAO, + * and false otherwise. + */ +static bool +check_vao_binding_(GLuint expected, int line) +{ + GLuint binding; + glGetIntegerv(GL_VERTEX_ARRAY_BINDING, (GLint *) &binding); + + if (binding != expected) { + fprintf(stderr, "GL_VERTEX_ARRAY_BINDING " + "was %u, expected %u (%s:%d)\n", + binding, expected, __FILE__, line); + return false; + } + + return true; +} + + +#define check_vao_binding(expected) \ + check_vao_binding_(expected, __LINE__) + + +void +piglit_init(int argc, char *argv[]) +{ + GLuint vaos[4]; + bool pass = true; + int i; + + piglit_require_extension("GL_ARB_direct_state_access"); + piglit_require_extension("GL_ARB_vertex_array_object"); + + /* Page 332 of the PDF of the OpenGL 4.5 (Core Profile) spec says: +* +* "CreateVertexArrays returns n previously unused vertex array object +* names in arrays, each representing a state vector comprising all +* the state and with the same initial values listed in tables 23.3 +* and 23.4." +*/ + glCreateVertexArrays(4, vaos); + pass = piglit_check_gl_error(GL_NO_ERROR) && pass; + + /* Verify that the arrays were created */ + for (i = 0; i < 4; i++) + pass = glIsVertexArray(vaos[i]) && pass; + + /* Bind the first vao and verify that it was bound */ + glBindVertexArray(vaos[0]); +
[Piglit] [PATCH 10/14] arb_direct_state_access: Add a test for glVertexArrayVertexBuffers
This test verifies that glVertexArrayVertexBuffers works as expected. --- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + .../arb_direct_state_access/vao-vertex-buffers.c | 351 + 3 files changed, 353 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/vao-vertex-buffers.c diff --git a/tests/all.py b/tests/all.py index b972610..d0730d4 100755 --- a/tests/all.py +++ b/tests/all.py @@ -4287,6 +4287,7 @@ with profile.group_manager( g(['arb_direct_state_access-vao-binding-divisor'], 'vao-binding-divisor') g(['arb_direct_state_access-vao-element-array-buffer'], 'vao-element-array-buffer') g(['arb_direct_state_access-vao-vertex-buffer'], 'vao-vertex-buffer') +g(['arb_direct_state_access-vao-vertex-buffers'], 'vao-vertex-buffers') with profile.group_manager( PiglitGLTest, diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index 820971f..41e5c46 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -43,4 +43,5 @@ piglit_add_executable (arb_direct_state_access-vao-attrib-binding vao-attrib-bin piglit_add_executable (arb_direct_state_access-vao-binding-divisor vao-binding-divisor.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-vao-element-array-buffer vao-element-array-buffer.c) piglit_add_executable (arb_direct_state_access-vao-vertex-buffer vao-vertex-buffer.c dsa-utils.c) +piglit_add_executable (arb_direct_state_access-vao-vertex-buffers vao-vertex-buffers.c dsa-utils.c) # vim: ft=cmake: diff --git a/tests/spec/arb_direct_state_access/vao-vertex-buffers.c b/tests/spec/arb_direct_state_access/vao-vertex-buffers.c new file mode 100644 index 000..6c47376 --- /dev/null +++ b/tests/spec/arb_direct_state_access/vao-vertex-buffers.c @@ -0,0 +1,351 @@ +/* + * Copyright (C) 2015 Fredrik Höglund + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * @file vao-vertex-buffers.c + * + * Verifies that glVertexArrayVertexBuffers works as expected. + */ + +#include "piglit-util-gl.h" +#include "dsa-utils.h" + +#include + + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_core_version = 31; + config.supports_gl_compat_version = 20; + + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + + +enum piglit_result +piglit_display(void) +{ + /* unreached */ + return PIGLIT_FAIL; +} + + +/** + * Returns vertex buffer bindings first through first+count + * in the buffers, offsets and strides parameters. + */ +static void +get_vbo_bindings(GLuint vao, GLuint first, GLuint count, + GLuint *buffers, GLintptr *offsets, GLsizei *strides) +{ + GLuint i; + + for (i = 0; i < count; i++) { + GLuint buffer, offset, stride; + glGetVertexArrayIndexediv(vao, first + i, + GL_VERTEX_BINDING_BUFFER, + (GLint *) &buffer); + glGetVertexArrayIndexediv(vao, first + i, + GL_VERTEX_BINDING_OFFSET, + (GLint *) &offset); + glGetVertexArrayIndexediv(vao, first + i, + GL_VERTEX_BINDING_STRIDE, + (GLint *) &stride); + + buffers[i] = buffer; + offsets[i] = offset; + strides[i] = stride; + } +} + + +/** + * Returns true if vertex buffer bindings first through first+count match + * the values in buffers, offsets and strides, and false otherwise. + */ +static bool +check_vbo_bindings_(GLuint vao, GLuint first, GLsizei count, +
[Piglit] [PATCH 12/14] arb_direct_state_access: Add a core-profile test
This tests behavior specific to the core profile. --- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + tests/spec/arb_direct_state_access/vao-core.c | 186 + 3 files changed, 188 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/vao-core.c diff --git a/tests/all.py b/tests/all.py index 3affcf9..e85763e 100755 --- a/tests/all.py +++ b/tests/all.py @@ -4289,6 +4289,7 @@ with profile.group_manager( g(['arb_direct_state_access-vao-vertex-buffer'], 'vao-vertex-buffer') g(['arb_direct_state_access-vao-vertex-buffers'], 'vao-vertex-buffers') g(['arb_direct_state_access-vao-get'], 'vao-get') +g(['arb_direct_state_access-vao-core'], 'vao-core') with profile.group_manager( PiglitGLTest, diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index c855797..bc610b6 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -45,4 +45,5 @@ piglit_add_executable (arb_direct_state_access-vao-element-array-buffer vao-elem piglit_add_executable (arb_direct_state_access-vao-vertex-buffer vao-vertex-buffer.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-vao-vertex-buffers vao-vertex-buffers.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-vao-get vao-get.c) +piglit_add_executable (arb_direct_state_access-vao-core vao-core.c dsa-utils.c) # vim: ft=cmake: diff --git a/tests/spec/arb_direct_state_access/vao-core.c b/tests/spec/arb_direct_state_access/vao-core.c new file mode 100644 index 000..9bb2ad7 --- /dev/null +++ b/tests/spec/arb_direct_state_access/vao-core.c @@ -0,0 +1,186 @@ +/* + * Copyright (C) 2015 Fredrik Höglund + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * @file vao-core.c + * + * Tests behavior specific to the core profile. + */ + +#include "piglit-util-gl.h" +#include "dsa-utils.h" + + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_core_version = 31; + + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + + +enum piglit_result +piglit_display(void) +{ + /* unreached */ + return PIGLIT_FAIL; +} + + +/** + * Calls all DSA functions on the given vao, with valid parameters, + * and checks that expected_error is generated. + */ +static bool +test_all_functions(GLuint vao, GLenum expected_error) +{ + GLint value; + GLint64 value64; + bool pass = true; + + glDisableVertexArrayAttrib(vao, 0); + pass = piglit_check_gl_error(expected_error) && pass; + + glEnableVertexArrayAttrib(vao, 0); + pass = piglit_check_gl_error(expected_error) && pass; + + glVertexArrayElementBuffer(vao, 0); + pass = piglit_check_gl_error(expected_error) && pass; + + glVertexArrayVertexBuffer(vao, 0, 0, 0, 0); + pass = piglit_check_gl_error(expected_error) && pass; + + glVertexArrayVertexBuffers(vao, 0, 1, NULL, NULL, NULL); + pass = piglit_check_gl_error(expected_error) && pass; + + glVertexArrayAttribFormat(vao, 0, 4, GL_FLOAT, GL_FALSE, 0); + pass = piglit_check_gl_error(expected_error) && pass; + + glVertexArrayAttribIFormat(vao, 0, 4, GL_INT, 0); + pass = piglit_check_gl_error(expected_error) && pass; + + if (piglit_is_extension_supported("GL_ARB_vertex_attrib_64bit")) { + glVertexArrayAttribLFormat(vao, 0, 4, GL_DOUBLE, 0); + pass = piglit_check_gl_error(expected_error) && pass; + } + + glVertexArrayAttribBinding(vao, 0, 4); + pass = piglit_check_gl_error(expected_error) && pass; + + if (piglit_is_extension_supported("GL_ARB_instanced_arrays")) { + glVertexArrayBindingDivisor(vao, 0, 1); +
[Piglit] [PATCH 07/14] arb_direct_state_access: Add a test for glVertexArrayBindingDivisor
This test verifies that glVertexArrayBindingDivisor works as expected. --- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + .../arb_direct_state_access/vao-binding-divisor.c | 119 + 3 files changed, 121 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/vao-binding-divisor.c diff --git a/tests/all.py b/tests/all.py index 8707759..442f5b6 100755 --- a/tests/all.py +++ b/tests/all.py @@ -4284,6 +4284,7 @@ with profile.group_manager( g(['arb_direct_state_access-vao-attrib-enabledisable'], 'vao-attrib-enabledisable') g(['arb_direct_state_access-vao-attrib-format'], 'vao-attrib-format') g(['arb_direct_state_access-vao-attrib-binding'], 'vao-attrib-binding') +g(['arb_direct_state_access-vao-binding-divisor'], 'vao-binding-divisor') with profile.group_manager( PiglitGLTest, diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index a5d0a55..e45da46 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -40,4 +40,5 @@ piglit_add_executable (arb_direct_state_access-vao-create vao-create.c) piglit_add_executable (arb_direct_state_access-vao-attrib-enabledisable vao-attrib-enabledisable.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-vao-attrib-format vao-attrib-format.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-vao-attrib-binding vao-attrib-binding.c dsa-utils.c) +piglit_add_executable (arb_direct_state_access-vao-binding-divisor vao-binding-divisor.c dsa-utils.c) # vim: ft=cmake: diff --git a/tests/spec/arb_direct_state_access/vao-binding-divisor.c b/tests/spec/arb_direct_state_access/vao-binding-divisor.c new file mode 100644 index 000..0f1be2d --- /dev/null +++ b/tests/spec/arb_direct_state_access/vao-binding-divisor.c @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2015 Fredrik Höglund + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * @file vao-binding-divisor.c + * + * Verifies that glVertexArrayBindingDivisor works as expected. + */ + +#include "piglit-util-gl.h" +#include "dsa-utils.h" + + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_core_version = 31; + config.supports_gl_compat_version = 20; + + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + + +enum piglit_result +piglit_display(void) +{ + /* unreached */ + return PIGLIT_FAIL; +} + + +#define check_divisor(vao, index, binding) \ + check_indexed_vao_param(vao, index, GL_VERTEX_BINDING_DIVISOR, binding) + + +void +piglit_init(int argc, char *argv[]) +{ + GLuint vao; + GLint maxBindings; + GLuint *divisors; + bool pass = true; + int i; + + piglit_require_extension("GL_ARB_direct_state_access"); + piglit_require_extension("GL_ARB_vertex_array_object"); + piglit_require_extension("GL_ARB_vertex_attrib_binding"); + piglit_require_extension("GL_ARB_instanced_arrays"); + + glGetIntegerv(GL_MAX_VERTEX_ATTRIB_BINDINGS, &maxBindings); + + /* Create a VAO */ + glCreateVertexArrays(1, &vao); + + /* Verify that the initial divisor value is zero */ + for (i = 0; i < maxBindings; i++) + pass = check_divisor(vao, i, 0) && pass; + + /* Change the divisors */ + divisors = (GLuint *) malloc(maxBindings * sizeof(GLuint)); + + for (i = 0; i < maxBindings; i++) { + divisors[i] = rand() % 10; + glVertexArrayBindingDivisor(vao, i, divisors[i]); + } + + pass = piglit_check_gl_error(GL_NO_ERROR) && pass; + + /* Verify that the divisors were changed */ + for (i = 0; i < maxBindings; i++) + pass = check_divisor(
[Piglit] [PATCH 11/14] arb_direct_state_access: Add a test for glGetVertexArray*iv
This test verifies that glGetVertexArrayiv, glGetVertexArrayIndexediv, and glGetVertexArrayIndexed64iv work as expected. --- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + tests/spec/arb_direct_state_access/vao-get.c | 285 + 3 files changed, 287 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/vao-get.c diff --git a/tests/all.py b/tests/all.py index d0730d4..3affcf9 100755 --- a/tests/all.py +++ b/tests/all.py @@ -4288,6 +4288,7 @@ with profile.group_manager( g(['arb_direct_state_access-vao-element-array-buffer'], 'vao-element-array-buffer') g(['arb_direct_state_access-vao-vertex-buffer'], 'vao-vertex-buffer') g(['arb_direct_state_access-vao-vertex-buffers'], 'vao-vertex-buffers') +g(['arb_direct_state_access-vao-get'], 'vao-get') with profile.group_manager( PiglitGLTest, diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index 41e5c46..c855797 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -44,4 +44,5 @@ piglit_add_executable (arb_direct_state_access-vao-binding-divisor vao-binding-d piglit_add_executable (arb_direct_state_access-vao-element-array-buffer vao-element-array-buffer.c) piglit_add_executable (arb_direct_state_access-vao-vertex-buffer vao-vertex-buffer.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-vao-vertex-buffers vao-vertex-buffers.c dsa-utils.c) +piglit_add_executable (arb_direct_state_access-vao-get vao-get.c) # vim: ft=cmake: diff --git a/tests/spec/arb_direct_state_access/vao-get.c b/tests/spec/arb_direct_state_access/vao-get.c new file mode 100644 index 000..db4a89c --- /dev/null +++ b/tests/spec/arb_direct_state_access/vao-get.c @@ -0,0 +1,285 @@ +/* + * Copyright (C) 2015 Fredrik Höglund + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * @file vao-get.c + * + * Verifies that glGetVertexArrayiv, glGetVertexArrayIndexediv and + * glGetVertexArrayIndexed64iv work as expected. + */ + +#include "piglit-util-gl.h" + + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_core_version = 31; + config.supports_gl_compat_version = 20; + + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + + +enum piglit_result +piglit_display(void) +{ + /* unreached */ + return PIGLIT_FAIL; +} + + +/** + * Verifies that glGetVertexArrayiv works as expected + */ +static bool +test_getvertexarrayiv(GLuint vao) +{ + bool pass = true; + GLint param; + + /* The ARB_direct_state_access specification says: +* +* "An INVALID_ENUM error is generated if is not +* ELEMENT_ARRAY_BUFFER_BINDING." +*/ + glGetVertexArrayiv(vao, GL_ARRAY_BUFFER_BINDING, ¶m); + pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass; + + /* Verify that no error is generated when pname is +* ELEMENT_ARRAY_BUFFER_BINDING. +*/ + glGetVertexArrayiv(vao, GL_ELEMENT_ARRAY_BUFFER_BINDING, ¶m); + pass = piglit_check_gl_error(GL_NO_ERROR) && pass; + + piglit_report_subtest_result(pass ? PIGLIT_PASS : PIGLIT_FAIL, +"glGetVertexArrayiv"); + return pass; +} + + +/** + * Verifies that glGetVertexArrayIndexediv works as expected + */ +static bool +test_getvertexarrayindexediv(GLuint vao) +{ + struct { + GLenum pname; + bool supported; + } valid_pnames[] = { + { + GL_VERTEX_ATTRIB_ARRAY_ENABLED, + true, + }, + { + GL_VERTEX_ATTRIB_ARRAY_SIZE, + true, +
[Piglit] [PATCH 02/14] dsa/utils: Add check_vbo_binding()
This function returns true if the VBO binding of the given index matches the expected values, and false otherwise. An error message is printed if the actual parameter values don't match the expected values. --- tests/spec/arb_direct_state_access/dsa-utils.c | 19 +++ tests/spec/arb_direct_state_access/dsa-utils.h | 8 2 files changed, 27 insertions(+) diff --git a/tests/spec/arb_direct_state_access/dsa-utils.c b/tests/spec/arb_direct_state_access/dsa-utils.c index f065dbc..aaa1727 100644 --- a/tests/spec/arb_direct_state_access/dsa-utils.c +++ b/tests/spec/arb_direct_state_access/dsa-utils.c @@ -94,3 +94,22 @@ check_indexed_vao_param_(GLuint vao, GLuint index, GLuint param, return true; } + +bool +check_vbo_binding_(GLuint vao, GLuint bindingindex, GLuint vbo, + GLintptr offset, GLsizeiptr stride, + const char *file, int line) +{ + bool pass = true; + + pass = check_indexed_vao_param_(vao, bindingindex, + GL_VERTEX_BINDING_BUFFER, vbo, file, line) && pass; + + pass = check_indexed_vao_param_(vao, bindingindex, + GL_VERTEX_BINDING_OFFSET, offset, file, line) && pass; + + pass = check_indexed_vao_param_(vao, bindingindex, + GL_VERTEX_BINDING_STRIDE, stride, file, line) && pass; + + return pass; +} diff --git a/tests/spec/arb_direct_state_access/dsa-utils.h b/tests/spec/arb_direct_state_access/dsa-utils.h index 707a967..ed3a506 100644 --- a/tests/spec/arb_direct_state_access/dsa-utils.h +++ b/tests/spec/arb_direct_state_access/dsa-utils.h @@ -66,6 +66,14 @@ bool check_indexed_vao_param_(GLuint vao, GLuint index, GLuint param, check_indexed_vao_param_(vao, index, param, expected, \ __FILE__, __LINE__) +bool check_vbo_binding_(GLuint vao, GLuint bindingindex, GLuint vbo, +GLintptr offset, GLsizeiptr stride, +const char *file, int line); + +#define check_vbo_binding(vao, bindingindex, vbo, offset, stride) \ + check_vbo_binding_(vao, bindingindex, vbo, offset, stride, \ + __FILE__, __LINE__) + #ifdef __cplusplus } /* end extern "C" */ #endif -- 2.1.4 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 01/14] dsa/utils: Add check_indexed_vao_param()
This function returns true if the given parameter matches the expected value, and false otherwise. An error message is printed if the parameter value doesn't match the expected value. --- tests/spec/arb_direct_state_access/dsa-utils.c | 17 + tests/spec/arb_direct_state_access/dsa-utils.h | 7 +++ 2 files changed, 24 insertions(+) diff --git a/tests/spec/arb_direct_state_access/dsa-utils.c b/tests/spec/arb_direct_state_access/dsa-utils.c index ec7bb24..f065dbc 100644 --- a/tests/spec/arb_direct_state_access/dsa-utils.c +++ b/tests/spec/arb_direct_state_access/dsa-utils.c @@ -77,3 +77,20 @@ dsa_texture_with_unit(GLuint unit) { glUniform1i(dsa_uniform, unit); } + +bool +check_indexed_vao_param_(GLuint vao, GLuint index, GLuint param, + GLuint expected, const char *file, int line) +{ + GLuint value; + glGetVertexArrayIndexediv(vao, index, param, (GLint *) &value); + + if (value != expected) { + fprintf(stderr, "%s[%u] was %u, expected %u (%s:%d)\n", + piglit_get_gl_enum_name(param), + index, value, expected, file, line); + return false; + } + + return true; +} diff --git a/tests/spec/arb_direct_state_access/dsa-utils.h b/tests/spec/arb_direct_state_access/dsa-utils.h index 7bcf004..707a967 100644 --- a/tests/spec/arb_direct_state_access/dsa-utils.h +++ b/tests/spec/arb_direct_state_access/dsa-utils.h @@ -59,6 +59,13 @@ void dsa_init_program(void); void dsa_texture_with_unit(GLuint); +bool check_indexed_vao_param_(GLuint vao, GLuint index, GLuint param, + GLuint expected, const char *file, int line); + +#define check_indexed_vao_param(vao, index, param, expected) \ + check_indexed_vao_param_(vao, index, param, expected, \ +__FILE__, __LINE__) + #ifdef __cplusplus } /* end extern "C" */ #endif -- 2.1.4 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 00/14] Add DSA tests for vertex array objects
This series adds piglit tests for the VAO portion of GL_ARB_direct_state_access. The tests are written so that they can be run against either the core or compatibility profiles. The exception is vao-core and vao-compatibility, which contain all the profile specific tests. Note that vao-attrib-format fails without this patch: http://patchwork.freedesktop.org/patch/44068 It would be interesting to know if the tests pass with NVIDIA's implementation, but I haven't been able to test that. Fredrik Höglund (14): dsa/utils: Add check_indexed_vao_param() dsa/utils: Add check_vbo_binding() arb_direct_state_access: Add a test for glCreateVertexArrays arb_direct_state_access: Add a test for glEnable/DisableVertexArrayAttrib arb_direct_state_access: Add a test for glVertexArrayAttrib[I|L]Format arb_direct_state_access: Add a test for glVertexArrayAttribBinding arb_direct_state_access: Add a test for glVertexArrayBindingDivisor arb_direct_state_access: Add a test for glVertexArrayElementBuffer arb_direct_state_access: Add a test for glVertexArrayVertexBuffer arb_direct_state_access: Add a test for glVertexArrayVertexBuffers arb_direct_state_access: Add a test for glGetVertexArray*iv arb_direct_state_access: Add a core-profile test arb_direct_state_access: Add a compatibility-profile test arb_direct_state_access: Add a compatibility-profile draw test tests/all.py | 12 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 12 + tests/spec/arb_direct_state_access/dsa-utils.c | 36 + tests/spec/arb_direct_state_access/dsa-utils.h | 15 + .../arb_direct_state_access/vao-attrib-binding.c | 132 .../vao-attrib-enabledisable.c | 127 .../arb_direct_state_access/vao-attrib-format.c| 791 + .../arb_direct_state_access/vao-binding-divisor.c | 119 .../spec/arb_direct_state_access/vao-compat-draw.c | 171 + tests/spec/arb_direct_state_access/vao-compat.c| 199 ++ tests/spec/arb_direct_state_access/vao-core.c | 186 + tests/spec/arb_direct_state_access/vao-create.c| 143 .../vao-element-array-buffer.c | 123 tests/spec/arb_direct_state_access/vao-get.c | 285 .../arb_direct_state_access/vao-vertex-buffer.c| 140 .../arb_direct_state_access/vao-vertex-buffers.c | 351 + 16 files changed, 2842 insertions(+) ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 08/14] arb_direct_state_access: Add a test for glVertexArrayElementBuffer
This test verifies that glVertexArrayElementBuffer works as expected. --- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + .../vao-element-array-buffer.c | 123 + 3 files changed, 125 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/vao-element-array-buffer.c diff --git a/tests/all.py b/tests/all.py index 442f5b6..6b44069 100755 --- a/tests/all.py +++ b/tests/all.py @@ -4285,6 +4285,7 @@ with profile.group_manager( g(['arb_direct_state_access-vao-attrib-format'], 'vao-attrib-format') g(['arb_direct_state_access-vao-attrib-binding'], 'vao-attrib-binding') g(['arb_direct_state_access-vao-binding-divisor'], 'vao-binding-divisor') +g(['arb_direct_state_access-vao-element-array-buffer'], 'vao-element-array-buffer') with profile.group_manager( PiglitGLTest, diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index e45da46..fe17530 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -41,4 +41,5 @@ piglit_add_executable (arb_direct_state_access-vao-attrib-enabledisable vao-attr piglit_add_executable (arb_direct_state_access-vao-attrib-format vao-attrib-format.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-vao-attrib-binding vao-attrib-binding.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-vao-binding-divisor vao-binding-divisor.c dsa-utils.c) +piglit_add_executable (arb_direct_state_access-vao-element-array-buffer vao-element-array-buffer.c) # vim: ft=cmake: diff --git a/tests/spec/arb_direct_state_access/vao-element-array-buffer.c b/tests/spec/arb_direct_state_access/vao-element-array-buffer.c new file mode 100644 index 000..8e0a9e1 --- /dev/null +++ b/tests/spec/arb_direct_state_access/vao-element-array-buffer.c @@ -0,0 +1,123 @@ +/* + * Copyright (C) 2015 Fredrik Höglund + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * @file vao-element-array-buffer.c + * + * Verifies that glVertexArrayElementBuffer works as expected. + */ + +#include "piglit-util-gl.h" + + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_core_version = 31; + config.supports_gl_compat_version = 20; + + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + + +enum piglit_result +piglit_display(void) +{ + /* unreached */ + return PIGLIT_FAIL; +} + + +static bool +check_ibo_binding_(GLuint vao, GLuint expected, int line) +{ + GLuint value; + glGetVertexArrayiv(vao, GL_ELEMENT_ARRAY_BUFFER_BINDING, + (GLint *) &value); + + if (value != expected) { + fprintf(stderr, "GL_ELEMENT_ARRAY_BUFFER_BINDING was %u, " + "expected %u (%s:%d)\n", + value, expected, __FILE__, line); + return false; + } + + return true; +} + + +#define check_ibo_binding(vao, expected) \ + check_ibo_binding_(vao, expected, __LINE__) + + +void +piglit_init(int argc, char *argv[]) +{ + GLuint vao, ibo; + bool pass = true; + + piglit_require_extension("GL_ARB_direct_state_access"); + piglit_require_extension("GL_ARB_vertex_array_object"); + + /* Create a buffer object */ + glCreateBuffers(1, &ibo); + + /* Create a VAO and verify that no element array buffer is +* bound by default +*/ + glCreateVertexArrays(1, &vao); + pass = check_ibo_binding(vao, 0) && pass; + + /* Bind the buffer object as an element array buffer and verify +* that it was successfully bound +*/ + glVertexArrayElementBuffer(vao, ibo); + pass = piglit_check_gl_error(
[Piglit] [PATCH 06/14] arb_direct_state_access: Add a test for glVertexArrayAttribBinding
This test verifies that glVertexArrayAttribBinding works as expected. --- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + .../arb_direct_state_access/vao-attrib-binding.c | 132 + 3 files changed, 134 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/vao-attrib-binding.c diff --git a/tests/all.py b/tests/all.py index 9f2f3ef..8707759 100755 --- a/tests/all.py +++ b/tests/all.py @@ -4283,6 +4283,7 @@ with profile.group_manager( g(['arb_direct_state_access-vao-create'], 'vao-create') g(['arb_direct_state_access-vao-attrib-enabledisable'], 'vao-attrib-enabledisable') g(['arb_direct_state_access-vao-attrib-format'], 'vao-attrib-format') +g(['arb_direct_state_access-vao-attrib-binding'], 'vao-attrib-binding') with profile.group_manager( PiglitGLTest, diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index e5596be..a5d0a55 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -39,4 +39,5 @@ piglit_add_executable (arb_direct_state_access-create-queries create-queries.c) piglit_add_executable (arb_direct_state_access-vao-create vao-create.c) piglit_add_executable (arb_direct_state_access-vao-attrib-enabledisable vao-attrib-enabledisable.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-vao-attrib-format vao-attrib-format.c dsa-utils.c) +piglit_add_executable (arb_direct_state_access-vao-attrib-binding vao-attrib-binding.c dsa-utils.c) # vim: ft=cmake: diff --git a/tests/spec/arb_direct_state_access/vao-attrib-binding.c b/tests/spec/arb_direct_state_access/vao-attrib-binding.c new file mode 100644 index 000..f498790 --- /dev/null +++ b/tests/spec/arb_direct_state_access/vao-attrib-binding.c @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2015 Fredrik Höglund + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * @file vao-attrib-binding.c + * + * Verifies that glVertexArrayAttribBinding works as expected. + */ + +#include "piglit-util-gl.h" +#include "dsa-utils.h" + + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 20; + config.supports_gl_core_version = 31; + + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + + +enum piglit_result +piglit_display(void) +{ + /* unreached */ + return PIGLIT_FAIL; +} + + +#define check_binding(vao, index, expected) \ + check_indexed_vao_param(vao, index, \ + GL_VERTEX_ATTRIB_BINDING, expected) + + +void +piglit_init(int argc, char *argv[]) +{ + GLuint vao; + bool pass = true; + GLint maxAttribs; + GLint maxAttribBindings; + GLuint *bindings; + int i; + + piglit_require_extension("GL_ARB_direct_state_access"); + piglit_require_extension("GL_ARB_vertex_array_object"); + piglit_require_extension("GL_ARB_vertex_attrib_binding"); + + glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxAttribs); + glGetIntegerv(GL_MAX_VERTEX_ATTRIB_BINDINGS, &maxAttribBindings); + + /* Create a VAO */ + glCreateVertexArrays(1, &vao); + + /* Check the default attrib bindings */ + for (i = 0; i < maxAttribs; i++) + pass = check_binding(vao, i, i) && pass; + + /* Change the bindings */ + bindings = (GLuint *) malloc(maxAttribs * sizeof(GLuint)); + + for (i = 0; i < maxAttribs; i++) { + bindings[i] = rand() % maxAttribBindings; + glVertexArrayAttribBinding(vao, i, bindings[i]); + } + + pass = piglit_check_gl_error(GL_NO_ERROR) && pass; + + /* Verify that the bindings were changed */ + for (i = 0; i < maxAttribs; i++) +
[Piglit] [PATCH 13/14] arb_direct_state_access: Add a compatibility-profile test
This tests behavior specific to the compatibility profile. --- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + tests/spec/arb_direct_state_access/vao-compat.c| 199 + 3 files changed, 201 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/vao-compat.c diff --git a/tests/all.py b/tests/all.py index e85763e..0dbb59d 100755 --- a/tests/all.py +++ b/tests/all.py @@ -4290,6 +4290,7 @@ with profile.group_manager( g(['arb_direct_state_access-vao-vertex-buffers'], 'vao-vertex-buffers') g(['arb_direct_state_access-vao-get'], 'vao-get') g(['arb_direct_state_access-vao-core'], 'vao-core') +g(['arb_direct_state_access-vao-compat'], 'vao-compat') with profile.group_manager( PiglitGLTest, diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index bc610b6..5dd4835 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -46,4 +46,5 @@ piglit_add_executable (arb_direct_state_access-vao-vertex-buffer vao-vertex-buff piglit_add_executable (arb_direct_state_access-vao-vertex-buffers vao-vertex-buffers.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-vao-get vao-get.c) piglit_add_executable (arb_direct_state_access-vao-core vao-core.c dsa-utils.c) +piglit_add_executable (arb_direct_state_access-vao-compat vao-compat.c dsa-utils.c) # vim: ft=cmake: diff --git a/tests/spec/arb_direct_state_access/vao-compat.c b/tests/spec/arb_direct_state_access/vao-compat.c new file mode 100644 index 000..92f94c1 --- /dev/null +++ b/tests/spec/arb_direct_state_access/vao-compat.c @@ -0,0 +1,199 @@ +/* + * Copyright (C) 2015 Fredrik Höglund + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * @file vao-compat.c + * + * Tests behavior specific to the compatibility profile. + */ + +#include "piglit-util-gl.h" +#include "dsa-utils.h" + + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 20; + + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + + +enum piglit_result +piglit_display(void) +{ + /* unreached */ + return PIGLIT_FAIL; +} + + +/** + * Calls all DSA functions on the given vaobj, with valid parameters + * and checks that expected_error is generated. + */ +static bool +test_all_functions(GLuint vaobj, GLenum expected_error) +{ + GLint value; + GLint64 value64; + bool pass = true; + + glDisableVertexArrayAttrib(vaobj, 0); + pass = piglit_check_gl_error(expected_error) && pass; + + glEnableVertexArrayAttrib(vaobj, 0); + pass = piglit_check_gl_error(expected_error) && pass; + + glVertexArrayElementBuffer(vaobj, 0); + pass = piglit_check_gl_error(expected_error) && pass; + + glVertexArrayVertexBuffer(vaobj, 0, 0, 0, 0); + pass = piglit_check_gl_error(expected_error) && pass; + + glVertexArrayVertexBuffers(vaobj, 0, 1, NULL, NULL, NULL); + pass = piglit_check_gl_error(expected_error) && pass; + + glVertexArrayAttribFormat(vaobj, 0, 4, GL_FLOAT, GL_FALSE, 0); + pass = piglit_check_gl_error(expected_error) && pass; + + if (piglit_get_gl_version() >= 30) { + glVertexArrayAttribIFormat(vaobj, 0, 4, GL_INT, 0); + pass = piglit_check_gl_error(expected_error) && pass; + } + + if (piglit_is_extension_supported("GL_ARB_vertex_attrib_64bit")) { + glVertexArrayAttribLFormat(vaobj, 0, 4, GL_DOUBLE, 0); + pass = piglit_check_gl_error(expected_error) && pass; + } + + glVertexArrayAttribBinding(vaobj, 0, 4); + pass = piglit_check_gl_error(expected_error) && pass; + + if (piglit_is_extension_supported("GL_AR
[Piglit] [PATCH 04/14] arb_direct_state_access: Add a test for glEnable/DisableVertexArrayAttrib
This test verifies that glEnableVertexArrayAttrib() and glDisableVertexArrayAttrib() work as expected. --- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + .../vao-attrib-enabledisable.c | 127 + 3 files changed, 129 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/vao-attrib-enabledisable.c diff --git a/tests/all.py b/tests/all.py index 441ea77..cfa2a96 100755 --- a/tests/all.py +++ b/tests/all.py @@ -4281,6 +4281,7 @@ with profile.group_manager( 'create-programpipelines') g(['arb_direct_state_access-create-queries'], 'create-queries') g(['arb_direct_state_access-vao-create'], 'vao-create') +g(['arb_direct_state_access-vao-attrib-enabledisable'], 'vao-attrib-enabledisable') with profile.group_manager( PiglitGLTest, diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index 9fcbf7e..4ee9c0c 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -37,4 +37,5 @@ piglit_add_executable (arb_direct_state_access-create-samplers create-samplers.c piglit_add_executable (arb_direct_state_access-create-programpipelines create-programpipelines.c) piglit_add_executable (arb_direct_state_access-create-queries create-queries.c) piglit_add_executable (arb_direct_state_access-vao-create vao-create.c) +piglit_add_executable (arb_direct_state_access-vao-attrib-enabledisable vao-attrib-enabledisable.c dsa-utils.c) # vim: ft=cmake: diff --git a/tests/spec/arb_direct_state_access/vao-attrib-enabledisable.c b/tests/spec/arb_direct_state_access/vao-attrib-enabledisable.c new file mode 100644 index 000..98db400 --- /dev/null +++ b/tests/spec/arb_direct_state_access/vao-attrib-enabledisable.c @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2015 Fredrik Höglund + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * @file vao-attrib-enabledisable.c + * + * Verifies that glEnableVertexArrayAttrib and glDisableVertexArrayAttrib + * work as expected. + */ + +#include "piglit-util-gl.h" +#include "dsa-utils.h" + + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_core_version = 31; + config.supports_gl_compat_version = 20; + + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + + +enum piglit_result +piglit_display(void) +{ + /* unreached */ + return PIGLIT_FAIL; +} + + +#define check_enabled(vao, index) \ + check_indexed_vao_param(vao, index, \ + GL_VERTEX_ATTRIB_ARRAY_ENABLED, GL_TRUE) + + +#define check_disabled(vao, index) \ + check_indexed_vao_param(vao, index, \ + GL_VERTEX_ATTRIB_ARRAY_ENABLED, GL_FALSE) + + +void +piglit_init(int argc, char *argv[]) +{ + GLuint vao; + GLint maxAttribs; + bool pass = true; + int i; + + piglit_require_extension("GL_ARB_direct_state_access"); + piglit_require_extension("GL_ARB_vertex_array_object"); + + glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxAttribs); + + /* Create a VAO */ + glCreateVertexArrays(1, &vao); + + /* Enable and disable each array in turn */ + for (i = 0; i < maxAttribs; i++) { + /* Check that the array is disabled by default */ + pass = check_disabled(vao, i) && pass; + + /* Enable the array and verify that it was enabled */ + glEnableVertexArrayAttrib(vao, i); + pass = piglit_check_gl_error(GL_NO_ERROR) && pass; + pass = check_enabled(vao, i) && pass; + + /* Disable the array again and verify that it was disabled */ + glDisableVertexArrayAttrib(vao, i); + pass
[Piglit] [PATCH 14/14] arb_direct_state_access: Add a compatibility-profile draw test
This test verifies that changes to vaobj=0 are applied to the default vertex array object, and not to the currently bound vertex array object. --- tests/all.py | 1 + .../spec/arb_direct_state_access/CMakeLists.gl.txt | 1 + .../spec/arb_direct_state_access/vao-compat-draw.c | 171 + 3 files changed, 173 insertions(+) create mode 100644 tests/spec/arb_direct_state_access/vao-compat-draw.c diff --git a/tests/all.py b/tests/all.py index 0dbb59d..5d7bdab 100755 --- a/tests/all.py +++ b/tests/all.py @@ -4291,6 +4291,7 @@ with profile.group_manager( g(['arb_direct_state_access-vao-get'], 'vao-get') g(['arb_direct_state_access-vao-core'], 'vao-core') g(['arb_direct_state_access-vao-compat'], 'vao-compat') +g(['arb_direct_state_access-vao-compat-draw'], 'vao-compat-draw') with profile.group_manager( PiglitGLTest, diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt index 5dd4835..c0bdb51 100644 --- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt @@ -47,4 +47,5 @@ piglit_add_executable (arb_direct_state_access-vao-vertex-buffers vao-vertex-buf piglit_add_executable (arb_direct_state_access-vao-get vao-get.c) piglit_add_executable (arb_direct_state_access-vao-core vao-core.c dsa-utils.c) piglit_add_executable (arb_direct_state_access-vao-compat vao-compat.c dsa-utils.c) +piglit_add_executable (arb_direct_state_access-vao-compat-draw vao-compat-draw.c) # vim: ft=cmake: diff --git a/tests/spec/arb_direct_state_access/vao-compat-draw.c b/tests/spec/arb_direct_state_access/vao-compat-draw.c new file mode 100644 index 000..31d73bd --- /dev/null +++ b/tests/spec/arb_direct_state_access/vao-compat-draw.c @@ -0,0 +1,171 @@ +/* + * Copyright (C) 2015 Fredrik Höglund + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * @file vao-compat-draw.c + * + * This test verifies that changes made to vaobj=0 are applied to the default + * vertex array object, and not to the currently bound vertex array object. + */ + +#include "piglit-util-gl.h" + + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 20; + + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + + +#define VA_POSITION 0 +#define VA_COLOR1 + + +const char *vs = +"attribute vec4 vertex;\n" +"attribute vec4 color;\n" +"varying vec4 out_color;\n" +"void main(void)\n{\n" +"gl_Position = vertex;\n" +"out_color = color;\n" +"}"; + +const char *fs = +"varying vec4 out_color;\n" +"void main(void)\n{\n" +"gl_FragColor = out_color;\n" +"}"; + + +enum piglit_result +piglit_display(void) +{ + GLuint vao; + float green[] = { 0.0, 1.0, 0.0, 1.0 }; + + float vertices[] = { + /* Top half of the window */ + -1.0, 0.0, + -1.0, 1.0, +1.0, 0.0, +1.0, 1.0, + + /* Bottom half of the window */ + -1.0, -1.0, + -1.0, 0.0, +1.0, -1.0, +1.0, 0.0, + }; + + bool pass = true; + + /* Create two VBO's. The first contains the vertex positions, +* and the second contains the color. +*/ + GLuint vbo[2]; + glCreateBuffers(2, vbo); + + glNamedBufferData(vbo[0], sizeof(vertices), vertices, GL_STATIC_DRAW); + glNamedBufferData(vbo[1], sizeof(green), green, GL_STATIC_DRAW); + + /* Set up the non-default VAO */ + glCreateVertexArrays(1, &vao); + glVertexArrayAttribFormat(vao, VA_POSITION, 2, GL_FLOAT, GL_FALSE, 0); + glVertexArrayAttribBinding(vao, VA_POSITION, 0); + glEnableVertexArrayAttrib(vao, VA_POSIT
Re: [Piglit] [PATCH] all.py: Change format for arb_direct_state_access-compressedtextureimage.
On Tue, Mar 3, 2015 at 3:03 PM, Laura Ekstrand wrote: > arb_direct_state_access-compressedtextureimage should use a more mainstream > compression format in all.py. This patch changes it to > GL_COMPRESSED_RGBA_S3TC_DXT5_EXT. > --- > tests/all.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/all.py b/tests/all.py > index 63e8140..0f07105 100644 > --- a/tests/all.py > +++ b/tests/all.py > @@ -4000,7 +4000,7 @@ > spec['ARB_direct_state_access']['gettextureimage-formats'] = > PiglitGLTest(['arb_ > spec['ARB_direct_state_access']['gettextureimage-luminance'] = > PiglitGLTest(['arb_direct_state_access-gettextureimage-luminance'], > run_concurrent=True) > spec['ARB_direct_state_access']['gettextureimage-simple'] = > PiglitGLTest(['arb_direct_state_access-gettextureimage-simple'], > run_concurrent=True) > spec['ARB_direct_state_access']['gettextureimage-targets'] = > PiglitGLTest(['arb_direct_state_access-gettextureimage-targets'], > run_concurrent=True) > -spec['ARB_direct_state_access']['compressedtextureimage'] = > PiglitGLTest(['arb_direct_state_access-compressedtextureimage', > 'GL_COMPRESSED_RGBA_FXT1_3DFX'], run_concurrent=True) > +spec['ARB_direct_state_access']['compressedtextureimage'] = > PiglitGLTest(['arb_direct_state_access-compressedtextureimage', > 'GL_COMPRESSED_RGBA_S3TC_DXT5_EXT'], run_concurrent=True) > spec['ARB_direct_state_access']['getcompressedtextureimage'] = > PiglitGLTest(['arb_direct_state_access-getcompressedtextureimage'], > run_concurrent=True) > spec['ARB_direct_state_access']['compressedtexturesubimage'] = > PiglitGLTest(['arb_direct_state_access-compressedtexturesubimage'], > run_concurrent=True) > spec['ARB_direct_state_access']['texture-storage-multisample'] = > PiglitGLTest(['arb_direct_state_access-texture-storage-multisample'], > run_concurrent=True) > -- > 2.1.0 > > ___ > Piglit mailing list > Piglit@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/piglit Reviewed-by: Anuj Phogat ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] arb_direct_state_access: Fix file name
Signed-off-by: Anuj Phogat --- tests/spec/arb_direct_state_access/getcompressedtextureimage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/spec/arb_direct_state_access/getcompressedtextureimage.c b/tests/spec/arb_direct_state_access/getcompressedtextureimage.c index 5403d16..dbfe0e0 100644 --- a/tests/spec/arb_direct_state_access/getcompressedtextureimage.c +++ b/tests/spec/arb_direct_state_access/getcompressedtextureimage.c @@ -23,7 +23,7 @@ */ /** - * @file getcompressedtextureimage-targets.c + * @file getcompressedtextureimage.c * * Adapted for testing glGetCompressedTextureImage in ARB_direct_state_access * by Laura Ekstrand , November 2014. -- 1.9.3 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] V4. Add a case to valid gl_VertexID for bug 87611
This case is passed by master since Ken's commit is already pushed (c633528cbac007a73a066f269b3c9a25daf1e21a) Below is the test point of this case: 1. Use user-allocated vertex arrays (NOT vertex buffer objects). 2. Use a glDrawArrays with a non-zero 'first'. 3. Use primitive restart to trigger multiple _mesa_prim without an intervening state change. For primitive restart test: In OpenGL, primitive restarting to work with all rendering commands, including the non-indexed commands. However, implementations did not implement this, and the rule itself makes no sense.(https://www.opengl.org/wiki/Vertex_Rendering) Also apparently GL 4.5 changed this de-facto behaviour into specified behaviour -- primitive restart is only supposed to work on Draw*Elements*. 4. Validate the value of gl_VertexID in the vertex shader. Both glDrawArrays testing and glDrawElements testing test the value of gl_VertexID 5. Using GL_TRIANGLE_FAN because GL_TRIANGLE_STRIP are supported by the HW path, and GL_TRIANGLE_FAN specifically to hit the SW primitive restart path which force the draw to be decomposed into multiple draws V2: 1.Fix some Piglit style issue V3: 1.Make sure GL_TRIANGLE_FAN should be used. V4: 1.Fix some GL version issue and coding style issue. Signed-off-by: Wang Shuo --- tests/all.py| 1 + tests/spec/gl-3.1/CMakeLists.gl.txt | 1 + tests/spec/gl-3.1/primitive-restart-vertex-id.c | 137 3 files changed, 139 insertions(+) create mode 100644 tests/spec/gl-3.1/primitive-restart-vertex-id.c diff --git a/tests/all.py b/tests/all.py index b2266db..465c2b5 100644 --- a/tests/all.py +++ b/tests/all.py @@ -1152,6 +1152,7 @@ with profile.group_manager( g(['gl-3.1-genned-names'], 'genned-names') g(['gl-3.1-minmax'], 'minmax') g(['gl-3.1-vao-broken-attrib'], 'vao-broken-attrib') +g(['gl-3.1-primitive-restart-vertex-id'], 'primitive-restart-vertex-id') g(['gl-3.0-required-renderbuffer-attachment-formats', '31'], 'required-renderbuffer-attachment-formats') g(['gl-3.0-required-sized-texture-formats', '31'], diff --git a/tests/spec/gl-3.1/CMakeLists.gl.txt b/tests/spec/gl-3.1/CMakeLists.gl.txt index a5f28c1..4ecb0b2 100644 --- a/tests/spec/gl-3.1/CMakeLists.gl.txt +++ b/tests/spec/gl-3.1/CMakeLists.gl.txt @@ -15,5 +15,6 @@ piglit_add_executable (gl-3.1-genned-names genned-names.c) piglit_add_executable (gl-3.1-minmax minmax.c) piglit_add_executable (gl-3.1-primitive-restart-xfb primitive-restart-xfb.c) piglit_add_executable (gl-3.1-vao-broken-attrib vao-broken-attrib.c) +piglit_add_executable (gl-3.1-primitive-restart-vertex-id primitive-restart-vertex-id.c) # vim: ft=cmake: diff --git a/tests/spec/gl-3.1/primitive-restart-vertex-id.c b/tests/spec/gl-3.1/primitive-restart-vertex-id.c new file mode 100644 index 000..0f92d1f --- /dev/null +++ b/tests/spec/gl-3.1/primitive-restart-vertex-id.c @@ -0,0 +1,137 @@ +/* + * Copyright © 2015 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file primitive-restart-vertex-id.c + * + * Check gl_VertexID + * This case is added for *Bug 87611 - Exercise gl_VertexID corner + * cases in i965 driver*, and used to watch the status of *Bug 85529 + * - Surfaces not drawn in Unvanquished* This case is + * passed by master now. + * + * + * \author Wang Shuo */ + + +#include "piglit-util-gl.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 10; + + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + +/* Validate the value of gl_VertexID in the vertex shader. */ +static const GLchar *vertShaderText = + "#version 130\n" + "in vec4 piglit_vertex;\n" + "void main()\n" + "{\n" + "gl_Position = piglit_vertex;\n
Re: [Piglit] [PATCH] V3. Add a case to valid gl_VertexID for bug 87611
Thank you very much for the information. I have already update them and send out v4. Thanks, Shuo -Original Message- From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf Of Ilia Mirkin Sent: Tuesday, March 24, 2015 10:28 PM To: Wang, Shuo Cc: piglit@lists.freedesktop.org; Jin, Gordon Subject: Re: [Piglit] [PATCH] V3. Add a case to valid gl_VertexID for bug 87611 On Tue, Mar 24, 2015 at 10:41 AM, Wang Shuo wrote: > V3: This case is passed by master. > Below is the test point of this case: > 1. Use user-allocated vertex arrays (NOT vertex buffer objects). > 2. Use a glDrawArrays with a non-zero 'first'. > 3. Use primitive restart to trigger multiple _mesa_prim without an > intervening state change. > For primitive restart test: > In OpenGL ES, primitive restart do not support glDrawArrays. There's a lot of talk about GL ES for a test that tests desktop GL... Also apparently GL 4.5 changed this de-facto behaviour into specified behaviour -- primitive restart is only supposed to work on Draw*Elements*. > Below is the spec of OpenGLR ES Version 3.0.1(January 10, 2013) > page26: > When DrawElements,DrawElementsInstanced, or DrawRangeElements > transfers a set of generic attribute array elements to the GL, > if the index within the vertex arrays corresponding to that > set is equal to 2^N - 1, where N is 8, 16 or 32 if the type is > UNSIGNED_-BYTE, UNSIGNED_SHORT, or UNSIGNED_INT, respectively, > then the GL does not process those elements as a vertex. > In OpenGL, primitive restarting to work with all rendering > commands, including the non-indexed commands. However, > implementations did not implement this, and the rule itself > makes no sense.(https://www.opengl.org/wiki/Vertex_Rendering) > So I used glDrawElements to test primitive restart 4. Validate > the value of gl_VertexID in the vertex shader. > Both glDrawArrays testing and glDrawElements testing test the > value of gl_VertexID > 5. Using GL_TRIANGLE_FAN because GL_TRIANGLE_STRIP are supported > by the HW path, and GL_TRIANGLE_FAN specifically to hit the > SW primitive restart path which force the draw to be decomposed > into multiple draws > > Signed-off-by: Wang Shuo > --- > tests/all.py| 1 + > tests/shaders/CMakeLists.gl.txt | 1 + > tests/shaders/glsl-bug-87611.c | 158 > The current style is to avoid these bug-12345 tests. It's unclear what they do at a glance, and they're disorganized. The current style is to put this test into, say, tests/spec/gl-3.0 (or 3.1?) and call it primitive-restart-vertex-id or something. Note that there's already a tests/general/primitive-restart.c which perhaps could be extended to also test TRI_FAN. But I also think a separate test is totally fine. [Shuo]Yes. Thank you, I will move the case to Piglit\tests\spec\gl-3.1\ primitive-restart-vertex-id.c > 3 files changed, 160 insertions(+) > create mode 100644 tests/shaders/glsl-bug-87611.c > > diff --git a/tests/all.py b/tests/all.py index b2266db..54cecdc 100644 > --- a/tests/all.py > +++ b/tests/all.py > @@ -477,6 +477,7 @@ with profile.group_manager(PiglitGLTest, 'shaders') as g: > g(['glsl-arb-fragment-coord-conventions']) > g(['glsl-arb-fragment-coord-conventions-define']) > g(['glsl-bug-22603']) > +g(['glsl-bug-87611']) > g(['glsl-bindattriblocation']) > g(['glsl-dlist-getattriblocation']) > g(['glsl-getactiveuniform-array-size']) > diff --git a/tests/shaders/CMakeLists.gl.txt > b/tests/shaders/CMakeLists.gl.txt index 3efc6bf..b707ce7 100644 > --- a/tests/shaders/CMakeLists.gl.txt > +++ b/tests/shaders/CMakeLists.gl.txt > @@ -47,6 +47,7 @@ piglit_add_executable > (glsl-arb-fragment-coord-conventions glsl-arb-fragment-coo > piglit_add_executable (glsl-arb-fragment-coord-conventions-define > glsl-arb-fragment-coord-conventions-define.c) > piglit_add_executable (glsl-bindattriblocation > glsl-bindattriblocation.c) piglit_add_executable (glsl-bug-22603 > glsl-bug-22603.c) > +piglit_add_executable (glsl-bug-87611 glsl-bug-87611.c) > piglit_add_executable (glsl-dlist-getattriblocation > glsl-dlist-getattriblocation.c) piglit_add_executable > (glsl-explicit-location-01 glsl-explicit-location-01.c) > piglit_add_executable (glsl-explicit-location-02 > glsl-explicit-location-02.c) diff --git > a/tests/shaders/glsl-bug-87611.c b/tests/shaders/glsl-bug-87611.c new > file mode 100644 index 000..13e3d72 > --- /dev/null > +++ b/tests/shaders/glsl-bug-87611.c > @@ -0,0 +1,158 @@ > +/* > + * Copyright © 2015 Intel Corporation > + * > + * Permission is hereby granted, free of charge, to any person > +obtaining a > + * copy of this software and associated documentation files (the > +"Software"), > + * to deal in the Software without restriction, including wi
[Piglit] [PATCH 2/2] arb_arrays_of_arrays: compile test all basic types
Test results: Nvidia GeForce 840M - NVIDIA 346.47: pass --- .../compiler/glsl-1.20-basic-types.vert| 46 ++ .../compiler/glsl-1.30-basic-types.vert| 31 +++ .../compiler/glsl-1.40-basic-types.vert| 19 + .../compiler/glsl-1.50-basic-types.vert| 18 + .../compiler/glsl-4.00-basic-types.vert| 32 +++ .../compiler/glsl-4.20-basic-types.frag| 46 ++ 6 files changed, 192 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/glsl-1.20-basic-types.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/glsl-1.30-basic-types.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/glsl-1.40-basic-types.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/glsl-1.50-basic-types.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/glsl-4.00-basic-types.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/glsl-4.20-basic-types.frag diff --git a/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.20-basic-types.vert b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.20-basic-types.vert new file mode 100644 index 000..3bb25e1 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.20-basic-types.vert @@ -0,0 +1,46 @@ +/* [config] + * expect_result: pass + * glsl_version: 4.20 + * [end config] + * + * Test the basic types added in glsl 4.20 + */ +#version 420 +#extension GL_ARB_arrays_of_arrays: enable + +uniform atomic_uint array01[1][1]; +writeonly uniform image1D array02[1][1]; +writeonly uniform iimage1D array03[1][1]; +writeonly uniform uimage1D array04[1][1]; +writeonly uniform image2D array05[1][1]; +writeonly uniform iimage2D array06[1][1]; +writeonly uniform uimage2D array07[1][1]; +writeonly uniform image3D array08[1][1]; +writeonly uniform iimage3D array09[1][1]; +writeonly uniform uimage3D array10[1][1]; +writeonly uniform image2DRect array11[1][1]; +writeonly uniform iimage2DRect array12[1][1]; +writeonly uniform uimage2DRect array13[1][1]; +writeonly uniform imageCube array14[1][1]; +writeonly uniform iimageCube array15[1][1]; +writeonly uniform uimageCube array16[1][1]; +writeonly uniform imageBuffer array17[1][1]; +writeonly uniform iimageBuffer array18[1][1]; +writeonly uniform uimageBuffer array19[1][1]; +writeonly uniform image1DArray array20[1][1]; +writeonly uniform iimage1DArray array21[1][1]; +writeonly uniform uimage1DArray array22[1][1]; +writeonly uniform image2DArray array23[1][1]; +writeonly uniform iimage2DArray array24[1][1]; +writeonly uniform uimage2DArray array25[1][1]; +writeonly uniform imageCubeArray array26[1][1]; +writeonly uniform iimageCubeArray array27[1][1]; +writeonly uniform uimageCubeArray array28[1][1]; +writeonly uniform image2DMS array29[1][1]; +writeonly uniform iimage2DMS array30[1][1]; +writeonly uniform uimage2DMS array31[1][1]; +writeonly uniform image2DMSArray array32[1][1]; +writeonly uniform iimage2DMSArray array33[1][1]; +writeonly uniform uimage2DMSArray array34[1][1]; + +void main() { gl_FragColor = vec4(0.0); } diff --git a/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.30-basic-types.vert b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.30-basic-types.vert new file mode 100644 index 000..a712980 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.30-basic-types.vert @@ -0,0 +1,31 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.30 + * [end config] + * + * Test the basic types added in glsl 1.30 + */ +#version 130 +#extension GL_ARB_arrays_of_arrays: enable + +uniform uint array01[1][1]; +uniform uvec2 array02[1][1]; +uniform uvec3 array03[1][1]; +uniform uvec4 array04[1][1]; +uniform samplerCubeShadow array05[1][1]; +uniform sampler1DArray array06[1][1]; +uniform sampler2DArray array07[1][1]; +uniform isampler1D array08[1][1]; +uniform isampler2D array09[1][1]; +uniform isampler3D array10[1][1]; +uniform isamplerCube array11[1][1]; +uniform isampler1DArray array12[1][1]; +uniform isampler2DArray array13[1][1]; +uniform usampler1D array14[1][1]; +uniform usampler2D array15[1][1]; +uniform usampler3D array16[1][1]; +uniform usamplerCube array17[1][1]; +uniform usampler1DArray array18[1][1]; +uniform usampler2DArray array19[1][1]; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.40-basic-types.vert b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.40-basic-types.vert new file mode 100644 index 000..4d83565 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.40-basic-types.vert @@ -0,0 +1,19 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.40 + * [end config] + * + * Test the basic types added in glsl 1.40 + */ +#version 140 +#extension GL_ARB_arrays_of_arrays: enable + +uniform sampler2DRect array01[1][1]; +uniform isampler2DRect array02[1][1]; +uniform usampler2DRect array03[1][1]; +uniform sa
[Piglit] [PATCH 1/2] arb_arrays_of_arrays: change input compile tests to fragment shaders
Although the existing tests are valid until link time, it doesn't make much sense to test this way. --- .../compiler/input-array-array-var.frag | 15 +++ .../compiler/input-array-array-var.vert | 15 --- .../compiler/input-array-var-array.frag | 15 +++ .../compiler/input-array-var-array.vert | 15 --- .../compiler/input-var-array-array.frag | 15 +++ .../compiler/input-var-array-array.vert | 15 --- 6 files changed, 45 insertions(+), 45 deletions(-) create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/input-array-array-var.frag delete mode 100644 tests/spec/arb_arrays_of_arrays/compiler/input-array-array-var.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/input-array-var-array.frag delete mode 100644 tests/spec/arb_arrays_of_arrays/compiler/input-array-var-array.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/input-var-array-array.frag delete mode 100644 tests/spec/arb_arrays_of_arrays/compiler/input-var-array-array.vert diff --git a/tests/spec/arb_arrays_of_arrays/compiler/input-array-array-var.frag b/tests/spec/arb_arrays_of_arrays/compiler/input-array-array-var.frag new file mode 100644 index 000..45313ee --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/input-array-array-var.frag @@ -0,0 +1,15 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.50 + * require_extensions: GL_ARB_arrays_of_arrays + * [end config] + */ +#version 150 +#extension GL_ARB_arrays_of_arrays: enable + +in vec4[3][1] an_array; + +void main() +{ + gl_FragColor = an_array[0][0]; +} diff --git a/tests/spec/arb_arrays_of_arrays/compiler/input-array-array-var.vert b/tests/spec/arb_arrays_of_arrays/compiler/input-array-array-var.vert deleted file mode 100644 index cd945bf..000 --- a/tests/spec/arb_arrays_of_arrays/compiler/input-array-array-var.vert +++ /dev/null @@ -1,15 +0,0 @@ -/* [config] - * expect_result: pass - * glsl_version: 1.50 - * require_extensions: GL_ARB_arrays_of_arrays - * [end config] - */ -#version 150 -#extension GL_ARB_arrays_of_arrays: enable - -in vec4[3][1] an_array; - -void main() -{ - gl_Position = an_array[0][0]; -} diff --git a/tests/spec/arb_arrays_of_arrays/compiler/input-array-var-array.frag b/tests/spec/arb_arrays_of_arrays/compiler/input-array-var-array.frag new file mode 100644 index 000..ea0ce56 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/input-array-var-array.frag @@ -0,0 +1,15 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.50 + * require_extensions: GL_ARB_arrays_of_arrays + * [end config] + */ +#version 150 +#extension GL_ARB_arrays_of_arrays: enable + +in vec4[1] an_array[3]; + +void main() +{ + gl_FragColor = an_array[0][0]; +} diff --git a/tests/spec/arb_arrays_of_arrays/compiler/input-array-var-array.vert b/tests/spec/arb_arrays_of_arrays/compiler/input-array-var-array.vert deleted file mode 100644 index 1f234aa..000 --- a/tests/spec/arb_arrays_of_arrays/compiler/input-array-var-array.vert +++ /dev/null @@ -1,15 +0,0 @@ -/* [config] - * expect_result: pass - * glsl_version: 1.50 - * require_extensions: GL_ARB_arrays_of_arrays - * [end config] - */ -#version 150 -#extension GL_ARB_arrays_of_arrays: enable - -in vec4[1] an_array[3]; - -void main() -{ - gl_Position = an_array[0][0]; -} diff --git a/tests/spec/arb_arrays_of_arrays/compiler/input-var-array-array.frag b/tests/spec/arb_arrays_of_arrays/compiler/input-var-array-array.frag new file mode 100644 index 000..acd407a --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/input-var-array-array.frag @@ -0,0 +1,15 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.50 + * require_extensions: GL_ARB_arrays_of_arrays + * [end config] + */ +#version 150 +#extension GL_ARB_arrays_of_arrays: enable + +in vec4 an_array[3][1]; + +void main() +{ + gl_FragColor = an_array[0][0]; +} diff --git a/tests/spec/arb_arrays_of_arrays/compiler/input-var-array-array.vert b/tests/spec/arb_arrays_of_arrays/compiler/input-var-array-array.vert deleted file mode 100644 index 0f1e85d..000 --- a/tests/spec/arb_arrays_of_arrays/compiler/input-var-array-array.vert +++ /dev/null @@ -1,15 +0,0 @@ -/* [config] - * expect_result: pass - * glsl_version: 1.50 - * require_extensions: GL_ARB_arrays_of_arrays - * [end config] - */ -#version 150 -#extension GL_ARB_arrays_of_arrays: enable - -in vec4 an_array[3][1]; - -void main() -{ - gl_Position = an_array[0][0]; -} -- 2.1.4 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] arb_direct_state_access: Fix file name
Reviewed-by: Chris Forbes On Wed, Apr 1, 2015 at 1:57 PM, Anuj Phogat wrote: > Signed-off-by: Anuj Phogat > --- > tests/spec/arb_direct_state_access/getcompressedtextureimage.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/spec/arb_direct_state_access/getcompressedtextureimage.c > b/tests/spec/arb_direct_state_access/getcompressedtextureimage.c > index 5403d16..dbfe0e0 100644 > --- a/tests/spec/arb_direct_state_access/getcompressedtextureimage.c > +++ b/tests/spec/arb_direct_state_access/getcompressedtextureimage.c > @@ -23,7 +23,7 @@ > */ > > /** > - * @file getcompressedtextureimage-targets.c > + * @file getcompressedtextureimage.c > * > * Adapted for testing glGetCompressedTextureImage in ARB_direct_state_access > * by Laura Ekstrand , November 2014. > -- > 1.9.3 > > ___ > 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] arb_arrays_of_arrays: compile test basic types
On Tue, 2015-03-31 at 12:02 +0300, Martin Peres wrote: > On 30/03/15 10:29, Timothy Arceri wrote: > > Test results: > > > > Nvidia GeForce 840M - NVIDIA 346.47: pass > > --- > > This is just > > /tests/spec/glsl-1.20/compiler/structure-and-array-operations/array-of-any-type.vert > > with an extra dimension added. > > > > .../compiler/arrays-of-any-type.vert | 44 > > ++ > > 1 file changed, 44 insertions(+) > > create mode 100644 > > tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert > > > > diff --git > > a/tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert > > b/tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert > > new file mode 100644 > > index 000..0ce45da > > --- /dev/null > > +++ b/tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert > > @@ -0,0 +1,44 @@ > > +/* [config] > > + * expect_result: pass > > + * glsl_version: 1.20 > > + * [end config] > > + * > > + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: > > + * > > + * "All basic types and structures can be formed into arrays." > > + */ > > +#version 120 > > +#extension GL_ARB_arrays_of_arrays: enable > > + > > +uniform float array01[1][1]; > > +uniform int array02[1][1]; > For the sake of completeness: > uint and double are missing here. > > +uniform bool array03[1][1]; > > +uniform vec2 array04[1][1]; > > +uniform vec3 array05[1][1]; > > +uniform vec4 array06[1][1]; > > +uniform ivec2 array07[1][1]; > > +uniform ivec3 array08[1][1]; > > +uniform ivec4 array09[1][1]; > uvec and dvec? > > +uniform bvec2 array10[1][1]; > > +uniform bvec3 array11[1][1]; > > +uniform bvec4 array12[1][1]; > > +uniform mat2 array13[1][1]; > > +uniform mat2x2 array14[1][1]; > > +uniform mat2x3 array15[1][1]; > > +uniform mat2x4 array16[1][1]; > > +uniform mat3 array17[1][1]; > > +uniform mat3x2 array18[1][1]; > > +uniform mat3x3 array19[1][1]; > > +uniform mat3x4 array20[1][1]; > > +uniform mat4 array21[1][1]; > > +uniform mat4x2 array22[1][1]; > > +uniform mat4x3 array23[1][1]; > > +uniform mat4x4 array24[1][1]; > > +uniform sampler1D array25[1][1]; > > +uniform sampler2D array26[1][1]; > > +uniform sampler3D array27[1][1]; > > +uniform samplerCube array28[1][1]; > > +uniform sampler1DShadow array29[1][1]; > > +uniform sampler2DShadow array30[1][1]; > There quite a few missing here: samplerCubeShadow, sampler2DRectShadow, > sampler1DArrayShadow, sampler2DArrayShadow, samplerCubeArrayShadow, > sampler2DRect, and more. Also, you do not test samplers for integers and > unsigned. I guess you missed the comment at the top: This is just /tests/spec/glsl-1.20/compiler/structure-and-array-operations/array-of-any-type.vert with an extra dimension added. So anything added after glsl 1.20 is missing. However you are right I should create tests to cover everything so I've submitted new tests that cover all basic types. Thanks for the feedback. > > I know it is boring but only by increasing coverage can we really test > for non-regression in non-trivial cases (AKA, the ones that make us > loose time when debugging). > > It would be great if you could already add tests for image load store > and atomic counters so at it puts the burden of making sure this > extension still works when they get enabled. Of course, they would need > to be in separate tests. > > Other than that, I like the idea. Plain simple but quite necessary. > > + > > +void main() { gl_Position = vec4(0.0); } > ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH V2 2/2] arb_arrays_of_arrays: compile test all basic types
V2: fix glsl-1.20-basic-types.vert previously it contained the glsl-4.20-basic-types.frag test Test results: Nvidia GeForce 840M - NVIDIA 346.47: pass --- .../compiler/glsl-1.20-basic-types.vert| 44 + .../compiler/glsl-1.30-basic-types.vert| 31 +++ .../compiler/glsl-1.40-basic-types.vert| 19 + .../compiler/glsl-1.50-basic-types.vert| 18 + .../compiler/glsl-4.00-basic-types.vert| 32 +++ .../compiler/glsl-4.20-basic-types.frag| 46 ++ 6 files changed, 190 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/glsl-1.20-basic-types.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/glsl-1.30-basic-types.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/glsl-1.40-basic-types.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/glsl-1.50-basic-types.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/glsl-4.00-basic-types.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/glsl-4.20-basic-types.frag diff --git a/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.20-basic-types.vert b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.20-basic-types.vert new file mode 100644 index 000..0ce45da --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.20-basic-types.vert @@ -0,0 +1,44 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "All basic types and structures can be formed into arrays." + */ +#version 120 +#extension GL_ARB_arrays_of_arrays: enable + +uniform float array01[1][1]; +uniform int array02[1][1]; +uniform bool array03[1][1]; +uniform vec2 array04[1][1]; +uniform vec3 array05[1][1]; +uniform vec4 array06[1][1]; +uniform ivec2 array07[1][1]; +uniform ivec3 array08[1][1]; +uniform ivec4 array09[1][1]; +uniform bvec2 array10[1][1]; +uniform bvec3 array11[1][1]; +uniform bvec4 array12[1][1]; +uniform mat2 array13[1][1]; +uniform mat2x2 array14[1][1]; +uniform mat2x3 array15[1][1]; +uniform mat2x4 array16[1][1]; +uniform mat3 array17[1][1]; +uniform mat3x2 array18[1][1]; +uniform mat3x3 array19[1][1]; +uniform mat3x4 array20[1][1]; +uniform mat4 array21[1][1]; +uniform mat4x2 array22[1][1]; +uniform mat4x3 array23[1][1]; +uniform mat4x4 array24[1][1]; +uniform sampler1D array25[1][1]; +uniform sampler2D array26[1][1]; +uniform sampler3D array27[1][1]; +uniform samplerCube array28[1][1]; +uniform sampler1DShadow array29[1][1]; +uniform sampler2DShadow array30[1][1]; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.30-basic-types.vert b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.30-basic-types.vert new file mode 100644 index 000..a712980 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.30-basic-types.vert @@ -0,0 +1,31 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.30 + * [end config] + * + * Test the basic types added in glsl 1.30 + */ +#version 130 +#extension GL_ARB_arrays_of_arrays: enable + +uniform uint array01[1][1]; +uniform uvec2 array02[1][1]; +uniform uvec3 array03[1][1]; +uniform uvec4 array04[1][1]; +uniform samplerCubeShadow array05[1][1]; +uniform sampler1DArray array06[1][1]; +uniform sampler2DArray array07[1][1]; +uniform isampler1D array08[1][1]; +uniform isampler2D array09[1][1]; +uniform isampler3D array10[1][1]; +uniform isamplerCube array11[1][1]; +uniform isampler1DArray array12[1][1]; +uniform isampler2DArray array13[1][1]; +uniform usampler1D array14[1][1]; +uniform usampler2D array15[1][1]; +uniform usampler3D array16[1][1]; +uniform usamplerCube array17[1][1]; +uniform usampler1DArray array18[1][1]; +uniform usampler2DArray array19[1][1]; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.40-basic-types.vert b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.40-basic-types.vert new file mode 100644 index 000..4d83565 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.40-basic-types.vert @@ -0,0 +1,19 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.40 + * [end config] + * + * Test the basic types added in glsl 1.40 + */ +#version 140 +#extension GL_ARB_arrays_of_arrays: enable + +uniform sampler2DRect array01[1][1]; +uniform isampler2DRect array02[1][1]; +uniform usampler2DRect array03[1][1]; +uniform sampler2DRectShadow array04[1][1]; +uniform samplerBuffer array05[1][1]; +uniform isamplerBuffer array06[1][1]; +uniform usamplerBuffer array07[1][1]; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.50-basic-types.vert b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.50-basic-types.vert new file mode 100644 index 000..8996870 --- /dev/null +++ b/tests/spec/arb_array
Re: [Piglit] [PATCH 2/2] arb_arrays_of_arrays: compile test all basic types
On Wed, Apr 1, 2015 at 1:01 AM, Timothy Arceri wrote: > Test results: > > Nvidia GeForce 840M - NVIDIA 346.47: pass > --- > .../compiler/glsl-1.20-basic-types.vert| 46 > ++ > .../compiler/glsl-1.30-basic-types.vert| 31 +++ > .../compiler/glsl-1.40-basic-types.vert| 19 + > .../compiler/glsl-1.50-basic-types.vert| 18 + > .../compiler/glsl-4.00-basic-types.vert| 32 +++ > .../compiler/glsl-4.20-basic-types.frag| 46 > ++ > 6 files changed, 192 insertions(+) > create mode 100644 > tests/spec/arb_arrays_of_arrays/compiler/glsl-1.20-basic-types.vert > create mode 100644 > tests/spec/arb_arrays_of_arrays/compiler/glsl-1.30-basic-types.vert > create mode 100644 > tests/spec/arb_arrays_of_arrays/compiler/glsl-1.40-basic-types.vert > create mode 100644 > tests/spec/arb_arrays_of_arrays/compiler/glsl-1.50-basic-types.vert > create mode 100644 > tests/spec/arb_arrays_of_arrays/compiler/glsl-4.00-basic-types.vert > create mode 100644 > tests/spec/arb_arrays_of_arrays/compiler/glsl-4.20-basic-types.frag > > diff --git > a/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.20-basic-types.vert > b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.20-basic-types.vert > new file mode 100644 > index 000..3bb25e1 > --- /dev/null > +++ b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.20-basic-types.vert > @@ -0,0 +1,46 @@ > +/* [config] > + * expect_result: pass > + * glsl_version: 4.20 don't all these need some sort of statement that they require ARB_arrays_of_arrays to run? Otherwise piglit will fail them... > + * [end config] > + * > + * Test the basic types added in glsl 4.20 > + */ > +#version 420 > +#extension GL_ARB_arrays_of_arrays: enable > + > +uniform atomic_uint array01[1][1]; > +writeonly uniform image1D array02[1][1]; > +writeonly uniform iimage1D array03[1][1]; > +writeonly uniform uimage1D array04[1][1]; > +writeonly uniform image2D array05[1][1]; > +writeonly uniform iimage2D array06[1][1]; > +writeonly uniform uimage2D array07[1][1]; > +writeonly uniform image3D array08[1][1]; > +writeonly uniform iimage3D array09[1][1]; > +writeonly uniform uimage3D array10[1][1]; > +writeonly uniform image2DRect array11[1][1]; > +writeonly uniform iimage2DRect array12[1][1]; > +writeonly uniform uimage2DRect array13[1][1]; > +writeonly uniform imageCube array14[1][1]; > +writeonly uniform iimageCube array15[1][1]; > +writeonly uniform uimageCube array16[1][1]; > +writeonly uniform imageBuffer array17[1][1]; > +writeonly uniform iimageBuffer array18[1][1]; > +writeonly uniform uimageBuffer array19[1][1]; > +writeonly uniform image1DArray array20[1][1]; > +writeonly uniform iimage1DArray array21[1][1]; > +writeonly uniform uimage1DArray array22[1][1]; > +writeonly uniform image2DArray array23[1][1]; > +writeonly uniform iimage2DArray array24[1][1]; > +writeonly uniform uimage2DArray array25[1][1]; > +writeonly uniform imageCubeArray array26[1][1]; > +writeonly uniform iimageCubeArray array27[1][1]; > +writeonly uniform uimageCubeArray array28[1][1]; > +writeonly uniform image2DMS array29[1][1]; > +writeonly uniform iimage2DMS array30[1][1]; > +writeonly uniform uimage2DMS array31[1][1]; > +writeonly uniform image2DMSArray array32[1][1]; > +writeonly uniform iimage2DMSArray array33[1][1]; > +writeonly uniform uimage2DMSArray array34[1][1]; > + > +void main() { gl_FragColor = vec4(0.0); } > diff --git > a/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.30-basic-types.vert > b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.30-basic-types.vert > new file mode 100644 > index 000..a712980 > --- /dev/null > +++ b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.30-basic-types.vert > @@ -0,0 +1,31 @@ > +/* [config] > + * expect_result: pass > + * glsl_version: 1.30 > + * [end config] > + * > + * Test the basic types added in glsl 1.30 > + */ > +#version 130 > +#extension GL_ARB_arrays_of_arrays: enable > + > +uniform uint array01[1][1]; > +uniform uvec2 array02[1][1]; > +uniform uvec3 array03[1][1]; > +uniform uvec4 array04[1][1]; > +uniform samplerCubeShadow array05[1][1]; > +uniform sampler1DArray array06[1][1]; > +uniform sampler2DArray array07[1][1]; > +uniform isampler1D array08[1][1]; > +uniform isampler2D array09[1][1]; > +uniform isampler3D array10[1][1]; > +uniform isamplerCube array11[1][1]; > +uniform isampler1DArray array12[1][1]; > +uniform isampler2DArray array13[1][1]; > +uniform usampler1D array14[1][1]; > +uniform usampler2D array15[1][1]; > +uniform usampler3D array16[1][1]; > +uniform usamplerCube array17[1][1]; > +uniform usampler1DArray array18[1][1]; > +uniform usampler2DArray array19[1][1]; > + > +void main() { gl_Position = vec4(0.0); } > diff --git > a/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.40-basic-types.vert > b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.40-basic-types.vert > new file mode 100644 > index 000.
Re: [Piglit] [PATCH 2/2] arb_arrays_of_arrays: compile test all basic types
On Wed, 2015-04-01 at 01:29 -0400, Ilia Mirkin wrote: > On Wed, Apr 1, 2015 at 1:01 AM, Timothy Arceri wrote: > > Test results: > > > > Nvidia GeForce 840M - NVIDIA 346.47: pass > > --- > > .../compiler/glsl-1.20-basic-types.vert| 46 > > ++ > > .../compiler/glsl-1.30-basic-types.vert| 31 +++ > > .../compiler/glsl-1.40-basic-types.vert| 19 + > > .../compiler/glsl-1.50-basic-types.vert| 18 + > > .../compiler/glsl-4.00-basic-types.vert| 32 +++ > > .../compiler/glsl-4.20-basic-types.frag| 46 > > ++ > > 6 files changed, 192 insertions(+) > > create mode 100644 > > tests/spec/arb_arrays_of_arrays/compiler/glsl-1.20-basic-types.vert > > create mode 100644 > > tests/spec/arb_arrays_of_arrays/compiler/glsl-1.30-basic-types.vert > > create mode 100644 > > tests/spec/arb_arrays_of_arrays/compiler/glsl-1.40-basic-types.vert > > create mode 100644 > > tests/spec/arb_arrays_of_arrays/compiler/glsl-1.50-basic-types.vert > > create mode 100644 > > tests/spec/arb_arrays_of_arrays/compiler/glsl-4.00-basic-types.vert > > create mode 100644 > > tests/spec/arb_arrays_of_arrays/compiler/glsl-4.20-basic-types.frag > > > > diff --git > > a/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.20-basic-types.vert > > b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.20-basic-types.vert > > new file mode 100644 > > index 000..3bb25e1 > > --- /dev/null > > +++ b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.20-basic-types.vert > > @@ -0,0 +1,46 @@ > > +/* [config] > > + * expect_result: pass > > + * glsl_version: 4.20 > > don't all these need some sort of statement that they require > ARB_arrays_of_arrays to run? Otherwise piglit will fail them... Whoops. Yes they should. ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH V3 2/2] arb_arrays_of_arrays: compile test all basic types
V3: Tell piglit that GL_ARB_arrays_of_arrays is required V2: fix glsl-1.20-basic-types.vert previously it contained the glsl-4.20-basic-types.frag test Test results: Nvidia GeForce 840M - NVIDIA 346.47: pass --- .../compiler/glsl-1.20-basic-types.vert| 45 + .../compiler/glsl-1.30-basic-types.vert| 32 +++ .../compiler/glsl-1.40-basic-types.vert| 20 + .../compiler/glsl-1.50-basic-types.vert| 19 + .../compiler/glsl-4.00-basic-types.vert| 33 +++ .../compiler/glsl-4.20-basic-types.frag| 47 ++ 6 files changed, 196 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/glsl-1.20-basic-types.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/glsl-1.30-basic-types.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/glsl-1.40-basic-types.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/glsl-1.50-basic-types.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/glsl-4.00-basic-types.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/glsl-4.20-basic-types.frag diff --git a/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.20-basic-types.vert b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.20-basic-types.vert new file mode 100644 index 000..02c5c67 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.20-basic-types.vert @@ -0,0 +1,45 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * require_extensions: GL_ARB_arrays_of_arrays + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "All basic types and structures can be formed into arrays." + */ +#version 120 +#extension GL_ARB_arrays_of_arrays: enable + +uniform float array01[1][1]; +uniform int array02[1][1]; +uniform bool array03[1][1]; +uniform vec2 array04[1][1]; +uniform vec3 array05[1][1]; +uniform vec4 array06[1][1]; +uniform ivec2 array07[1][1]; +uniform ivec3 array08[1][1]; +uniform ivec4 array09[1][1]; +uniform bvec2 array10[1][1]; +uniform bvec3 array11[1][1]; +uniform bvec4 array12[1][1]; +uniform mat2 array13[1][1]; +uniform mat2x2 array14[1][1]; +uniform mat2x3 array15[1][1]; +uniform mat2x4 array16[1][1]; +uniform mat3 array17[1][1]; +uniform mat3x2 array18[1][1]; +uniform mat3x3 array19[1][1]; +uniform mat3x4 array20[1][1]; +uniform mat4 array21[1][1]; +uniform mat4x2 array22[1][1]; +uniform mat4x3 array23[1][1]; +uniform mat4x4 array24[1][1]; +uniform sampler1D array25[1][1]; +uniform sampler2D array26[1][1]; +uniform sampler3D array27[1][1]; +uniform samplerCube array28[1][1]; +uniform sampler1DShadow array29[1][1]; +uniform sampler2DShadow array30[1][1]; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.30-basic-types.vert b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.30-basic-types.vert new file mode 100644 index 000..1e718ea --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.30-basic-types.vert @@ -0,0 +1,32 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.30 + * require_extensions: GL_ARB_arrays_of_arrays + * [end config] + * + * Test the basic types added in glsl 1.30 + */ +#version 130 +#extension GL_ARB_arrays_of_arrays: enable + +uniform uint array01[1][1]; +uniform uvec2 array02[1][1]; +uniform uvec3 array03[1][1]; +uniform uvec4 array04[1][1]; +uniform samplerCubeShadow array05[1][1]; +uniform sampler1DArray array06[1][1]; +uniform sampler2DArray array07[1][1]; +uniform isampler1D array08[1][1]; +uniform isampler2D array09[1][1]; +uniform isampler3D array10[1][1]; +uniform isamplerCube array11[1][1]; +uniform isampler1DArray array12[1][1]; +uniform isampler2DArray array13[1][1]; +uniform usampler1D array14[1][1]; +uniform usampler2D array15[1][1]; +uniform usampler3D array16[1][1]; +uniform usamplerCube array17[1][1]; +uniform usampler1DArray array18[1][1]; +uniform usampler2DArray array19[1][1]; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.40-basic-types.vert b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.40-basic-types.vert new file mode 100644 index 000..a4488bc --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/glsl-1.40-basic-types.vert @@ -0,0 +1,20 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.40 + * require_extensions: GL_ARB_arrays_of_arrays + * [end config] + * + * Test the basic types added in glsl 1.40 + */ +#version 140 +#extension GL_ARB_arrays_of_arrays: enable + +uniform sampler2DRect array01[1][1]; +uniform isampler2DRect array02[1][1]; +uniform usampler2DRect array03[1][1]; +uniform sampler2DRectShadow array04[1][1]; +uniform samplerBuffer array05[1][1]; +uniform isamplerBuffer array06[1][1]; +uniform usamplerBuffer array07[1][1]; + +void main() { gl_Position = vec4(0.0); } diff --git a/tests/spec/arb_arrays
Re: [Piglit] [PATCH] arb_arrays_of_arrays: compile test basic types
On 01/04/15 08:14, Timothy Arceri wrote: On Tue, 2015-03-31 at 12:02 +0300, Martin Peres wrote: On 30/03/15 10:29, Timothy Arceri wrote: Test results: Nvidia GeForce 840M - NVIDIA 346.47: pass --- This is just /tests/spec/glsl-1.20/compiler/structure-and-array-operations/array-of-any-type.vert with an extra dimension added. .../compiler/arrays-of-any-type.vert | 44 ++ 1 file changed, 44 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert diff --git a/tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert b/tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert new file mode 100644 index 000..0ce45da --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/arrays-of-any-type.vert @@ -0,0 +1,44 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "All basic types and structures can be formed into arrays." + */ +#version 120 +#extension GL_ARB_arrays_of_arrays: enable + +uniform float array01[1][1]; +uniform int array02[1][1]; For the sake of completeness: uint and double are missing here. +uniform bool array03[1][1]; +uniform vec2 array04[1][1]; +uniform vec3 array05[1][1]; +uniform vec4 array06[1][1]; +uniform ivec2 array07[1][1]; +uniform ivec3 array08[1][1]; +uniform ivec4 array09[1][1]; uvec and dvec? +uniform bvec2 array10[1][1]; +uniform bvec3 array11[1][1]; +uniform bvec4 array12[1][1]; +uniform mat2 array13[1][1]; +uniform mat2x2 array14[1][1]; +uniform mat2x3 array15[1][1]; +uniform mat2x4 array16[1][1]; +uniform mat3 array17[1][1]; +uniform mat3x2 array18[1][1]; +uniform mat3x3 array19[1][1]; +uniform mat3x4 array20[1][1]; +uniform mat4 array21[1][1]; +uniform mat4x2 array22[1][1]; +uniform mat4x3 array23[1][1]; +uniform mat4x4 array24[1][1]; +uniform sampler1D array25[1][1]; +uniform sampler2D array26[1][1]; +uniform sampler3D array27[1][1]; +uniform samplerCube array28[1][1]; +uniform sampler1DShadow array29[1][1]; +uniform sampler2DShadow array30[1][1]; There quite a few missing here: samplerCubeShadow, sampler2DRectShadow, sampler1DArrayShadow, sampler2DArrayShadow, samplerCubeArrayShadow, sampler2DRect, and more. Also, you do not test samplers for integers and unsigned. I guess you missed the comment at the top: This is just /tests/spec/glsl-1.20/compiler/structure-and-array-operations/array-of-any-type.vert with an extra dimension added. I definitely missed it, indeed. So anything added after glsl 1.20 is missing. However you are right I should create tests to cover everything so I've submitted new tests that cover all basic types. Thanks for the feedback. Thanks :) I know it is boring but only by increasing coverage can we really test for non-regression in non-trivial cases (AKA, the ones that make us loose time when debugging). It would be great if you could already add tests for image load store and atomic counters so at it puts the burden of making sure this extension still works when they get enabled. Of course, they would need to be in separate tests. Other than that, I like the idea. Plain simple but quite necessary. + +void main() { gl_Position = vec4(0.0); } ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit