From a381cb85144707179d483747d616f7fa61f34bf0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tapani=20P=C3=A4lli?= Date: Tue, 21 Dec 2021 08:19:46 +0200 Subject: [PATCH] Query default FBO Depth, Stencil only when format requires MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Earlier commit removed DSA usage but introduced a problem with framebuffer parameter type and size queries in some configs. Without DSA, we get errors if querying for attachment that does not exist in framebuffer. Patch introduces a check to make sure we do not query for separate depth/stencil attachment if that would not exist in format. VK-GL-CTS issue: 3092 Affects: KHR-*.internalformat.renderbuffer.* Signed-off-by: Tapani Pälli Change-Id: I65ba7f74e5abd3a5bff17cd74ca4abcdf3f0ab53 --- external/openglcts/modules/common/glcInternalformatTests.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/external/openglcts/modules/common/glcInternalformatTests.cpp b/external/openglcts/modules/common/glcInternalformatTests.cpp index e0cb2e3..0e282b5 100644 --- a/external/openglcts/modules/common/glcInternalformatTests.cpp +++ b/external/openglcts/modules/common/glcInternalformatTests.cpp @@ -1129,6 +1129,11 @@ tcu::TestNode::IterateResult RenderbufferCase::iterate(void) bool stencilRenderbufferAvailable = (m_testFormat.type == RENDERBUFFER_STENCIL) || (m_testFormat.type == RENDERBUFFER_DEPTH_STENCIL); + bool separateDepth = + (m_testFormat.type == RENDERBUFFER_DEPTH); + bool separateStencil = + (m_testFormat.type == RENDERBUFFER_STENCIL); + GLenum testFormat = getUnsizedFormatFromInternalFormat(m_testFormat.format); GLenum testType = getTypeFromInternalFormat(m_testFormat.format); const bool isSRGB = m_testFormat.format == GL_SRGB8 || m_testFormat.format == GL_SRGB8_ALPHA8; @@ -1152,13 +1157,14 @@ tcu::TestNode::IterateResult RenderbufferCase::iterate(void) GLint hasDepthBuffer = 0; GLint hasStencilBuffer = 0; - gl.getFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &hasDepthBuffer); - gl.getFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_STENCIL, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &hasStencilBuffer); + if (separateDepth) + gl.getFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &hasDepthBuffer); + if (separateStencil) + gl.getFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_STENCIL, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &hasStencilBuffer); if (hasDepthBuffer != GL_NONE) gl.getFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH, GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, &defaultFramebufferDepthBits); - if (hasStencilBuffer != GL_NONE) gl.getFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_STENCIL, GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE, &defaultFramebufferStencilBits); -- 2.7.4