[Mesa-dev] [PATCH] intel: fix EGLImage renderbuffer _BaseFormat

Frank Henigman fjhenigman at google.com
Thu Feb 19 15:09:20 PST 2015


Correctly set _BaseFormat field when creating a gl_renderbuffer
with EGLImage storage.

Signed-off-by: Frank Henigman <fjhenigman at google.com>
Reviewed-by: St├ęphane Marchesin <marcheu at chromium.org>
---
 src/mesa/drivers/dri/i915/intel_fbo.c | 3 +--
 src/mesa/drivers/dri/i965/intel_fbo.c | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

Otherwise, when using gles, _BaseFormat is set to 0 and a glReadPixels
from the buffer hits an assert.
Tested on i965.  Compiled for i915.

diff --git a/src/mesa/drivers/dri/i915/intel_fbo.c b/src/mesa/drivers/dri/i915/intel_fbo.c
index ead1b17..6c2e181 100644
--- a/src/mesa/drivers/dri/i915/intel_fbo.c
+++ b/src/mesa/drivers/dri/i915/intel_fbo.c
@@ -287,8 +287,7 @@ intel_image_target_renderbuffer_storage(struct gl_context *ctx,
    rb->Width = image->region->width;
    rb->Height = image->region->height;
    rb->Format = image->format;
-   rb->_BaseFormat = _mesa_base_fbo_format(&intel->ctx,
-					   image->internal_format);
+   rb->_BaseFormat = _mesa_get_format_base_format(image->format);
    rb->NeedsFinishRenderTexture = true;
 }
 
diff --git a/src/mesa/drivers/dri/i965/intel_fbo.c b/src/mesa/drivers/dri/i965/intel_fbo.c
index 174cea0..9394018 100644
--- a/src/mesa/drivers/dri/i965/intel_fbo.c
+++ b/src/mesa/drivers/dri/i965/intel_fbo.c
@@ -398,7 +398,7 @@ intel_image_target_renderbuffer_storage(struct gl_context *ctx,
    rb->Width = image->width;
    rb->Height = image->height;
    rb->Format = image->format;
-   rb->_BaseFormat = _mesa_base_fbo_format(ctx, image->internal_format);
+   rb->_BaseFormat = _mesa_get_format_base_format(image->format);
    rb->NeedsFinishRenderTexture = true;
    irb->layer_count = 1;
 }
-- 
2.2.0.rc0.207.ga3a616c



More information about the mesa-dev mailing list