Re: [Piglit] [PATCH] abr_gpu_shader_fp64: Verify that setting a double with glUniform*fv is an error
On Mon, Aug 31, 2015 at 8:55 PM, Ian Romanick wrote: > From: Ian Romanick > > Also verify that setting a float with glUniform*dv generates an error. > > NOTE: Mesa currently fails the matrix tests. > > Signed-off-by: Ian Romanick > Cc: Dave Airlie > --- Typo in subject: abr -> arb ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] abr_gpu_shader_fp64: Verify that setting a double with glUniform*fv is an error
On Mon, Aug 31, 2015 at 11:55 PM, Ian Romanick wrote: > From: Ian Romanick > > Also verify that setting a float with glUniform*dv generates an error. > > NOTE: Mesa currently fails the matrix tests. > > Signed-off-by: Ian Romanick > Cc: Dave Airlie > --- > I will have a patch out on the mesa-dev list that _should_ fix this. > I can't fully run it on my driver. :( The bug was discovered while > inspecting the code to make other, unrelated changes. > > tests/all.py | 1 + > .../execution/CMakeLists.gl.txt| 1 + > .../execution/wrong-type-setter.c | 198 > + > 3 files changed, 200 insertions(+) > create mode 100644 > tests/spec/arb_gpu_shader_fp64/execution/wrong-type-setter.c > > diff --git a/tests/all.py b/tests/all.py > index fcfc5cd..b21a5df 100644 > --- a/tests/all.py > +++ b/tests/all.py > @@ -2105,6 +2105,7 @@ with profile.group_manager( > g(['arb_gpu_shader_fp64-tf-interleaved']) > g(['arb_gpu_shader_fp64-tf-interleaved-aligned']) > g(['arb_gpu_shader_fp64-getuniformdv']) > + g(['arb_gpu_shader_fp64-wrong-type-setter']) > > with profile.group_manager( > PiglitGLTest, > diff --git a/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt > b/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt > index 6738363..650b312 100644 > --- a/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt > +++ b/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt > @@ -15,3 +15,4 @@ piglit_add_executable (arb_gpu_shader_fp64-tf-interleaved > tf-interleaved.c) > piglit_add_executable (arb_gpu_shader_fp64-tf-interleaved-aligned > tf-interleaved-aligned.c) > piglit_add_executable > (arb_gpu_shader_fp64-double-gettransformfeedbackvarying > double-gettransformfeedbackvarying.c) > piglit_add_executable (arb_gpu_shader_fp64-getuniformdv getuniformdv.c) > +piglit_add_executable (arb_gpu_shader_fp64-wrong-type-setter > wrong-type-setter.c) > diff --git a/tests/spec/arb_gpu_shader_fp64/execution/wrong-type-setter.c > b/tests/spec/arb_gpu_shader_fp64/execution/wrong-type-setter.c > new file mode 100644 > index 000..7940ef2 > --- /dev/null > +++ b/tests/spec/arb_gpu_shader_fp64/execution/wrong-type-setter.c > @@ -0,0 +1,198 @@ > +/* > + * 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. > + */ > + > +/** > + * \name wronge-type-setter.c > + * Try setting a double uniform with a float setter, expect an error. > + * > + * Also try the vice-versa combinations. > + */ > +#include "piglit-util-gl.h" > + > +PIGLIT_GL_TEST_CONFIG_BEGIN > + > + config.supports_gl_core_version = 32; > + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; > + > +PIGLIT_GL_TEST_CONFIG_END > + > +static const char vs_source[] = > + "#version 330\n" The test description above only requires version 150. AFAIK there's no need for anything higher... > + "#extension GL_ARB_gpu_shader_fp64: require\n" > + "\n" > + "uniform float f1;\n" > + "uniform vec2f2;\n" > + "uniform vec3f3;\n" > + "uniform vec4f4;\n" > + "\n" > + "uniform mat2fm22;\n" > + "uniform mat2x3 fm23;\n" > + "uniform mat2x4 fm24;\n" > + "uniform mat3x2 fm32;\n" > + "uniform mat3fm33;\n" > + "uniform mat3x4 fm34;\n" > + "uniform mat4x2 fm42;\n" > + "uniform mat4x3 fm43;\n" > + "uniform mat4fm44;\n" > + "\n" > + "flat out vec4 outf;\n" > + "\n" > + "uniform double d1;\n" > + "uniform dvec2 d2;\n" > + "uniform dvec3 d3;\n" > + "uniform dvec4 d4;\n" > + "\n" > + "uniform dmat2 dm22;\n" > + "uniform dmat2x3 dm23;\n" > + "uniform dmat2x4 dm24;\n" > + "uniform
[Piglit] [PATCH] abr_gpu_shader_fp64: Verify that setting a double with glUniform*fv is an error
From: Ian Romanick Also verify that setting a float with glUniform*dv generates an error. NOTE: Mesa currently fails the matrix tests. Signed-off-by: Ian Romanick Cc: Dave Airlie --- I will have a patch out on the mesa-dev list that _should_ fix this. I can't fully run it on my driver. :( The bug was discovered while inspecting the code to make other, unrelated changes. tests/all.py | 1 + .../execution/CMakeLists.gl.txt| 1 + .../execution/wrong-type-setter.c | 198 + 3 files changed, 200 insertions(+) create mode 100644 tests/spec/arb_gpu_shader_fp64/execution/wrong-type-setter.c diff --git a/tests/all.py b/tests/all.py index fcfc5cd..b21a5df 100644 --- a/tests/all.py +++ b/tests/all.py @@ -2105,6 +2105,7 @@ with profile.group_manager( g(['arb_gpu_shader_fp64-tf-interleaved']) g(['arb_gpu_shader_fp64-tf-interleaved-aligned']) g(['arb_gpu_shader_fp64-getuniformdv']) + g(['arb_gpu_shader_fp64-wrong-type-setter']) with profile.group_manager( PiglitGLTest, diff --git a/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt b/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt index 6738363..650b312 100644 --- a/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt +++ b/tests/spec/arb_gpu_shader_fp64/execution/CMakeLists.gl.txt @@ -15,3 +15,4 @@ piglit_add_executable (arb_gpu_shader_fp64-tf-interleaved tf-interleaved.c) piglit_add_executable (arb_gpu_shader_fp64-tf-interleaved-aligned tf-interleaved-aligned.c) piglit_add_executable (arb_gpu_shader_fp64-double-gettransformfeedbackvarying double-gettransformfeedbackvarying.c) piglit_add_executable (arb_gpu_shader_fp64-getuniformdv getuniformdv.c) +piglit_add_executable (arb_gpu_shader_fp64-wrong-type-setter wrong-type-setter.c) diff --git a/tests/spec/arb_gpu_shader_fp64/execution/wrong-type-setter.c b/tests/spec/arb_gpu_shader_fp64/execution/wrong-type-setter.c new file mode 100644 index 000..7940ef2 --- /dev/null +++ b/tests/spec/arb_gpu_shader_fp64/execution/wrong-type-setter.c @@ -0,0 +1,198 @@ +/* + * 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. + */ + +/** + * \name wronge-type-setter.c + * Try setting a double uniform with a float setter, expect an error. + * + * Also try the vice-versa combinations. + */ +#include "piglit-util-gl.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_core_version = 32; + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + +PIGLIT_GL_TEST_CONFIG_END + +static const char vs_source[] = + "#version 330\n" + "#extension GL_ARB_gpu_shader_fp64: require\n" + "\n" + "uniform float f1;\n" + "uniform vec2f2;\n" + "uniform vec3f3;\n" + "uniform vec4f4;\n" + "\n" + "uniform mat2fm22;\n" + "uniform mat2x3 fm23;\n" + "uniform mat2x4 fm24;\n" + "uniform mat3x2 fm32;\n" + "uniform mat3fm33;\n" + "uniform mat3x4 fm34;\n" + "uniform mat4x2 fm42;\n" + "uniform mat4x3 fm43;\n" + "uniform mat4fm44;\n" + "\n" + "flat out vec4 outf;\n" + "\n" + "uniform double d1;\n" + "uniform dvec2 d2;\n" + "uniform dvec3 d3;\n" + "uniform dvec4 d4;\n" + "\n" + "uniform dmat2 dm22;\n" + "uniform dmat2x3 dm23;\n" + "uniform dmat2x4 dm24;\n" + "uniform dmat3x2 dm32;\n" + "uniform dmat3 dm33;\n" + "uniform dmat3x4 dm34;\n" + "uniform dmat4x2 dm42;\n" + "uniform dmat4x3 dm43;\n" + "uniform dmat4 dm44;\n" + "\n" + "flat out dvec4 outd;\n" + "\n" + "void main()\n" + "{\n" + " outf = vec4(f1) +\n" + " vec4(fm22 * f2, 0, 0) +\n" + " vec4(fm32 * f3, 0,
Re: [Piglit] [PATCH] ext_texture_integer: add new tex formats test
On 1 September 2015 at 09:21, Brian Paul wrote: > Test glTexImage2D() and glGetTexImage() with a variety of internalFormats > and user formats/types. > > Note: currently fails with Mesa, passes with NVIDIA. As requested this passes on mesa with my format patches applied. Dave. ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] arb_copy_image: add new format swizzle test
On Mon, Aug 31, 2015 at 7:29 PM, Ilia Mirkin wrote: > Reviewed-by: Ilia Mirkin > > Thanks a lot for doing this! I assume that it fails with your gallium > ARB_copy_image implementation as I predicted? Oh, and same comment as on the other test -- this doesn't draw anything so it should probably do its work in piglit_init. > > On Mon, Aug 31, 2015 at 7:22 PM, Brian Paul wrote: >> Check that copies between textures whose formats may only differ by >> swizzling works correctly. >> --- >> tests/all.py| 1 + >> tests/spec/arb_copy_image/CMakeLists.gl.txt | 1 + >> tests/spec/arb_copy_image/format-swizzle.c | 229 >> >> 3 files changed, 231 insertions(+) >> create mode 100644 tests/spec/arb_copy_image/format-swizzle.c >> >> diff --git a/tests/all.py b/tests/all.py >> index 9320722..0285bc1 100644 >> --- a/tests/all.py >> +++ b/tests/all.py >> @@ -3897,6 +3897,7 @@ with profile.group_manager( >> g(['arb_copy_image-formats', '--samples=2']) >> g(['arb_copy_image-formats', '--samples=4']) >> g(['arb_copy_image-formats', '--samples=8']) >> +g(['arb_copy_image-format-swizzle']) >> >> with profile.group_manager( >> PiglitGLTest, grouptools.join('spec', 'arb_cull_distance')) as g: >> diff --git a/tests/spec/arb_copy_image/CMakeLists.gl.txt >> b/tests/spec/arb_copy_image/CMakeLists.gl.txt >> index f1a59e3..90e9270 100644 >> --- a/tests/spec/arb_copy_image/CMakeLists.gl.txt >> +++ b/tests/spec/arb_copy_image/CMakeLists.gl.txt >> @@ -12,6 +12,7 @@ piglit_add_executable (arb_copy_image-simple simple.c) >> piglit_add_executable (arb_copy_image-api_errors api_errors.c) >> piglit_add_executable (arb_copy_image-targets targets.c) >> piglit_add_executable (arb_copy_image-formats formats.c) >> +piglit_add_executable (arb_copy_image-format-swizzle format-swizzle.c) >> piglit_add_executable (arb_copy_image-srgb-copy srgb-copy.c) >> >> # vim: ft=cmake: >> diff --git a/tests/spec/arb_copy_image/format-swizzle.c >> b/tests/spec/arb_copy_image/format-swizzle.c >> new file mode 100644 >> index 000..3bbd1d2 >> --- /dev/null >> +++ b/tests/spec/arb_copy_image/format-swizzle.c >> @@ -0,0 +1,229 @@ >> +/* >> + * Copyright 2015 VMware, Inc. >> + * >> + * Permission is hereby granted, free of charge, to any person obtaining a >> + * copy of this software and associated documentation files (the >> "Software"), >> + * to deal in the Software without restriction, including without limitation >> + * the rights to use, copy, modify, merge, publish, distribute, sublicense, >> + * and/or sell copies of the Software, and to permit persons to whom the >> + * Software is furnished to do so, subject to the following conditions: >> + * >> + * The above copyright notice and this permission notice (including the next >> + * paragraph) shall be included in all copies or substantial portions of the >> + * Software. >> + * >> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS >> OR >> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, >> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL >> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR >> OTHER >> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING >> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER >> DEALINGS >> + * IN THE SOFTWARE. >> + */ >> + >> +/** >> + * This test exercises some subtle format issues for GL_ARB_copy_image. >> + * If a driver supports texture formats which only vary by swizzling (ex: >> RGBA vs. >> + * BGRA) we may wind up using different hardware texture formats depending >> + * on the user-specified format and type arguments to glTexImage. >> + * When we try to copy between such textures, the copy-sub-image code >> + * must be able to handle the swizzling. >> + * >> + * Brian Paul >> + * 31 August 2015 >> + */ >> + >> + >> +#include "piglit-util-gl.h" >> + >> +PIGLIT_GL_TEST_CONFIG_BEGIN >> + config.supports_gl_compat_version = 13; >> + config.window_visual = PIGLIT_GL_VISUAL_RGB | >> PIGLIT_GL_VISUAL_DOUBLE; >> +PIGLIT_GL_TEST_CONFIG_END >> + >> + >> +void >> +piglit_init(int argc, char **argv) >> +{ >> + piglit_require_extension("GL_ARB_copy_image"); >> +} >> + >> + >> +static bool >> +test_combination(GLenum intFormat, >> +GLenum srcFormat, GLenum srcType, >> +GLenum dstFormat, GLenum dstType) >> +{ >> + const int width = 16, height = 16; >> + int i; >> + GLuint textures[2]; >> + GLubyte *image, *getimage; >> + bool pass = true; >> + int comps; >> + >> + switch (srcFormat) { >> + case GL_RGB: >> + case GL_BGR: >> + comps = 3; >> + break; >> + case GL_RGBA: >> + case GL_BGRA: >> + case GL_RGBA_INTEGER: >> + case GL_BGRA_INTEGER: >> + comps = 4; >> +
Re: [Piglit] [PATCH] ext_texture_integer: add new tex formats test
On Mon, Aug 31, 2015 at 7:21 PM, Brian Paul wrote: > Test glTexImage2D() and glGetTexImage() with a variety of internalFormats > and user formats/types. > > Note: currently fails with Mesa, passes with NVIDIA. > --- > tests/all.py | 1 + > tests/spec/ext_texture_integer/CMakeLists.gl.txt | 1 + > tests/spec/ext_texture_integer/texformats.c | 182 > +++ > 3 files changed, 184 insertions(+) > create mode 100644 tests/spec/ext_texture_integer/texformats.c > > diff --git a/tests/all.py b/tests/all.py > index fe088f5..9320722 100644 > --- a/tests/all.py > +++ b/tests/all.py > @@ -3127,6 +3127,7 @@ with profile.group_manager( > g(['ext_texture_integer-getteximage-clamping'], 'getteximage-clamping') > g(['ext_texture_integer-getteximage-clamping', 'GL_ARB_texture_rg'], >'getteximage-clamping GL_ARB_texture_rg') > +g(['ext_texture_integer-texformats']), > g(['ext_texture_integer-texture_integer_glsl130'], >'texture_integer_glsl130') > g(['fbo-integer'], run_concurrent=False) > diff --git a/tests/spec/ext_texture_integer/CMakeLists.gl.txt > b/tests/spec/ext_texture_integer/CMakeLists.gl.txt > index 44d9399..2932bc2 100644 > --- a/tests/spec/ext_texture_integer/CMakeLists.gl.txt > +++ b/tests/spec/ext_texture_integer/CMakeLists.gl.txt > @@ -12,6 +12,7 @@ link_libraries ( > > piglit_add_executable (ext_texture_integer-fbo-blending fbo-blending.c) > piglit_add_executable (ext_texture_integer-fbo_integer_precision_clear > fbo-integer-precision-clear.c) > +piglit_add_executable (ext_texture_integer-texformats texformats.c) > piglit_add_executable (ext_texture_integer-fbo_integer_readpixels_sint_uint > fbo-integer-readpixels-sint-uint.c) > piglit_add_executable (ext_texture_integer-getteximage-clamping > getteximage-clamping.c) > piglit_add_executable (ext_texture_integer-texture_integer_glsl130 > texture-integer-glsl130.c) > diff --git a/tests/spec/ext_texture_integer/texformats.c > b/tests/spec/ext_texture_integer/texformats.c > new file mode 100644 > index 000..5a4f387 > --- /dev/null > +++ b/tests/spec/ext_texture_integer/texformats.c > @@ -0,0 +1,182 @@ > +/* > + * Copyright (c) 2015 VMware, Inc. > + * > + * Permission is hereby granted, free of charge, to any person obtaining a > + * copy of this software and associated documentation files (the "Software"), > + * to deal in the Software without restriction, including without limitation > + * 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 VMWARE 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. > + */ > + > +/** > + * Test glTexImage2D and glGetTexImage with a variety of combinations of > + * internal formats, and user-specified formats/types. > + * > + * Brian Paul > + * 31 August 2015 > + */ > + > +#include "piglit-util-gl.h" > + > +PIGLIT_GL_TEST_CONFIG_BEGIN > + config.supports_gl_compat_version = 10; > + config.window_visual = PIGLIT_GL_VISUAL_RGBA; > +PIGLIT_GL_TEST_CONFIG_END > + > + > +static bool > +test_format(GLenum intFormat, GLenum format, GLenum type) > +{ > + const int width = 8, height = 8; > + GLuint tex; > + GLubyte *image, *getimage; > + bool pass = true; > + int i, bytes; > + > + switch (intFormat) { > + case GL_ALPHA8I_EXT: > + case GL_ALPHA8UI_EXT: > + bytes = 1; > + break; > + case GL_ALPHA16I_EXT: > + case GL_ALPHA16UI_EXT: > + bytes = 2; > + break; > + case GL_ALPHA32I_EXT: > + case GL_ALPHA32UI_EXT: > + bytes = 4; > + break; > + case GL_RGB8I: > + case GL_RGB8UI: > + bytes = 3; > + break; > + case GL_RGBA8I: > + case GL_RGBA8UI: > + bytes = 4; > + break; > + case GL_RGB16I: > + case GL_RGB16UI: > + bytes = 6; > + break; > + case GL_RGBA16I: > + case GL_RGBA16UI: > + bytes = 8; > + break; > + case GL_RGB32I: > + case GL_RGB32UI: > + bytes = 12; > + break;
Re: [Piglit] [PATCH] arb_copy_image: add new format swizzle test
Reviewed-by: Ilia Mirkin Thanks a lot for doing this! I assume that it fails with your gallium ARB_copy_image implementation as I predicted? On Mon, Aug 31, 2015 at 7:22 PM, Brian Paul wrote: > Check that copies between textures whose formats may only differ by > swizzling works correctly. > --- > tests/all.py| 1 + > tests/spec/arb_copy_image/CMakeLists.gl.txt | 1 + > tests/spec/arb_copy_image/format-swizzle.c | 229 > > 3 files changed, 231 insertions(+) > create mode 100644 tests/spec/arb_copy_image/format-swizzle.c > > diff --git a/tests/all.py b/tests/all.py > index 9320722..0285bc1 100644 > --- a/tests/all.py > +++ b/tests/all.py > @@ -3897,6 +3897,7 @@ with profile.group_manager( > g(['arb_copy_image-formats', '--samples=2']) > g(['arb_copy_image-formats', '--samples=4']) > g(['arb_copy_image-formats', '--samples=8']) > +g(['arb_copy_image-format-swizzle']) > > with profile.group_manager( > PiglitGLTest, grouptools.join('spec', 'arb_cull_distance')) as g: > diff --git a/tests/spec/arb_copy_image/CMakeLists.gl.txt > b/tests/spec/arb_copy_image/CMakeLists.gl.txt > index f1a59e3..90e9270 100644 > --- a/tests/spec/arb_copy_image/CMakeLists.gl.txt > +++ b/tests/spec/arb_copy_image/CMakeLists.gl.txt > @@ -12,6 +12,7 @@ piglit_add_executable (arb_copy_image-simple simple.c) > piglit_add_executable (arb_copy_image-api_errors api_errors.c) > piglit_add_executable (arb_copy_image-targets targets.c) > piglit_add_executable (arb_copy_image-formats formats.c) > +piglit_add_executable (arb_copy_image-format-swizzle format-swizzle.c) > piglit_add_executable (arb_copy_image-srgb-copy srgb-copy.c) > > # vim: ft=cmake: > diff --git a/tests/spec/arb_copy_image/format-swizzle.c > b/tests/spec/arb_copy_image/format-swizzle.c > new file mode 100644 > index 000..3bbd1d2 > --- /dev/null > +++ b/tests/spec/arb_copy_image/format-swizzle.c > @@ -0,0 +1,229 @@ > +/* > + * Copyright 2015 VMware, Inc. > + * > + * Permission is hereby granted, free of charge, to any person obtaining a > + * copy of this software and associated documentation files (the "Software"), > + * to deal in the Software without restriction, including without limitation > + * the rights to use, copy, modify, merge, publish, distribute, sublicense, > + * and/or sell copies of the Software, and to permit persons to whom the > + * Software is furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice (including the next > + * paragraph) shall be included in all copies or substantial portions of the > + * Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > DEALINGS > + * IN THE SOFTWARE. > + */ > + > +/** > + * This test exercises some subtle format issues for GL_ARB_copy_image. > + * If a driver supports texture formats which only vary by swizzling (ex: > RGBA vs. > + * BGRA) we may wind up using different hardware texture formats depending > + * on the user-specified format and type arguments to glTexImage. > + * When we try to copy between such textures, the copy-sub-image code > + * must be able to handle the swizzling. > + * > + * Brian Paul > + * 31 August 2015 > + */ > + > + > +#include "piglit-util-gl.h" > + > +PIGLIT_GL_TEST_CONFIG_BEGIN > + config.supports_gl_compat_version = 13; > + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; > +PIGLIT_GL_TEST_CONFIG_END > + > + > +void > +piglit_init(int argc, char **argv) > +{ > + piglit_require_extension("GL_ARB_copy_image"); > +} > + > + > +static bool > +test_combination(GLenum intFormat, > +GLenum srcFormat, GLenum srcType, > +GLenum dstFormat, GLenum dstType) > +{ > + const int width = 16, height = 16; > + int i; > + GLuint textures[2]; > + GLubyte *image, *getimage; > + bool pass = true; > + int comps; > + > + switch (srcFormat) { > + case GL_RGB: > + case GL_BGR: > + comps = 3; > + break; > + case GL_RGBA: > + case GL_BGRA: > + case GL_RGBA_INTEGER: > + case GL_BGRA_INTEGER: > + comps = 4; > + break; > + default: > + assert(!"Unexpected format"); > + comps = 4; > + } > + > + getimage = malloc(width * height * comps); > + > + image = malloc(width * height * comps); > + if (comps == 4) { > + for (i = 0; i < width * height; i++
[Piglit] [PATCH] arb_copy_image: add new format swizzle test
Check that copies between textures whose formats may only differ by swizzling works correctly. --- tests/all.py| 1 + tests/spec/arb_copy_image/CMakeLists.gl.txt | 1 + tests/spec/arb_copy_image/format-swizzle.c | 229 3 files changed, 231 insertions(+) create mode 100644 tests/spec/arb_copy_image/format-swizzle.c diff --git a/tests/all.py b/tests/all.py index 9320722..0285bc1 100644 --- a/tests/all.py +++ b/tests/all.py @@ -3897,6 +3897,7 @@ with profile.group_manager( g(['arb_copy_image-formats', '--samples=2']) g(['arb_copy_image-formats', '--samples=4']) g(['arb_copy_image-formats', '--samples=8']) +g(['arb_copy_image-format-swizzle']) with profile.group_manager( PiglitGLTest, grouptools.join('spec', 'arb_cull_distance')) as g: diff --git a/tests/spec/arb_copy_image/CMakeLists.gl.txt b/tests/spec/arb_copy_image/CMakeLists.gl.txt index f1a59e3..90e9270 100644 --- a/tests/spec/arb_copy_image/CMakeLists.gl.txt +++ b/tests/spec/arb_copy_image/CMakeLists.gl.txt @@ -12,6 +12,7 @@ piglit_add_executable (arb_copy_image-simple simple.c) piglit_add_executable (arb_copy_image-api_errors api_errors.c) piglit_add_executable (arb_copy_image-targets targets.c) piglit_add_executable (arb_copy_image-formats formats.c) +piglit_add_executable (arb_copy_image-format-swizzle format-swizzle.c) piglit_add_executable (arb_copy_image-srgb-copy srgb-copy.c) # vim: ft=cmake: diff --git a/tests/spec/arb_copy_image/format-swizzle.c b/tests/spec/arb_copy_image/format-swizzle.c new file mode 100644 index 000..3bbd1d2 --- /dev/null +++ b/tests/spec/arb_copy_image/format-swizzle.c @@ -0,0 +1,229 @@ +/* + * Copyright 2015 VMware, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/** + * This test exercises some subtle format issues for GL_ARB_copy_image. + * If a driver supports texture formats which only vary by swizzling (ex: RGBA vs. + * BGRA) we may wind up using different hardware texture formats depending + * on the user-specified format and type arguments to glTexImage. + * When we try to copy between such textures, the copy-sub-image code + * must be able to handle the swizzling. + * + * Brian Paul + * 31 August 2015 + */ + + +#include "piglit-util-gl.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + config.supports_gl_compat_version = 13; + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; +PIGLIT_GL_TEST_CONFIG_END + + +void +piglit_init(int argc, char **argv) +{ + piglit_require_extension("GL_ARB_copy_image"); +} + + +static bool +test_combination(GLenum intFormat, +GLenum srcFormat, GLenum srcType, +GLenum dstFormat, GLenum dstType) +{ + const int width = 16, height = 16; + int i; + GLuint textures[2]; + GLubyte *image, *getimage; + bool pass = true; + int comps; + + switch (srcFormat) { + case GL_RGB: + case GL_BGR: + comps = 3; + break; + case GL_RGBA: + case GL_BGRA: + case GL_RGBA_INTEGER: + case GL_BGRA_INTEGER: + comps = 4; + break; + default: + assert(!"Unexpected format"); + comps = 4; + } + + getimage = malloc(width * height * comps); + + image = malloc(width * height * comps); + if (comps == 4) { + for (i = 0; i < width * height; i++) { + image[i * 4 + 0] = 0xff; + image[i * 4 + 1] = 0x80; + image[i * 4 + 2] = 0x40; + image[i * 4 + 3] = 0x20; + } + } + else { + for (i = 0; i < width * height; i++) { + image[i * 3 + 0] = 0xff; + image[i * 3 + 1] = 0x80; + image[i * 3 + 2] = 0x40; +
[Piglit] [PATCH] arb_copy_image: fix a few error check tests
Some of the error checks were incorrect before. Per the spec: 1. GL_TEXTURE_BUFFER and GL_TEXTURE_CUBE_MAP_+/-_XYZ are not legal targets and should be flagged as invalid enums. 2. GL_INVALID_OPERATION should be generated when trying to copy between compressed/uncompressed formats whose block/texel size do not match. --- tests/spec/arb_copy_image/api_errors.c | 23 +++ 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/tests/spec/arb_copy_image/api_errors.c b/tests/spec/arb_copy_image/api_errors.c index 0ef1eda..6f94d06 100644 --- a/tests/spec/arb_copy_image/api_errors.c +++ b/tests/spec/arb_copy_image/api_errors.c @@ -140,7 +140,14 @@ test_simple_errors(GLenum src_target, GLenum dst_target) glCopyImageSubData(src, targets[i], 0, 0, 0, 0, dst, dst_target, 0, 0, 0, 0, 0, 0, 0); - pass &= piglit_check_gl_error(GL_INVALID_ENUM); +if (targets[i] == GL_TEXTURE_BUFFER || + (targets[i] >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && +targets[i] <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z)) { + pass &= piglit_check_gl_error(GL_INVALID_ENUM); + } + else { + pass &= piglit_check_gl_error(GL_INVALID_VALUE); + } if (!pass) return false; } @@ -154,7 +161,14 @@ test_simple_errors(GLenum src_target, GLenum dst_target) glCopyImageSubData(src, src_target, 0, 0, 0, 0, dst, targets[i], 0, 0, 0, 0, 0, 0, 0); - pass &= piglit_check_gl_error(GL_INVALID_ENUM); +if (targets[i] == GL_TEXTURE_BUFFER || + (targets[i] >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && +targets[i] <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z)) { + pass &= piglit_check_gl_error(GL_INVALID_ENUM); + } + else { + pass &= piglit_check_gl_error(GL_INVALID_VALUE); + } if (!pass) return false; } @@ -235,14 +249,15 @@ test_compressed_alignment_errors() glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGB16UI, 32, 32); glCopyImageSubData(tex[0], GL_TEXTURE_2D, 0, 0, 0, 0, tex[2], GL_TEXTURE_2D, 0, 0, 0, 0, 20, 20, 1); - pass &= piglit_check_gl_error(GL_INVALID_VALUE); + pass &= piglit_check_gl_error(GL_INVALID_OPERATION); +/* Check for invalid copy between different compressed formats */ glBindTexture(GL_TEXTURE_2D, tex[3]); glTexStorage2D(GL_TEXTURE_2D, 1, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 32, 32); glCopyImageSubData(tex[0], GL_TEXTURE_2D, 0, 0, 0, 0, tex[3], GL_TEXTURE_2D, 0, 0, 0, 0, 20, 20, 1); - pass &= piglit_check_gl_error(GL_INVALID_VALUE); + pass &= piglit_check_gl_error(GL_INVALID_OPERATION); glDeleteTextures(4, tex); -- 1.9.1 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] ext_texture_integer: add new tex formats test
Test glTexImage2D() and glGetTexImage() with a variety of internalFormats and user formats/types. Note: currently fails with Mesa, passes with NVIDIA. --- tests/all.py | 1 + tests/spec/ext_texture_integer/CMakeLists.gl.txt | 1 + tests/spec/ext_texture_integer/texformats.c | 182 +++ 3 files changed, 184 insertions(+) create mode 100644 tests/spec/ext_texture_integer/texformats.c diff --git a/tests/all.py b/tests/all.py index fe088f5..9320722 100644 --- a/tests/all.py +++ b/tests/all.py @@ -3127,6 +3127,7 @@ with profile.group_manager( g(['ext_texture_integer-getteximage-clamping'], 'getteximage-clamping') g(['ext_texture_integer-getteximage-clamping', 'GL_ARB_texture_rg'], 'getteximage-clamping GL_ARB_texture_rg') +g(['ext_texture_integer-texformats']), g(['ext_texture_integer-texture_integer_glsl130'], 'texture_integer_glsl130') g(['fbo-integer'], run_concurrent=False) diff --git a/tests/spec/ext_texture_integer/CMakeLists.gl.txt b/tests/spec/ext_texture_integer/CMakeLists.gl.txt index 44d9399..2932bc2 100644 --- a/tests/spec/ext_texture_integer/CMakeLists.gl.txt +++ b/tests/spec/ext_texture_integer/CMakeLists.gl.txt @@ -12,6 +12,7 @@ link_libraries ( piglit_add_executable (ext_texture_integer-fbo-blending fbo-blending.c) piglit_add_executable (ext_texture_integer-fbo_integer_precision_clear fbo-integer-precision-clear.c) +piglit_add_executable (ext_texture_integer-texformats texformats.c) piglit_add_executable (ext_texture_integer-fbo_integer_readpixels_sint_uint fbo-integer-readpixels-sint-uint.c) piglit_add_executable (ext_texture_integer-getteximage-clamping getteximage-clamping.c) piglit_add_executable (ext_texture_integer-texture_integer_glsl130 texture-integer-glsl130.c) diff --git a/tests/spec/ext_texture_integer/texformats.c b/tests/spec/ext_texture_integer/texformats.c new file mode 100644 index 000..5a4f387 --- /dev/null +++ b/tests/spec/ext_texture_integer/texformats.c @@ -0,0 +1,182 @@ +/* + * Copyright (c) 2015 VMware, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * 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 VMWARE 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. + */ + +/** + * Test glTexImage2D and glGetTexImage with a variety of combinations of + * internal formats, and user-specified formats/types. + * + * Brian Paul + * 31 August 2015 + */ + +#include "piglit-util-gl.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + config.supports_gl_compat_version = 10; + config.window_visual = PIGLIT_GL_VISUAL_RGBA; +PIGLIT_GL_TEST_CONFIG_END + + +static bool +test_format(GLenum intFormat, GLenum format, GLenum type) +{ + const int width = 8, height = 8; + GLuint tex; + GLubyte *image, *getimage; + bool pass = true; + int i, bytes; + + switch (intFormat) { + case GL_ALPHA8I_EXT: + case GL_ALPHA8UI_EXT: + bytes = 1; + break; + case GL_ALPHA16I_EXT: + case GL_ALPHA16UI_EXT: + bytes = 2; + break; + case GL_ALPHA32I_EXT: + case GL_ALPHA32UI_EXT: + bytes = 4; + break; + case GL_RGB8I: + case GL_RGB8UI: + bytes = 3; + break; + case GL_RGBA8I: + case GL_RGBA8UI: + bytes = 4; + break; + case GL_RGB16I: + case GL_RGB16UI: + bytes = 6; + break; + case GL_RGBA16I: + case GL_RGBA16UI: + bytes = 8; + break; + case GL_RGB32I: + case GL_RGB32UI: + bytes = 12; + break; + case GL_RGBA32I: + case GL_RGBA32UI: + bytes = 16; + break; + default: + assert(!"Unexpected format"); + bytes = 0; + } + + image = malloc(width * height * bytes); + for (i = 0; i < width * height * bytes; i++) { +
Re: [Piglit] [PATCH v2 2/4] util: Add a piglit_probe_rects_equal_rgba() function
On Fri 28 Aug 2015, Nanley Chery wrote: > From: Nanley Chery > > This function compares two rectangles for equality. This is useful > to compare the rendering of individual miplevels in a miptree while > avoiding too much resource consumption. > > Signed-off-by: Nanley Chery > --- > tests/util/piglit-util-gl.c | 81 > + > tests/util/piglit-util-gl.h | 31 + > 2 files changed, 112 insertions(+) There's a small typo below. Other than that, this patch is Reviewed-by: Chad Versace > > diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c > index db17b83..82a6862 100644 > --- a/tests/util/piglit-util-gl.c > +++ b/tests/util/piglit-util-gl.c > @@ -1242,6 +1242,41 @@ piglit_probe_rect_rgb(int x, int y, int w, int h, > const float *expected) > } > > int > +piglit_probe_rects_equal(int x1, int y1, int x2, int y2, > + int w, int h, GLenum format) > +{ > + int retval; > + GLfloat *pixels; > + int ncomponents, rect_size; > + > + /* Allocate buffer large enough for two rectangles */ > + ncomponents = piglit_num_components(format); > + rect_size = w * h * ncomponents; > + pixels = malloc(2 * rect_size * sizeof(GLfloat)); > + > + /* Load the pixels into the buffer and compare */ > + /* We only need to do one glReadPixels if the images are adjacent */ > + if ((x1 + w) == x2 && y1 == y2) { > + piglit_read_pixels_float(x1, y1, 2*w, h, format, pixels); > + retval = piglit_compare_image_halves_color(2*w, h, > +ncomponents, > +piglit_tolerance, > +pixels); > + } else { > + piglit_read_pixels_float(x1, y1, w, h, format, pixels); > + piglit_read_pixels_float(x2, y2, w, h, format, > + pixels +rect_size); ^ Need a space after '+'. ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] arb_shader_texture_image_samples: add tests for all variants
Signed-off-by: Ilia Mirkin --- .../compiler/fs-image-samples.frag | 30 ++ .../compiler/fs-texture-samples.frag | 29 + .../compiler/vs-texture-samples.vert | 29 + 3 files changed, 88 insertions(+) create mode 100644 tests/spec/arb_shader_texture_image_samples/compiler/fs-image-samples.frag create mode 100644 tests/spec/arb_shader_texture_image_samples/compiler/fs-texture-samples.frag create mode 100644 tests/spec/arb_shader_texture_image_samples/compiler/vs-texture-samples.vert diff --git a/tests/spec/arb_shader_texture_image_samples/compiler/fs-image-samples.frag b/tests/spec/arb_shader_texture_image_samples/compiler/fs-image-samples.frag new file mode 100644 index 000..620183f --- /dev/null +++ b/tests/spec/arb_shader_texture_image_samples/compiler/fs-image-samples.frag @@ -0,0 +1,30 @@ +// [config] +// expect_result: pass +// glsl_version: 1.50 +// require_extensions: GL_ARB_shader_image_load_store GL_ARB_shader_texture_image_samples +// [end config] + +#version 150 +#extension GL_ARB_shader_image_load_store: require +#extension GL_ARB_shader_texture_image_samples: require + +writeonly uniform image2DMS i2D; +writeonly uniform image2DMSArray i2DArray; +writeonly uniform iimage2DMS ii2D; +writeonly uniform iimage2DMSArray ii2DArray; +writeonly uniform uimage2DMS ui2D; +writeonly uniform uimage2DMSArray ui2DArray; + +void main() +{ + int res = 0; + + res += imageSamples(i2D); + res += imageSamples(i2DArray); + res += imageSamples(ii2D); + res += imageSamples(ii2DArray); + res += imageSamples(ui2D); + res += imageSamples(ui2DArray); + + gl_FragColor = vec4(float(res) / 256.0); +} diff --git a/tests/spec/arb_shader_texture_image_samples/compiler/fs-texture-samples.frag b/tests/spec/arb_shader_texture_image_samples/compiler/fs-texture-samples.frag new file mode 100644 index 000..8ec179a --- /dev/null +++ b/tests/spec/arb_shader_texture_image_samples/compiler/fs-texture-samples.frag @@ -0,0 +1,29 @@ +// [config] +// expect_result: pass +// glsl_version: 1.50 +// require_extensions: GL_ARB_shader_texture_image_samples +// [end config] + +#version 150 +#extension GL_ARB_shader_texture_image_samples: require + +uniform sampler2DMS s2D; +uniform sampler2DMSArray s2DArray; +uniform isampler2DMS is2D; +uniform isampler2DMSArray is2DArray; +uniform usampler2DMS us2D; +uniform usampler2DMSArray us2DArray; + +void main() +{ + int res = 0; + + res += textureSamples(s2D); + res += textureSamples(s2DArray); + res += textureSamples(is2D); + res += textureSamples(is2DArray); + res += textureSamples(us2D); + res += textureSamples(us2DArray); + + gl_FragColor = vec4(float(res) / 256.0); +} diff --git a/tests/spec/arb_shader_texture_image_samples/compiler/vs-texture-samples.vert b/tests/spec/arb_shader_texture_image_samples/compiler/vs-texture-samples.vert new file mode 100644 index 000..fb2e746 --- /dev/null +++ b/tests/spec/arb_shader_texture_image_samples/compiler/vs-texture-samples.vert @@ -0,0 +1,29 @@ +// [config] +// expect_result: pass +// glsl_version: 1.50 +// require_extensions: GL_ARB_shader_texture_image_samples +// [end config] + +#version 150 +#extension GL_ARB_shader_texture_image_samples: require + +uniform sampler2DMS s2D; +uniform sampler2DMSArray s2DArray; +uniform isampler2DMS is2D; +uniform isampler2DMSArray is2DArray; +uniform usampler2DMS us2D; +uniform usampler2DMSArray us2DArray; + +void main() +{ + int res = 0; + + res += textureSamples(s2D); + res += textureSamples(s2DArray); + res += textureSamples(is2D); + res += textureSamples(is2DArray); + res += textureSamples(us2D); + res += textureSamples(us2DArray); + + gl_Position = vec4(float(res) / 256.0); +} -- 2.4.6 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] Add an array test for KHR_texture_compression_astc_ldr
From: Nanley Chery These tests check that 2D texture arrays work for the 5x5 and 12x12 block sizes. Signed-off-by: Nanley Chery --- .../khr_texture_compression_astc/CMakeLists.gl.txt | 1 + .../compressed/hdr/array/waffles-12x12.ktx | Bin 0 -> 5888 bytes .../compressed/hdr/array/waffles-5x5.ktx | Bin 0 -> 30400 bytes .../compressed/ldrl/array/waffles-12x12.ktx| Bin 0 -> 11680 bytes .../compressed/ldrl/array/waffles-5x5.ktx | Bin 0 -> 30400 bytes .../compressed/ldrs/array/waffles-12x12.ktx| Bin 0 -> 11680 bytes .../compressed/ldrs/array/waffles-5x5.ktx | Bin 0 -> 30400 bytes .../khr_compressed_astc-miptree-array.c| 294 + 8 files changed, 295 insertions(+) create mode 100644 tests/spec/khr_texture_compression_astc/compressed/hdr/array/waffles-12x12.ktx create mode 100644 tests/spec/khr_texture_compression_astc/compressed/hdr/array/waffles-5x5.ktx create mode 100644 tests/spec/khr_texture_compression_astc/compressed/ldrl/array/waffles-12x12.ktx create mode 100644 tests/spec/khr_texture_compression_astc/compressed/ldrl/array/waffles-5x5.ktx create mode 100644 tests/spec/khr_texture_compression_astc/compressed/ldrs/array/waffles-12x12.ktx create mode 100644 tests/spec/khr_texture_compression_astc/compressed/ldrs/array/waffles-5x5.ktx create mode 100644 tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree-array.c diff --git a/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt b/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt index 79500f7..5b1c4c7 100644 --- a/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt +++ b/tests/spec/khr_texture_compression_astc/CMakeLists.gl.txt @@ -10,6 +10,7 @@ link_libraries ( ) piglit_add_executable(khr_compressed_astc-miptree_${piglit_target_api} khr_compressed_astc-miptree.c) +piglit_add_executable(khr_compressed_astc-array_${piglit_target_api} khr_compressed_astc-miptree-array.c) piglit_add_executable(khr_compressed_astc-basic_${piglit_target_api} khr_compressed_astc-basic.c) # vim: ft=cmake: diff --git a/tests/spec/khr_texture_compression_astc/compressed/hdr/array/waffles-12x12.ktx b/tests/spec/khr_texture_compression_astc/compressed/hdr/array/waffles-12x12.ktx new file mode 100644 index 000..88303a5 Binary files /dev/null and b/tests/spec/khr_texture_compression_astc/compressed/hdr/array/waffles-12x12.ktx differ diff --git a/tests/spec/khr_texture_compression_astc/compressed/hdr/array/waffles-5x5.ktx b/tests/spec/khr_texture_compression_astc/compressed/hdr/array/waffles-5x5.ktx new file mode 100644 index 000..c7b1cba Binary files /dev/null and b/tests/spec/khr_texture_compression_astc/compressed/hdr/array/waffles-5x5.ktx differ diff --git a/tests/spec/khr_texture_compression_astc/compressed/ldrl/array/waffles-12x12.ktx b/tests/spec/khr_texture_compression_astc/compressed/ldrl/array/waffles-12x12.ktx new file mode 100644 index 000..b9ef01f Binary files /dev/null and b/tests/spec/khr_texture_compression_astc/compressed/ldrl/array/waffles-12x12.ktx differ diff --git a/tests/spec/khr_texture_compression_astc/compressed/ldrl/array/waffles-5x5.ktx b/tests/spec/khr_texture_compression_astc/compressed/ldrl/array/waffles-5x5.ktx new file mode 100644 index 000..2cb8df8 Binary files /dev/null and b/tests/spec/khr_texture_compression_astc/compressed/ldrl/array/waffles-5x5.ktx differ diff --git a/tests/spec/khr_texture_compression_astc/compressed/ldrs/array/waffles-12x12.ktx b/tests/spec/khr_texture_compression_astc/compressed/ldrs/array/waffles-12x12.ktx new file mode 100644 index 000..c0d7dda Binary files /dev/null and b/tests/spec/khr_texture_compression_astc/compressed/ldrs/array/waffles-12x12.ktx differ diff --git a/tests/spec/khr_texture_compression_astc/compressed/ldrs/array/waffles-5x5.ktx b/tests/spec/khr_texture_compression_astc/compressed/ldrs/array/waffles-5x5.ktx new file mode 100644 index 000..7cdc7a1 Binary files /dev/null and b/tests/spec/khr_texture_compression_astc/compressed/ldrs/array/waffles-5x5.ktx differ diff --git a/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree-array.c b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree-array.c new file mode 100644 index 000..c1f8fa2 --- /dev/null +++ b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree-array.c @@ -0,0 +1,294 @@ +/* + * 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 an