[Piglit] [PATCH 1/1] Tests for compressed cubemaps
The compressed-cubemap.c tests the rendering of compressed cubemaps. The compressed-cubemap-teximage.c tests that compressed cubemaps created using dumped compressed 2D faces have the same values with compressed cubemaps that have been generated using TexImage. v2: added the file to opengl.py (Dylan Baker) added the cubemap-compressed-data.h (Iago Toral) --- tests/opengl.py |2 + tests/texturing/CMakeLists.gl.txt |2 + tests/texturing/compressed-cubemap-teximage.c | 372 ++ tests/texturing/compressed-cubemap.c | 477 +++ tests/texturing/cubemap-compressed-data.h | 1140 + 5 files changed, 1993 insertions(+) create mode 100644 tests/texturing/compressed-cubemap-teximage.c create mode 100644 tests/texturing/compressed-cubemap.c create mode 100644 tests/texturing/cubemap-compressed-data.h diff --git a/tests/opengl.py b/tests/opengl.py index 2771cb2eb..0c5c22588 100644 --- a/tests/opengl.py +++ b/tests/opengl.py @@ -3130,6 +3130,8 @@ with profile.test_list.group_manager( PiglitGLTest, grouptools.join('spec', 'arb_texture_cube_map')) as g: g(['arb_texture_cube_map-unusual-order'], run_concurrent=False) +g(['compressed-cubemap']) +g(['compressed-cubemap-teximage']) g(['cubemap'], run_concurrent=False) g(['cubemap-getteximage-pbo']) g(['cubemap-mismatch'], run_concurrent=False) diff --git a/tests/texturing/CMakeLists.gl.txt b/tests/texturing/CMakeLists.gl.txt index e5d41e432..526e68452 100644 --- a/tests/texturing/CMakeLists.gl.txt +++ b/tests/texturing/CMakeLists.gl.txt @@ -15,6 +15,8 @@ piglit_add_executable (array-texture array-texture.c) piglit_add_executable (bptc-modes bptc-modes.c) piglit_add_executable (bptc-float-modes bptc-float-modes.c) piglit_add_executable (compressedteximage compressedteximage.c) +piglit_add_executable (compressed-cubemap compressed-cubemap.c) +piglit_add_executable (compressed-cubemap-teximage compressed-cubemap-teximage.c) piglit_add_executable (copytexsubimage copytexsubimage.c) piglit_add_executable (copyteximage copyteximage.c) piglit_add_executable (copyteximage-border copyteximage-border.c) diff --git a/tests/texturing/compressed-cubemap-teximage.c b/tests/texturing/compressed-cubemap-teximage.c new file mode 100644 index 0..6727bea2d --- /dev/null +++ b/tests/texturing/compressed-cubemap-teximage.c @@ -0,0 +1,372 @@ +/* + * Copyright © 2018 Igalia SL + * + * 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. + * + * Authors: Eleni Maria Stea + * + */ + +/** @file compressed-cubemap-teximage.c + * Tests that creating cubemaps with TexImage2D gives the same results + * with creating compressed cubemaps from dumped compressed data. + */ + +#include "cubemap-compressed-data.h" +#include "piglit-util-gl.h" + +#define CUBESZ 8 + +static int win_width = 800; +static int win_height = 600; + +static const char *vsdr_src = + "attribute vec4 vertex;\n" + "attribute vec3 texcoord;\n" + "uniform vec2 rot;\n" + "varying vec3 tc;\n" + "void main()\n" + "{\n" + "gl_Position = vertex;\n" + "tc.x = vertex.x * cos(rot.y) + sin(rot.y);\n" + "tc.y = vertex.x * sin(rot.x) * sin(rot.y) + vertex.y * cos(rot.x) - sin(rot.x) * cos(rot.y);\n" + "tc.z = vertex.x * cos(rot.x) * sin(rot.y) - vertex.y * sin(rot.x) - cos(rot.x) * cos(rot.y);\n" + "}\n"; + +static const char *fsdr_src = + "uniform samplerCube tex;\n" + "varying vec3 tc;\n" + "void main()\n" + "{\n" + "vec4 texel = textureCube(tex, tc);\n" + "gl_FragColor = vec4(texel.xyz, 1.0);\n" "}\n"; + +static int piglit_error; +static unsigned int vbo, vao; +static unsigned int sdrprog; +static int uloc_rot; +static const float tolerance[4] = { 0.1, 0.1, 0.1, 0.1 }; + +struct +{ + unsigned int fmt; +
Re: [Piglit] [PATCH 1/1] Tests for compressed cubemaps
Quoting Eleni Maria Stea (2019-01-08 05:23:07) > The compressed-cubemap.c tests the rendering of compressed cubemaps. > The compressed-cubemap-teximage.c tests that compressed cubemaps created > using dumped compressed 2D faces have the same values with compressed > cubemaps that have been generated using TexImage. > --- > tests/texturing/CMakeLists.gl.txt | 2 + > tests/texturing/compressed-cubemap-teximage.c | 372 ++ > tests/texturing/compressed-cubemap.c | 477 ++ > 3 files changed, 851 insertions(+) > create mode 100644 tests/texturing/compressed-cubemap-teximage.c > create mode 100644 tests/texturing/compressed-cubemap.c > > diff --git a/tests/texturing/CMakeLists.gl.txt > b/tests/texturing/CMakeLists.gl.txt > index e5d41e432..526e68452 100644 > --- a/tests/texturing/CMakeLists.gl.txt > +++ b/tests/texturing/CMakeLists.gl.txt > @@ -15,6 +15,8 @@ piglit_add_executable (array-texture array-texture.c) > piglit_add_executable (bptc-modes bptc-modes.c) > piglit_add_executable (bptc-float-modes bptc-float-modes.c) > piglit_add_executable (compressedteximage compressedteximage.c) > +piglit_add_executable (compressed-cubemap compressed-cubemap.c) > +piglit_add_executable (compressed-cubemap-teximage > compressed-cubemap-teximage.c) > piglit_add_executable (copytexsubimage copytexsubimage.c) > piglit_add_executable (copyteximage copyteximage.c) > piglit_add_executable (copyteximage-border copyteximage-border.c) > diff --git a/tests/texturing/compressed-cubemap-teximage.c > b/tests/texturing/compressed-cubemap-teximage.c > new file mode 100644 > index 0..6727bea2d > --- /dev/null > +++ b/tests/texturing/compressed-cubemap-teximage.c > @@ -0,0 +1,372 @@ > +/* > + * Copyright © 2018 Igalia SL > + * > + * 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. > + * > + * Authors: Eleni Maria Stea > + * > + */ > + > +/** @file compressed-cubemap-teximage.c > + * Tests that creating cubemaps with TexImage2D gives the same results > + * with creating compressed cubemaps from dumped compressed data. > + */ > + > +#include "cubemap-compressed-data.h" > +#include "piglit-util-gl.h" > + > +#define CUBESZ 8 > + > +static int win_width = 800; > +static int win_height = 600; > + > +static const char *vsdr_src = > + "attribute vec4 vertex;\n" > + "attribute vec3 texcoord;\n" > + "uniform vec2 rot;\n" > + "varying vec3 tc;\n" > + "void main()\n" > + "{\n" > + "gl_Position = vertex;\n" > + "tc.x = vertex.x * cos(rot.y) + sin(rot.y);\n" > + "tc.y = vertex.x * sin(rot.x) * sin(rot.y) + vertex.y * > cos(rot.x) - sin(rot.x) * cos(rot.y);\n" > + "tc.z = vertex.x * cos(rot.x) * sin(rot.y) - vertex.y * > sin(rot.x) - cos(rot.x) * cos(rot.y);\n" > + "}\n"; > + > +static const char *fsdr_src = > + "uniform samplerCube tex;\n" > + "varying vec3 tc;\n" > + "void main()\n" > + "{\n" > + "vec4 texel = textureCube(tex, tc);\n" > + "gl_FragColor = vec4(texel.xyz, 1.0);\n" "}\n"; > + > +static int piglit_error; > +static unsigned int vbo, vao; > +static unsigned int sdrprog; > +static int uloc_rot; > +static const float tolerance[4] = { 0.1, 0.1, 0.1, 0.1 }; > + > +struct > +{ > + unsigned int fmt; > + const char *name; > + unsigned int tex; > + unsigned int ctex; > + unsigned int num_channels; > + unsigned char *data; > + unsigned int data_size; > +} formats[] = { > + {0x08e8c, "GL_COMPRESSED_RGBA_BPTC_UNORM", 0, 0, 4, bptc_rgba_unorm, > + sizeof bptc_rgba_unorm}, > + {0x08e8d, "GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM", 0, 0, 3, > + bptc_srgba_unorm, sizeof bptc_srgba_unorm}, > + {0x08e8e, "GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT", 0, 0, 3, > + bptc_rgb_signed_float,
Re: [Piglit] [PATCH 1/1] Tests for compressed cubemaps
On Tue, 2019-01-08 at 15:23 +0200, Eleni Maria Stea wrote: > The compressed-cubemap.c tests the rendering of compressed cubemaps. > The compressed-cubemap-teximage.c tests that compressed cubemaps > created > using dumped compressed 2D faces have the same values with compressed > cubemaps that have been generated using TexImage. > --- > tests/texturing/CMakeLists.gl.txt | 2 + > tests/texturing/compressed-cubemap-teximage.c | 372 ++ > tests/texturing/compressed-cubemap.c | 477 > ++ > 3 files changed, 851 insertions(+) > create mode 100644 tests/texturing/compressed-cubemap-teximage.c > create mode 100644 tests/texturing/compressed-cubemap.c > > diff --git a/tests/texturing/CMakeLists.gl.txt > b/tests/texturing/CMakeLists.gl.txt > index e5d41e432..526e68452 100644 > --- a/tests/texturing/CMakeLists.gl.txt > +++ b/tests/texturing/CMakeLists.gl.txt > @@ -15,6 +15,8 @@ piglit_add_executable (array-texture array- > texture.c) > piglit_add_executable (bptc-modes bptc-modes.c) > piglit_add_executable (bptc-float-modes bptc-float-modes.c) > piglit_add_executable (compressedteximage compressedteximage.c) > +piglit_add_executable (compressed-cubemap compressed-cubemap.c) > +piglit_add_executable (compressed-cubemap-teximage compressed- > cubemap-teximage.c) > piglit_add_executable (copytexsubimage copytexsubimage.c) > piglit_add_executable (copyteximage copyteximage.c) > piglit_add_executable (copyteximage-border copyteximage-border.c) > diff --git a/tests/texturing/compressed-cubemap-teximage.c > b/tests/texturing/compressed-cubemap-teximage.c > new file mode 100644 > index 0..6727bea2d > --- /dev/null > +++ b/tests/texturing/compressed-cubemap-teximage.c > @@ -0,0 +1,372 @@ > +/* > + * Copyright © 2018 Igalia SL > + * > + * 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. > + * > + * Authors: Eleni Maria Stea > + * > + */ > + > +/** @file compressed-cubemap-teximage.c > + * Tests that creating cubemaps with TexImage2D gives the same > results > + * with creating compressed cubemaps from dumped compressed data. > + */ > + > +#include "cubemap-compressed-data.h" I think you forgot to include this file in the patch. Iago ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 1/1] Tests for compressed cubemaps
The compressed-cubemap.c tests the rendering of compressed cubemaps. The compressed-cubemap-teximage.c tests that compressed cubemaps created using dumped compressed 2D faces have the same values with compressed cubemaps that have been generated using TexImage. --- tests/texturing/CMakeLists.gl.txt | 2 + tests/texturing/compressed-cubemap-teximage.c | 372 ++ tests/texturing/compressed-cubemap.c | 477 ++ 3 files changed, 851 insertions(+) create mode 100644 tests/texturing/compressed-cubemap-teximage.c create mode 100644 tests/texturing/compressed-cubemap.c diff --git a/tests/texturing/CMakeLists.gl.txt b/tests/texturing/CMakeLists.gl.txt index e5d41e432..526e68452 100644 --- a/tests/texturing/CMakeLists.gl.txt +++ b/tests/texturing/CMakeLists.gl.txt @@ -15,6 +15,8 @@ piglit_add_executable (array-texture array-texture.c) piglit_add_executable (bptc-modes bptc-modes.c) piglit_add_executable (bptc-float-modes bptc-float-modes.c) piglit_add_executable (compressedteximage compressedteximage.c) +piglit_add_executable (compressed-cubemap compressed-cubemap.c) +piglit_add_executable (compressed-cubemap-teximage compressed-cubemap-teximage.c) piglit_add_executable (copytexsubimage copytexsubimage.c) piglit_add_executable (copyteximage copyteximage.c) piglit_add_executable (copyteximage-border copyteximage-border.c) diff --git a/tests/texturing/compressed-cubemap-teximage.c b/tests/texturing/compressed-cubemap-teximage.c new file mode 100644 index 0..6727bea2d --- /dev/null +++ b/tests/texturing/compressed-cubemap-teximage.c @@ -0,0 +1,372 @@ +/* + * Copyright © 2018 Igalia SL + * + * 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. + * + * Authors: Eleni Maria Stea + * + */ + +/** @file compressed-cubemap-teximage.c + * Tests that creating cubemaps with TexImage2D gives the same results + * with creating compressed cubemaps from dumped compressed data. + */ + +#include "cubemap-compressed-data.h" +#include "piglit-util-gl.h" + +#define CUBESZ 8 + +static int win_width = 800; +static int win_height = 600; + +static const char *vsdr_src = + "attribute vec4 vertex;\n" + "attribute vec3 texcoord;\n" + "uniform vec2 rot;\n" + "varying vec3 tc;\n" + "void main()\n" + "{\n" + "gl_Position = vertex;\n" + "tc.x = vertex.x * cos(rot.y) + sin(rot.y);\n" + "tc.y = vertex.x * sin(rot.x) * sin(rot.y) + vertex.y * cos(rot.x) - sin(rot.x) * cos(rot.y);\n" + "tc.z = vertex.x * cos(rot.x) * sin(rot.y) - vertex.y * sin(rot.x) - cos(rot.x) * cos(rot.y);\n" + "}\n"; + +static const char *fsdr_src = + "uniform samplerCube tex;\n" + "varying vec3 tc;\n" + "void main()\n" + "{\n" + "vec4 texel = textureCube(tex, tc);\n" + "gl_FragColor = vec4(texel.xyz, 1.0);\n" "}\n"; + +static int piglit_error; +static unsigned int vbo, vao; +static unsigned int sdrprog; +static int uloc_rot; +static const float tolerance[4] = { 0.1, 0.1, 0.1, 0.1 }; + +struct +{ + unsigned int fmt; + const char *name; + unsigned int tex; + unsigned int ctex; + unsigned int num_channels; + unsigned char *data; + unsigned int data_size; +} formats[] = { + {0x08e8c, "GL_COMPRESSED_RGBA_BPTC_UNORM", 0, 0, 4, bptc_rgba_unorm, + sizeof bptc_rgba_unorm}, + {0x08e8d, "GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM", 0, 0, 3, + bptc_srgba_unorm, sizeof bptc_srgba_unorm}, + {0x08e8e, "GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT", 0, 0, 3, + bptc_rgb_signed_float, sizeof bptc_rgb_signed_float}, + {0x08e8f, "GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT", 0, 0, 3, + bptc_rgb_unsigned_float,sizeof bptc_rgb_unsigned_float}, + {0x083f1, "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT", 0, 0, 4, + dxt1_rgba, sizeof dxt1_rgba}, +