diff options
author | Eric Anholt <[email protected]> | 2013-05-10 12:36:43 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2013-05-17 13:04:04 -0700 |
commit | c810e67c55a8a2965b730317873fbdcc186a7514 (patch) | |
tree | d8fc5963c608f2cdcc9adcf348075f469a37fc4d /src/mesa/drivers | |
parent | 6166ffeaf70e96e3f94417f8db79ba2440462178 (diff) |
mesa: Make gl_renderbuffers backed by EGL images use FinishRenderTexture.
This is the opportunity that radeon and intel drivers rely on for flushing
render targets that may get reused as textures. Before EGL, that only
happened for GL_TEXTURE attachments.
Fixes piglits:
KHR_gl_renderbuffer_image/renderbuffer-texture
OES_EGL_image/renderbuffer-texture
NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_fbo.c | 10 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_screen.c | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_fbo.c | 10 |
3 files changed, 11 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 2e36b0b8d5a..6b30262892a 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -306,6 +306,7 @@ intel_image_target_renderbuffer_storage(struct gl_context *ctx, rb->Format = image->format; rb->_BaseFormat = _mesa_base_fbo_format(&intel->ctx, image->internal_format); + rb->NeedsFinishRenderTexture = true; } /** @@ -621,13 +622,10 @@ intel_finish_render_texture(struct gl_context * ctx, struct gl_renderbuffer_attachment *att) { struct intel_context *intel = intel_context(ctx); - struct gl_texture_object *tex_obj = att->Texture; - struct gl_texture_image *image = - tex_obj->Image[att->CubeMapFace][att->TextureLevel]; - struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer); + struct gl_renderbuffer *rb = att->Renderbuffer; + struct intel_renderbuffer *irb = intel_renderbuffer(rb); - DBG("Finish render %s texture tex=%u\n", - _mesa_get_format_name(image->TexFormat), att->Texture->Name); + DBG("Finish render %s texture\n", _mesa_get_format_name(rb->Format)); if (irb) irb->tex_image = NULL; diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index ad1b351b711..9c292d6029d 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -409,6 +409,7 @@ intel_create_image_from_renderbuffer(__DRIcontext *context, image->dri_format = intel_dri_format(image->format); image->has_depthstencil = irb->mt->stencil_mt? true : false; + rb->NeedsFinishRenderTexture = true; return image; } diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 5f996c52b67..e546a6b365c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -597,6 +597,7 @@ radeon_image_target_renderbuffer_storage(struct gl_context *ctx, rb->Format = image->format; rb->_BaseFormat = _mesa_base_fbo_format(&radeon->glCtx, image->internal_format); + rb->NeedsFinishRenderTexture = GL_TRUE; } /** @@ -883,10 +884,11 @@ radeon_finish_render_texture(struct gl_context * ctx, struct gl_renderbuffer_attachment *att) { struct gl_texture_object *tex_obj = att->Texture; - struct gl_texture_image *image = - tex_obj->Image[att->CubeMapFace][att->TextureLevel]; - radeon_texture_image *radeon_image = (radeon_texture_image *)image; - + radeon_texture_image *radeon_image = NULL; + + if (tex_obj) + radeon_image = (radeon_texture_image *)_mesa_get_attachment_teximage(att); + if (radeon_image) radeon_image->used_as_render_target = GL_FALSE; |