Moved from opengl 1.1 to opengl 1.0 profile in all.py. --- tests/all.py | 2 +- tests/bugs/CMakeLists.gl.txt | 1 - tests/bugs/tri-tex-crash.c | 123 ---------------------------------- tests/spec/gl-1.0/CMakeLists.gl.txt | 1 + tests/spec/gl-1.0/textured-triangle.c | 123 ++++++++++++++++++++++++++++++++++ 5 files changed, 125 insertions(+), 125 deletions(-) delete mode 100644 tests/bugs/tri-tex-crash.c create mode 100644 tests/spec/gl-1.0/textured-triangle.c
diff --git a/tests/all.py b/tests/all.py index 38ecaf5..73bcdac 100644 --- a/tests/all.py +++ b/tests/all.py @@ -753,6 +753,7 @@ with profile.test_list.group_manager( g(['gl-1.0-scissor-polygon']) g(['gl-1.0-scissor-stencil-clear']) g(['gl-1.0-texgen']) + g(['gl-1.0-textured-triangle']) with profile.test_list.group_manager( PiglitGLTest, @@ -764,7 +765,6 @@ with profile.test_list.group_manager( g(['copyteximage', '1D']) g(['copyteximage', '2D']) g(['gl-1.1-read-pixels-after-display-list']) - g(['tri-tex-crash']) g(['vbo-buffer-unmap']) g(['array-stride']) g(['clear-accum']) diff --git a/tests/bugs/CMakeLists.gl.txt b/tests/bugs/CMakeLists.gl.txt index 69005bd..ea735b6 100644 --- a/tests/bugs/CMakeLists.gl.txt +++ b/tests/bugs/CMakeLists.gl.txt @@ -10,7 +10,6 @@ link_libraries ( ${OPENGL_gl_LIBRARY} ) -piglit_add_executable (tri-tex-crash tri-tex-crash.c) piglit_add_executable (vbo-buffer-unmap vbo-buffer-unmap.c) # vim: ft=cmake: diff --git a/tests/bugs/tri-tex-crash.c b/tests/bugs/tri-tex-crash.c deleted file mode 100644 index 717f066..0000000 --- a/tests/bugs/tri-tex-crash.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2010 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 THE AUTHORS OR COYPRIGTH - * HOLDERS 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 - * Test drawing a textured triangle. This is to test a Mesa/Gallium - * LLVMpipe crash which only seems to happen when SSE4.1 is not used. - */ - -#include "piglit-util-gl.h" - -PIGLIT_GL_TEST_CONFIG_BEGIN - - config.supports_gl_compat_version = 10; - - config.window_width = 400; - config.window_height = 400; - config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; - config.khr_no_error_support = PIGLIT_NO_ERRORS; - -PIGLIT_GL_TEST_CONFIG_END - -static void -make_texture(void) -{ - GLubyte image[64][64][3]; - int i, j, size; - - for (i = 0; i < 64; i++) { - for (j = 0; j < 64; j++) { - image[i][j][0] = 255; - image[i][j][1] = 0; - image[i][j][2] = 0; - } - } - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - - i = 0; - size = 64; - while (size) { - glTexImage2D(GL_TEXTURE_2D, i, GL_RGB, size, size, 0, - GL_RGB, GL_UNSIGNED_BYTE, image); - - size /= 2; - i++; - } - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, - GL_NEAREST_MIPMAP_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, - GL_LINEAR); - glEnable(GL_TEXTURE_2D); -} - - -enum piglit_result -piglit_display(void) -{ - /* - * Simply draw a textured tri. The texture is solid red. - * The tri is clipped. - */ - static const GLfloat v[3][4] = { - { 10.0, 10.0, 0.0, 1.0 }, - { 10.0, 1.0, 0.0, 1.0 }, - { 1.0, 1.0, 0.0, 1.0 }, - }; - static const GLfloat t[3][2] = { - { 0, 0 }, - { 1, 0 }, - { 1, 1 } - }; - static const GLfloat red[4] = { 1, 0, 0, 1 }; - enum piglit_result result; - - make_texture(); - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glBegin(GL_TRIANGLES); - glTexCoord2fv(t[0]); glVertex4fv(v[0]); - glTexCoord2fv(t[1]); glVertex4fv(v[1]); - glTexCoord2fv(t[2]); glVertex4fv(v[2]); - glEnd(); - - if (piglit_probe_pixel_rgb(piglit_width-5, piglit_height-20, red)) - result = PIGLIT_PASS; - else - result = PIGLIT_FAIL; - - piglit_present_results(); - - return result; -} - -void -piglit_init(int argc, char **argv) -{ - piglit_frustum_projection(GL_FALSE, -1.0, 1.0, -1.0, 1.0, 5.0, 50.0); - glTranslatef(0.0, 0.0, -25.0); -} diff --git a/tests/spec/gl-1.0/CMakeLists.gl.txt b/tests/spec/gl-1.0/CMakeLists.gl.txt index ae52ec8..fcb1d1d 100644 --- a/tests/spec/gl-1.0/CMakeLists.gl.txt +++ b/tests/spec/gl-1.0/CMakeLists.gl.txt @@ -47,5 +47,6 @@ piglit_add_executable (gl-1.0-simple-readbuffer simple-readbuffer.c) piglit_add_executable (gl-1.0-spot-light spot-light.c) piglit_add_executable (gl-1.0-swapbuffers-behavior swapbuffers-behavior.c) piglit_add_executable (gl-1.0-texgen texgen.c) +piglit_add_executable (gl-1.0-textured-triangle textured-triangle.c) # vim: ft=cmake: diff --git a/tests/spec/gl-1.0/textured-triangle.c b/tests/spec/gl-1.0/textured-triangle.c new file mode 100644 index 0000000..717f066 --- /dev/null +++ b/tests/spec/gl-1.0/textured-triangle.c @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2010 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 THE AUTHORS OR COYPRIGTH + * HOLDERS 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 + * Test drawing a textured triangle. This is to test a Mesa/Gallium + * LLVMpipe crash which only seems to happen when SSE4.1 is not used. + */ + +#include "piglit-util-gl.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 10; + + config.window_width = 400; + config.window_height = 400; + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE; + config.khr_no_error_support = PIGLIT_NO_ERRORS; + +PIGLIT_GL_TEST_CONFIG_END + +static void +make_texture(void) +{ + GLubyte image[64][64][3]; + int i, j, size; + + for (i = 0; i < 64; i++) { + for (j = 0; j < 64; j++) { + image[i][j][0] = 255; + image[i][j][1] = 0; + image[i][j][2] = 0; + } + } + + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + + i = 0; + size = 64; + while (size) { + glTexImage2D(GL_TEXTURE_2D, i, GL_RGB, size, size, 0, + GL_RGB, GL_UNSIGNED_BYTE, image); + + size /= 2; + i++; + } + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, + GL_NEAREST_MIPMAP_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, + GL_LINEAR); + glEnable(GL_TEXTURE_2D); +} + + +enum piglit_result +piglit_display(void) +{ + /* + * Simply draw a textured tri. The texture is solid red. + * The tri is clipped. + */ + static const GLfloat v[3][4] = { + { 10.0, 10.0, 0.0, 1.0 }, + { 10.0, 1.0, 0.0, 1.0 }, + { 1.0, 1.0, 0.0, 1.0 }, + }; + static const GLfloat t[3][2] = { + { 0, 0 }, + { 1, 0 }, + { 1, 1 } + }; + static const GLfloat red[4] = { 1, 0, 0, 1 }; + enum piglit_result result; + + make_texture(); + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glBegin(GL_TRIANGLES); + glTexCoord2fv(t[0]); glVertex4fv(v[0]); + glTexCoord2fv(t[1]); glVertex4fv(v[1]); + glTexCoord2fv(t[2]); glVertex4fv(v[2]); + glEnd(); + + if (piglit_probe_pixel_rgb(piglit_width-5, piglit_height-20, red)) + result = PIGLIT_PASS; + else + result = PIGLIT_FAIL; + + piglit_present_results(); + + return result; +} + +void +piglit_init(int argc, char **argv) +{ + piglit_frustum_projection(GL_FALSE, -1.0, 1.0, -1.0, 1.0, 5.0, 50.0); + glTranslatef(0.0, 0.0, -25.0); +} -- 2.7.4 _______________________________________________ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit