Now it's called "drawpixels-stencil-test". 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/fdo23670-drawpix_stencil.c | 84 -------------------------- tests/spec/gl-1.0/CMakeLists.gl.txt | 1 + tests/spec/gl-1.0/drawpixels-stencil-test.c | 93 +++++++++++++++++++++++++++++ 5 files changed, 95 insertions(+), 86 deletions(-) delete mode 100644 tests/bugs/fdo23670-drawpix_stencil.c create mode 100644 tests/spec/gl-1.0/drawpixels-stencil-test.c
diff --git a/tests/all.py b/tests/all.py index f5327b5..02aa5af 100644 --- a/tests/all.py +++ b/tests/all.py @@ -720,6 +720,7 @@ with profile.test_list.group_manager( g(['gl-1.0-dlist-shademodel']) g(['gl-1.0-drawpixels-color-index']) g(['gl-1.0-drawpixels-depth-test']) + g(['gl-1.0-drawpixels-stencil-test']) g(['gl-1.0-drawbuffer-modes'], run_concurrent=False) g(['gl-1.0-edgeflag']) g(['gl-1.0-edgeflag-const']) @@ -763,7 +764,6 @@ with profile.test_list.group_manager( g(['copyteximage', '1D']) g(['copyteximage', '2D']) g(['gl-1.1-read-pixels-after-display-list']) - g(['fdo23670-drawpix_stencil']) g(['tri-tex-crash']) g(['vbo-buffer-unmap']) g(['array-stride']) diff --git a/tests/bugs/CMakeLists.gl.txt b/tests/bugs/CMakeLists.gl.txt index 265d405..cc9be92 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 (fdo23670-drawpix_stencil fdo23670-drawpix_stencil.c) piglit_add_executable (fdo24066 fdo24066.c) piglit_add_executable (fdo25614-genmipmap fdo25614-genmipmap.c) piglit_add_executable (fdo28551 fdo28551.c) diff --git a/tests/bugs/fdo23670-drawpix_stencil.c b/tests/bugs/fdo23670-drawpix_stencil.c deleted file mode 100644 index 4dcb9e0..0000000 --- a/tests/bugs/fdo23670-drawpix_stencil.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright © 2009 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. - * - * Authors: - * Shuang he <shuang...@intel.com> - */ - -#include "piglit-util-gl.h" - -PIGLIT_GL_TEST_CONFIG_BEGIN - - config.supports_gl_compat_version = 10; - - config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DEPTH | PIGLIT_GL_VISUAL_STENCIL; - config.khr_no_error_support = PIGLIT_NO_ERRORS; - -PIGLIT_GL_TEST_CONFIG_END - -void -piglit_init(int argc, char **argv) -{ - (void) argc; - (void) argv; -} - -enum piglit_result -piglit_display(void) -{ - GLubyte stencil_rect[20 * 20]; - int i; - GLboolean pass = GL_TRUE; - static float red[] = {1.0, 0.0, 0,0, 0.0}; - static float black[] = {0.0, 0.0, 0,0, 0.0}; - - piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE); - - glClearStencil(0); - glClearDepth(1.0); - glClearColor(0.0, 0.0, 0.0, 0.0); - glDisable(GL_DITHER); - glPixelStorei(GL_UNPACK_ROW_LENGTH, 20); - - for (i=0; i<20*20; i++) - if (i < 20*20/2) - stencil_rect[i] = 1; - else - stencil_rect[i] = 0; - - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - glEnable(GL_STENCIL_TEST); - glStencilFunc(GL_LESS, 0, (GLuint)~0); - glRasterPos2i(50, 50); - glDrawPixels(20, 20, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, stencil_rect); - glColor3f(1.0, 0.0, 0.0); - glRectf(50, 50, 50+20, 50+20); - glDisable(GL_STENCIL_TEST); - - pass &= piglit_probe_rect_rgb(50, 50, 20, 10, red); - pass &= piglit_probe_rect_rgb(50, 60, 20, 10, black); - - piglit_present_results(); - - return pass ? PIGLIT_PASS : PIGLIT_FAIL; -} diff --git a/tests/spec/gl-1.0/CMakeLists.gl.txt b/tests/spec/gl-1.0/CMakeLists.gl.txt index 0166657..ae52ec8 100644 --- a/tests/spec/gl-1.0/CMakeLists.gl.txt +++ b/tests/spec/gl-1.0/CMakeLists.gl.txt @@ -16,6 +16,7 @@ piglit_add_executable (gl-1.0-dlist-shademodel dlist-shademodel.c) piglit_add_executable (gl-1.0-drawbuffer-modes drawbuffer-modes.c) piglit_add_executable (gl-1.0-drawpixels-color-index drawpixels-color-index.c) piglit_add_executable (gl-1.0-drawpixels-depth-test drawpixels-depth-test.c) +piglit_add_executable (gl-1.0-drawpixels-stencil-test drawpixels-stencil-test.c) piglit_add_executable (gl-1.0-edgeflag edgeflag.c) piglit_add_executable (gl-1.0-edgeflag-const edgeflag-const.c) piglit_add_executable (gl-1.0-edgeflag-quads edgeflag-quads.c) diff --git a/tests/spec/gl-1.0/drawpixels-stencil-test.c b/tests/spec/gl-1.0/drawpixels-stencil-test.c new file mode 100644 index 0000000..6bdba17 --- /dev/null +++ b/tests/spec/gl-1.0/drawpixels-stencil-test.c @@ -0,0 +1,93 @@ +/* + * Copyright © 2009 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. + */ + +/** + * Authors: + * Shuang he <shuang...@intel.com> + * + * Use glDrawPixels with GL_STENCIL_TEST. + * + * https://bugs.freedesktop.org/show_bug.cgi?id=23670 + */ + +#include "piglit-util-gl.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_compat_version = 10; + + config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | + PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DEPTH | + PIGLIT_GL_VISUAL_STENCIL; + config.khr_no_error_support = PIGLIT_NO_ERRORS; + +PIGLIT_GL_TEST_CONFIG_END + +void +piglit_init(int argc, char **argv) +{ + (void) argc; + (void) argv; +} + +enum piglit_result +piglit_display(void) +{ + GLubyte stencil_rect[20 * 20]; + int i; + GLboolean pass = GL_TRUE; + static float red[] = {1.0, 0.0, 0,0, 0.0}; + static float black[] = {0.0, 0.0, 0,0, 0.0}; + + piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE); + + glClearStencil(0); + glClearDepth(1.0); + glClearColor(0.0, 0.0, 0.0, 0.0); + glDisable(GL_DITHER); + glPixelStorei(GL_UNPACK_ROW_LENGTH, 20); + + for (i=0; i<20*20; i++) + if (i < 20*20/2) + stencil_rect[i] = 1; + else + stencil_rect[i] = 0; + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | + GL_STENCIL_BUFFER_BIT); + glEnable(GL_STENCIL_TEST); + glStencilFunc(GL_LESS, 0, (GLuint)~0); + glRasterPos2i(50, 50); + glDrawPixels(20, 20, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, + stencil_rect); + glColor3f(1.0, 0.0, 0.0); + glRectf(50, 50, 50+20, 50+20); + glDisable(GL_STENCIL_TEST); + + pass &= piglit_probe_rect_rgb(50, 50, 20, 10, red); + pass &= piglit_probe_rect_rgb(50, 60, 20, 10, black); + + piglit_present_results(); + + return pass ? PIGLIT_PASS : PIGLIT_FAIL; +} -- 2.7.4 _______________________________________________ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit