From: Liam Middlebrook Date: Fri, 19 Jan 2018 23:04:34 +0000 (-0800) Subject: SparseTextureAlloc check for GL_NV_deep_texture3D X-Git-Tag: upstream/1.3.5~852^2~71 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7e9411eff23d4589f7db0dc717d0ac53575672da;p=platform%2Fupstream%2FVK-GL-CTS.git SparseTextureAlloc check for GL_NV_deep_texture3D When running the SparseTextureAllocationTestCase::verifyTexStorageInvalidValueErrors test we need to check if the GL_NV_deep_texture3D extension is supported. If so we can't compare the depth of the texture against the GL_MAX_3D_TEXTURE_SIZE attribute that is intended for symmetric texture limits. Instead we need to check against GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV provided the texture width and height are within the acceptable ranges for a deep texture. Components: OpenGL VK-GL-CTS issue: 959 Change-Id: I0e404d6851724b0624d0802603a12aea3af220e5 Reviewed-by: ewerness --- diff --git a/external/openglcts/modules/gl/gl4cSparseTextureTests.cpp b/external/openglcts/modules/gl/gl4cSparseTextureTests.cpp index 062b36f..d05ea09 100644 --- a/external/openglcts/modules/gl/gl4cSparseTextureTests.cpp +++ b/external/openglcts/modules/gl/gl4cSparseTextureTests.cpp @@ -1504,6 +1504,22 @@ bool SparseTextureAllocationTestCase::verifyTexStorageInvalidValueErrors(const F return false; } + // Check for GL_NV_deep_texture3D support, if so we'll need to check + // against the depth limit instead of the generic 3D texture size limit + if (m_context.getContextInfo().isExtensionSupported("GL_NV_deep_texture3D")) + { + + // Ensure that width and height are within the valid bounds for a + // deep texture + GLint maxTextureWidthHeight; + gl.getIntegerv(GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV, &maxTextureWidthHeight); + + if (width < maxTextureWidthHeight && height < maxTextureWidthHeight) + { + gl.getIntegerv(GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV, &max3DTextureSize); + } + } + Texture::Storage(gl, target, 1, format, width, height, depth + max3DTextureSize); if (!SparseTextureUtils::verifyError(mLog, "TexStorage [GL_TEXTURE_3D wrong depth]", gl.getError(), GL_INVALID_VALUE))