[Piglit] [PATCH 19/21] arb_internalformat_query2: Added tests for image textures
From: Antia Puentes Checks that: * TEXEL_SIZE * IMAGE_COMPATIBILITY_CLASS * IMAGE_PIXEL_FORMAT * IMAGE_PIXEL_TYPE return the values defined for them in Table 3.22 of the OpenGL 4.2 specification depending on the "Image Format" passed. This test does not check unsupported or expected-failure cases, hence it does not replace the "generic-pnames-check" test. We may want to change that in the future to have everything in the same place. Tested on NVIDIA GeForce GTX 950 - NVIDIA 352.55: fails: In addition to the errors already found on the generic-pnames test with this pnames, in some cases NVIDIA implementation is returning values different to the specified on Table 3.22. --- tests/all.py | 1 + .../arb_internalformat_query2/CMakeLists.gl.txt| 1 + .../spec/arb_internalformat_query2/image-texture.c | 211 + 3 files changed, 213 insertions(+) create mode 100644 tests/spec/arb_internalformat_query2/image-texture.c diff --git a/tests/all.py b/tests/all.py index 4027ad3..f9f3c84 100644 --- a/tests/all.py +++ b/tests/all.py @@ -3629,6 +3629,7 @@ with profile.group_manager( g(['arb_internalformat_query2-color-encoding'], 'COLOR_ENCODING pname check') g(['arb_internalformat_query2-texture-compressed-block'], 'All TEXTURE_COMPRESSED_BLOCK_ pname checks') g(['arb_internalformat_query2-minmax'], 'minmax check for SAMPLES/NUM_SAMPLE_COUNTS') +g(['arb_internalformat_query2-image-texture'], 'Checks for pnames related to ARB_image_load_store that return values from Table 3.22 (OpenGL 4.2)') with profile.group_manager( PiglitGLTest, grouptools.join('spec', 'arb_map_buffer_range')) as g: diff --git a/tests/spec/arb_internalformat_query2/CMakeLists.gl.txt b/tests/spec/arb_internalformat_query2/CMakeLists.gl.txt index f6119a6..b9a96f0 100644 --- a/tests/spec/arb_internalformat_query2/CMakeLists.gl.txt +++ b/tests/spec/arb_internalformat_query2/CMakeLists.gl.txt @@ -18,5 +18,6 @@ piglit_add_executable (arb_internalformat_query2-max-dimensions max-dimensions.c piglit_add_executable (arb_internalformat_query2-color-encoding color-encoding.c common.c) piglit_add_executable (arb_internalformat_query2-texture-compressed-block texture-compressed-block.c common.c) piglit_add_executable (arb_internalformat_query2-minmax minmax.c common.c) +piglit_add_executable (arb_internalformat_query2-image-texture image-texture.c common.c) # vim: ft=cmake: diff --git a/tests/spec/arb_internalformat_query2/image-texture.c b/tests/spec/arb_internalformat_query2/image-texture.c new file mode 100644 index 000..f725463 --- /dev/null +++ b/tests/spec/arb_internalformat_query2/image-texture.c @@ -0,0 +1,211 @@ +/* + * 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 image-texture.c + * + * Verify conditions defined on the spec for the pnames that have to return + * values in the Table 3.22 of the OpenGL 4.2 spec: + * + * * TEXEL_SIZE + * * IMAGE_COMPATIBILITY_CLASS + * * IMAGE_PIXEL_FORMAT + * * IMAGE_PIXEL_TYPE + * + * It only tests values present in Table 3.22, it does not check unsupported + * or failure-expected cases. + * + * As this test does not check unsupported cases, it does not replace the + * "generic-pnames-check" test. We may want to change that in the future + * to have everything in the same place. + */ + +#include "common.h" +#include /* for PRIu64 macro */ + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 10; + config.window_visual = PIGLIT_GL_VISUAL_RGB; + +PIGLIT_GL_TEST_CONFIG_END + +enum piglit_result +piglit_display(void) +{ +return PIGLIT_FAIL; +} + +static const GLenum pnames[] = { +GL_IMAGE_TEXEL_SIZE, +GL_IMAGE_COMPATIBILITY_CLASS, +GL_IMAGE_PIXEL_FORMAT, +GL_IMAGE_PIXEL_TYPE, +}; + +struct imagetexture { +
[Piglit] [PATCH 19/21] arb_internalformat_query2: Added tests for image textures
From: Antia Puentes Checks that: * TEXEL_SIZE * IMAGE_COMPATIBILITY_CLASS * IMAGE_PIXEL_FORMAT * IMAGE_PIXEL_TYPE return the values defined for them in Table 3.22 of the OpenGL 4.2 specification depending on the "Image Format" passed. This test does not check unsupported or expected-failure cases, hence it does not replace the "generic-pnames-check" test. We may want to change that in the future to have everything in the same place. Tested on NVIDIA GeForce GTX 950 - NVIDIA 352.55: fails: In addition to the errors already found on the generic-pnames test with this pnames, in some cases NVIDIA implementation is returning values different to the specified on Table 3.22. --- tests/all.py | 1 + .../arb_internalformat_query2/CMakeLists.gl.txt| 1 + .../spec/arb_internalformat_query2/image-texture.c | 209 + 3 files changed, 211 insertions(+) create mode 100644 tests/spec/arb_internalformat_query2/image-texture.c diff --git a/tests/all.py b/tests/all.py index 2c83ad6..5352535 100644 --- a/tests/all.py +++ b/tests/all.py @@ -3646,6 +3646,7 @@ with profile.group_manager( g(['arb_internalformat_query2-color-encoding'], 'COLOR_ENCODING pname check') g(['arb_internalformat_query2-texture-compressed-block'], 'All TEXTURE_COMPRESSED_BLOCK_ pname checks') g(['arb_internalformat_query2-minmax'], 'minmax check for SAMPLES/NUM_SAMPLE_COUNTS') +g(['arb_internalformat_query2-image-texture'], 'Checks for pnames related to ARB_image_load_store that return values from Table 3.22 (OpenGL 4.2)') with profile.group_manager( PiglitGLTest, grouptools.join('spec', 'arb_map_buffer_range')) as g: diff --git a/tests/spec/arb_internalformat_query2/CMakeLists.gl.txt b/tests/spec/arb_internalformat_query2/CMakeLists.gl.txt index f6119a6..b9a96f0 100644 --- a/tests/spec/arb_internalformat_query2/CMakeLists.gl.txt +++ b/tests/spec/arb_internalformat_query2/CMakeLists.gl.txt @@ -18,5 +18,6 @@ piglit_add_executable (arb_internalformat_query2-max-dimensions max-dimensions.c piglit_add_executable (arb_internalformat_query2-color-encoding color-encoding.c common.c) piglit_add_executable (arb_internalformat_query2-texture-compressed-block texture-compressed-block.c common.c) piglit_add_executable (arb_internalformat_query2-minmax minmax.c common.c) +piglit_add_executable (arb_internalformat_query2-image-texture image-texture.c common.c) # vim: ft=cmake: diff --git a/tests/spec/arb_internalformat_query2/image-texture.c b/tests/spec/arb_internalformat_query2/image-texture.c new file mode 100644 index 000..ade9567 --- /dev/null +++ b/tests/spec/arb_internalformat_query2/image-texture.c @@ -0,0 +1,209 @@ +/* + * 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 image-texture.c + * + * Verify conditions defined on the spec for the pnames that have to return + * values in the Table 3.22 of the OpenGL 4.2 spec: + * + * * TEXEL_SIZE + * * IMAGE_COMPATIBILITY_CLASS + * * IMAGE_PIXEL_FORMAT + * * IMAGE_PIXEL_TYPE + * + * It only tests values present in Table 3.22, it does not check unsupported + * or failure-expected cases. + * + * As this test does not check unsupported cases, it does not replace the + * "generic-pnames-check" test. We may want to change that in the future + * to have everything in the same place. + */ + +#include "common.h" +#include /* for PRIu64 macro */ + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 10; + config.window_visual = PIGLIT_GL_VISUAL_RGB; + +PIGLIT_GL_TEST_CONFIG_END + +enum piglit_result +piglit_display(void) +{ +return PIGLIT_FAIL; +} + +static const GLenum pnames[] = { +GL_IMAGE_TEXEL_SIZE, +GL_IMAGE_COMPATIBILITY_CLASS, +GL_IMAGE_PIXEL_FORMAT, +GL_IMAGE_PIXEL_TYPE, +}; + +struct imagetexture { +