Mesa (master): r100: Use _mesa_get_format_base_format in radeon_update_wrapper

Ian Romanick idr at kemper.freedesktop.org
Thu Jun 1 04:32:22 UTC 2017


Module: Mesa
Branch: master
Commit: 303b47f253f595ca0f708bef1059cbb4996f83a0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=303b47f253f595ca0f708bef1059cbb4996f83a0

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Thu May 25 21:26:09 2017 -0700

r100: Use _mesa_get_format_base_format in radeon_update_wrapper

The wrapper is for a renderbuffer around a texture.  Textures can have
formats (e.g., 3) that aren't valide for API generated renderbuffers.
_mesa_base_fbo_format will return 0, but _mesa_get_format_base_format
will return the base format of RGB.

Fixes a crashes in piglit tests fbo-alphatest-formats (all subtests
pass) and fbo-colormask-formats (some subtests pass, some fail).

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Cc: mesa-stable at lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/radeon/radeon_fbo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c
index 4d75d149b2..89ea776526 100644
--- a/src/mesa/drivers/dri/radeon/radeon_fbo.c
+++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c
@@ -739,7 +739,7 @@ radeon_update_wrapper(struct gl_context *ctx, struct radeon_renderbuffer *rrb,
 	rrb->pitch = texImage->Width * rrb->cpp;
 	rb->Format = texImage->TexFormat;
 	rb->InternalFormat = texImage->InternalFormat;
-	rb->_BaseFormat = _mesa_base_fbo_format(ctx, rb->InternalFormat);
+	rb->_BaseFormat = _mesa_get_format_base_format(rb->Format);
 	rb->Width = texImage->Width;
 	rb->Height = texImage->Height;
 	rb->Delete = radeon_delete_renderbuffer;




More information about the mesa-commit mailing list