From bddcc8ad0a2db45f6cbc073d1a2bcd07deb01475 Mon Sep 17 00:00:00 2001 From: Anuj Phogat Date: Thu, 19 Dec 2013 16:08:45 -0800 Subject: [PATCH] Reproduce OUT_OF_MEMORY error Signed-off-by: Anuj Phogat --- tests/texturing/max-texture-size.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tests/texturing/max-texture-size.c b/tests/texturing/max-texture-size.c index 7b6b3fc..e601927 100644 --- a/tests/texturing/max-texture-size.c +++ b/tests/texturing/max-texture-size.c @@ -53,17 +53,18 @@ PIGLIT_GL_TEST_CONFIG_BEGIN PIGLIT_GL_TEST_CONFIG_END static const GLenum target[] = { - GL_TEXTURE_1D, +// GL_TEXTURE_1D, GL_TEXTURE_2D, - GL_TEXTURE_RECTANGLE, - GL_TEXTURE_CUBE_MAP, - GL_TEXTURE_3D, +// GL_TEXTURE_RECTANGLE, +// GL_TEXTURE_CUBE_MAP, +// GL_TEXTURE_3D, }; static const GLenum internalformat[] = { - GL_RGBA8, - GL_RGBA16, - GL_RGBA32F, + GL_DEPTH_COMPONENT24, +// GL_RGBA8, +// GL_RGBA16, +// GL_RGBA32F, }; static GLenum @@ -246,7 +247,7 @@ ValidateTexSize (GLenum target, GLenum internalformat, bool useProxy) case GL_TEXTURE_2D: if (!useProxy) { glTexImage2D(target, 0, internalformat, maxSide, - maxSide, 0, GL_RGBA, GL_FLOAT, NULL); + maxSide, 0, GL_DEPTH_COMPONENT, GL_FLOAT, pixels); err = glGetError(); first_oom = err == GL_OUT_OF_MEMORY; @@ -258,7 +259,7 @@ ValidateTexSize (GLenum target, GLenum internalformat, bool useProxy) } glTexSubImage2D(target, 0, 0, 0, maxSide/2, maxSide/2, - GL_RGBA, GL_FLOAT, pixels); + GL_DEPTH_COMPONENT, GL_FLOAT, pixels); err = glGetError(); /* Report a GL error other than GL_OUT_OF_MEMORY and @@ -413,7 +414,7 @@ piglit_init(int argc, char **argv) GLboolean pass = true; int i, j, useProxy; - for (useProxy = 1; useProxy >= 0; useProxy--) { + for (useProxy = 0; useProxy < 1; useProxy++) { for (i = 0; i < ARRAY_SIZE(target); i++) { if (!useProxy) { @@ -421,7 +422,8 @@ piglit_init(int argc, char **argv) glBindTexture(target[i], tex); glTexParameteri(target[i], GL_TEXTURE_MIN_FILTER, - GL_NEAREST); +// GL_NEAREST); + GL_NEAREST_MIPMAP_LINEAR); glTexParameteri(target[i], GL_TEXTURE_MAG_FILTER, GL_NEAREST); -- 1.8.3.1