[Piglit] [PATCH] Add test case to verify large textures are handled correctly in mesa
brianp at vmware.com
Sun Mar 18 09:51:30 PDT 2012
On 03/17/2012 11:38 PM, Anuj Phogat wrote:
> This test tries to create the maximum supported texture using
> gltexImage1D/2D/3D functions and later modifies it using
> glTexSubImage1D/2D/3D functions.
> At the moment Intel driver throws GL_OUT_OF_MEMORY and an assertion
> failure / a SIGBUS with large textures.
> Test reproduces the errors reported in:
> V2: Added the test using proxy textures, deleted redundant code,
> data array allocation based on size returned
> V3: Continue testing with other formats if ARB_texture_float is not present.
> Moved the test case to tests/texturing with an appropriate name.
> Removed the loop which was testing with a number of large textures.
> Added GL_OUT_OF_MEMORY as an expected error.
> Added GL_TEXTURE_RECTANGLE in texture target array.
> V4: Removed redundant code.
> Signed-off-by: Anuj Phogat<anuj.phogat at gmail.com>
> tests/texturing/CMakeLists.gl.txt | 1 +
> tests/texturing/max-texture-size.c | 443 ++++++++++++++++++++++++++++++++++++
> 2 files changed, 444 insertions(+), 0 deletions(-)
> create mode 100644 tests/texturing/max-texture-size.c
> diff --git a/tests/texturing/CMakeLists.gl.txt b/tests/texturing/CMakeLists.gl.txt
> index 519a4dd..e675235 100644
> --- a/tests/texturing/CMakeLists.gl.txt
> +++ b/tests/texturing/CMakeLists.gl.txt
> @@ -37,6 +37,7 @@ add_executable (lodbias lodbias.c)
> add_executable (lodclamp lodclamp.c)
> add_executable (lodclamp-between lodclamp-between.c)
> add_executable (lodclamp-between-max lodclamp-between-max.c)
> +add_executable (max-texture-size max-texture-size.c)
> add_executable (mipmap-setup mipmap-setup.c)
> add_executable (rg-draw-pixels rg-draw-pixels.c)
> add_executable (rg-teximage-01 rg-teximage-01.c rg-teximage-common.c)
> diff --git a/tests/texturing/max-texture-size.c b/tests/texturing/max-texture-size.c
> new file mode 100644
> index 0000000..c55cf89
> --- /dev/null
> +++ b/tests/texturing/max-texture-size.c
> @@ -0,0 +1,443 @@
> +/* Copyright © 2012 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 max-texture-size.c
> + * Verify that large textures are handled properly in mesa driver.
> + *
> + * This test works by calling glTexImage1D/2D/3D and glTexSubImage1D/2D/3D
> + * functions with different texture targets. Each texture target is tested
> + * with maximum supported texture size.
> + * All the calls to glTexImage2D() and glTexSubImage2D() should ensure no
> + * segmentation fault / assertion failure in mesa driver.
> + *
> + * This test case reproduces the errors reported in:
> + * 1. https://bugs.freedesktop.org/show_bug.cgi?id=44970
> + * Use GL_TEXTURE_2D and GL_RGBA16
> + *
> + * 2. https://bugs.freedesktop.org/show_bug.cgi?id=46303
> + *
> + * GL_OUT_OF_MEMORY is an expected GL error in this tesyt case.
Reviewed-by: Brian Paul <brianp at vmware.com>
Thanks for making all those changes.
More information about the Piglit