From 6921588d549af2408bb621a7569d832bb4639a56 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Fri, 22 Feb 2019 01:16:41 -0800 Subject: mesa: Fix RGBBuffers for renderbuffers with sized internal formats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For texture attachments, 'f' is texImg->_BaseFormat, but for renderbuffer attachments, 'f' is att->Renderbuffer->InternalFormat. InternalFormat may be something like GL_RGB8, which causes our (f == GL_RGB) check to fail. Switch to using a proper _BaseFormat, which drops the size. Fixes dEQP-GLES31.functional.draw_buffers_indexed.random. max_required_draw_buffers.15 on iris when combined with a driver fix. Reviewed-by: Tapani Pälli Reviewed-by: Timur Kristóf --- src/mesa/main/fbobject.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 1298e09e1b0..047ef4ee395 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1014,6 +1014,7 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx, for (i = -2; i < (GLint) ctx->Const.MaxColorAttachments; i++) { struct gl_renderbuffer_attachment *att; GLenum f; + GLenum baseFormat; mesa_format attFormat; GLenum att_tex_target = GL_NONE; @@ -1068,6 +1069,7 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx, minHeight = MIN2(minHeight, texImg->Height); maxHeight = MAX2(maxHeight, texImg->Height); f = texImg->_BaseFormat; + baseFormat = f; attFormat = texImg->TexFormat; numImages++; @@ -1100,6 +1102,7 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx, minHeight = MIN2(minHeight, att->Renderbuffer->Height); maxHeight = MAX2(minHeight, att->Renderbuffer->Height); f = att->Renderbuffer->InternalFormat; + baseFormat = att->Renderbuffer->_BaseFormat; attFormat = att->Renderbuffer->Format; numImages++; @@ -1151,7 +1154,7 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx, if (_mesa_is_format_integer_color(attFormat)) fb->_IntegerBuffers |= (1 << i); - if (f == GL_RGB) + if (baseFormat == GL_RGB) fb->_RGBBuffers |= (1 << i); if (type == GL_FLOAT && _mesa_get_format_max_bits(attFormat) > 16) -- cgit v1.2.3