[Mesa-dev] [PATCH] meta: do the full FBO completeness check in decompress_texture_image
Marek Olšák
maraeo at gmail.com
Tue Jun 20 13:29:34 UTC 2017
From: Marek Olšák <marek.olsak at amd.com>
_mesa_update_state will no longer recompute Width/Height if the framebuffer
is complete. We now rely on the FBO completeness check to do it.
The only code that needs to be fixed seems to be this one.
---
src/mesa/drivers/common/meta.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 1ff4651..6f6a5cc 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -3057,20 +3057,25 @@ decompress_texture_image(struct gl_context *ctx,
decompress_fbo->rb);
}
else {
_mesa_bind_framebuffers(ctx, decompress_fbo->fb, decompress_fbo->fb);
}
/* alloc dest surface */
if (width > decompress_fbo->Width || height > decompress_fbo->Height) {
_mesa_renderbuffer_storage(ctx, decompress_fbo->rb, rbFormat,
width, height, 0);
+
+ /* Do the full completeness check to recompute
+ * ctx->DrawBuffer->Width/Height.
+ */
+ ctx->DrawBuffer->_Status = GL_FRAMEBUFFER_UNDEFINED;
status = _mesa_check_framebuffer_status(ctx, ctx->DrawBuffer);
if (status != GL_FRAMEBUFFER_COMPLETE) {
/* If the framebuffer isn't complete then we'll leave
* decompress_fbo->Width as zero so that it will fail again next time
* too */
_mesa_meta_end(ctx);
return false;
}
decompress_fbo->Width = width;
decompress_fbo->Height = height;
--
2.7.4
More information about the mesa-dev
mailing list