From c9a2ff0a2266d658f50a28e129c35cf9377c42f3 Mon Sep 17 00:00:00 2001 From: Graeme Leese Date: Mon, 3 Jun 2019 10:55:34 +0100 Subject: [PATCH] Fix texture limits in negative API tests The tests were using MAX_TEXTURE_SIZE where MAX_ARRAY_TEXTURE_LAYERS was intended. Components: OpenGL VK-GL-CTS issue: 1804 Affects: dEQP-GLES3.functional.negative_api.texture.*max_width_height_depth dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.*max_width_height_depth Change-Id: I8ba0bf7171b5b3e8a5d82211e926aa9dd2fff1bd --- modules/gles3/functional/es3fNegativeTextureApiTests.cpp | 10 ++++++---- modules/gles31/functional/es31fNegativeTextureApiTests.cpp | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/modules/gles3/functional/es3fNegativeTextureApiTests.cpp b/modules/gles3/functional/es3fNegativeTextureApiTests.cpp index e14fd9d..cf8a437 100644 --- a/modules/gles3/functional/es3fNegativeTextureApiTests.cpp +++ b/modules/gles3/functional/es3fNegativeTextureApiTests.cpp @@ -2133,6 +2133,7 @@ void NegativeTextureApiTests::init (void) { int max3DTextureSize = m_context.getContextInfo().getInt(GL_MAX_3D_TEXTURE_SIZE) + 1; int maxTextureSize = m_context.getContextInfo().getInt(GL_MAX_TEXTURE_SIZE) + 1; + int maxTextureLayers = m_context.getContextInfo().getInt(GL_MAX_ARRAY_TEXTURE_LAYERS) + 1; m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if width, height or depth is greater than GL_MAX_3D_TEXTURE_SIZE."); glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA, max3DTextureSize, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); @@ -2150,9 +2151,9 @@ void NegativeTextureApiTests::init (void) expectError(GL_INVALID_VALUE); glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, 1, maxTextureSize, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); expectError(GL_INVALID_VALUE); - glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, 1, 1, maxTextureSize, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); + glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, 1, 1, maxTextureLayers, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); expectError(GL_INVALID_VALUE); - glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, maxTextureSize, maxTextureSize, maxTextureSize, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); + glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, maxTextureSize, maxTextureSize, maxTextureLayers, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); expectError(GL_INVALID_VALUE); m_log << TestLog::EndSection; }); @@ -2605,15 +2606,16 @@ void NegativeTextureApiTests::init (void) ES3F_ADD_API_CASE(compressedteximage3d_max_width_height_depth, "Invalid glCompressedTexImage3D() usage", { int maxTextureSize = m_context.getContextInfo().getInt(GL_MAX_TEXTURE_SIZE) + 1; + int maxTextureLayers = m_context.getContextInfo().getInt(GL_MAX_ARRAY_TEXTURE_LAYERS) + 1; m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if width, height or depth is greater than GL_MAX_TEXTURE_SIZE."); glCompressedTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_COMPRESSED_RGBA8_ETC2_EAC, maxTextureSize, 0, 0, 0, 0, 0); expectError(GL_INVALID_VALUE); glCompressedTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_COMPRESSED_RGBA8_ETC2_EAC, 0, maxTextureSize, 0, 0, 0, 0); expectError(GL_INVALID_VALUE); - glCompressedTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_COMPRESSED_RGBA8_ETC2_EAC, 0, 0, maxTextureSize, 0, 0, 0); + glCompressedTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_COMPRESSED_RGBA8_ETC2_EAC, 0, 0, maxTextureLayers, 0, 0, 0); expectError(GL_INVALID_VALUE); - glCompressedTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_COMPRESSED_RGBA8_ETC2_EAC, maxTextureSize, maxTextureSize, maxTextureSize, 0, 0, 0); + glCompressedTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_COMPRESSED_RGBA8_ETC2_EAC, maxTextureSize, maxTextureSize, maxTextureLayers, 0, 0, 0); expectError(GL_INVALID_VALUE); m_log << TestLog::EndSection; }); diff --git a/modules/gles31/functional/es31fNegativeTextureApiTests.cpp b/modules/gles31/functional/es31fNegativeTextureApiTests.cpp index 6a9d8ea..c2f9d47 100644 --- a/modules/gles31/functional/es31fNegativeTextureApiTests.cpp +++ b/modules/gles31/functional/es31fNegativeTextureApiTests.cpp @@ -2780,6 +2780,7 @@ void teximage3d_max_width_height_depth (NegativeTestContext& ctx) { int max3DTextureSize = ctx.getInteger(GL_MAX_3D_TEXTURE_SIZE) + 1; int maxTextureSize = ctx.getInteger(GL_MAX_TEXTURE_SIZE) + 1; + int maxTextureLayers = ctx.getInteger(GL_MAX_ARRAY_TEXTURE_LAYERS) + 1; ctx.beginSection("GL_INVALID_VALUE is generated if width, height or depth is greater than GL_MAX_3D_TEXTURE_SIZE."); ctx.glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA, max3DTextureSize, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); @@ -2797,9 +2798,9 @@ void teximage3d_max_width_height_depth (NegativeTestContext& ctx) ctx.expectError(GL_INVALID_VALUE); ctx.glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, 1, maxTextureSize, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); ctx.expectError(GL_INVALID_VALUE); - ctx.glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, 1, 1, maxTextureSize, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); + ctx.glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, 1, 1, maxTextureLayers, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); ctx.expectError(GL_INVALID_VALUE); - ctx.glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, maxTextureSize, maxTextureSize, maxTextureSize, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); + ctx.glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, maxTextureSize, maxTextureSize, maxTextureLayers, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); ctx.expectError(GL_INVALID_VALUE); ctx.endSection(); } @@ -3342,15 +3343,16 @@ void compressedteximage3d_neg_width_height_depth (NegativeTestContext& ctx) void compressedteximage3d_max_width_height_depth (NegativeTestContext& ctx) { int maxTextureSize = ctx.getInteger(GL_MAX_TEXTURE_SIZE) + 1; + int maxTextureLayers = ctx.getInteger(GL_MAX_ARRAY_TEXTURE_LAYERS) + 1; ctx.beginSection("GL_INVALID_VALUE is generated if width, height or depth is greater than GL_MAX_TEXTURE_SIZE."); ctx.glCompressedTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_COMPRESSED_RGBA8_ETC2_EAC, maxTextureSize, 0, 0, 0, 0, 0); ctx.expectError(GL_INVALID_VALUE); ctx.glCompressedTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_COMPRESSED_RGBA8_ETC2_EAC, 0, maxTextureSize, 0, 0, 0, 0); ctx.expectError(GL_INVALID_VALUE); - ctx.glCompressedTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_COMPRESSED_RGBA8_ETC2_EAC, 0, 0, maxTextureSize, 0, 0, 0); + ctx.glCompressedTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_COMPRESSED_RGBA8_ETC2_EAC, 0, 0, maxTextureLayers, 0, 0, 0); ctx.expectError(GL_INVALID_VALUE); - ctx.glCompressedTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_COMPRESSED_RGBA8_ETC2_EAC, maxTextureSize, maxTextureSize, maxTextureSize, 0, 0, 0); + ctx.glCompressedTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_COMPRESSED_RGBA8_ETC2_EAC, maxTextureSize, maxTextureSize, maxTextureLayers, 0, 0, 0); ctx.expectError(GL_INVALID_VALUE); ctx.endSection(); } -- 2.7.4