[Mesa-dev] [PATCH 07/14] intel: Refactor the wrapping of textures with renderbuffers
chad at chad-versace.us
chad at chad-versace.us
Wed May 4 13:33:51 PDT 2011
From: Chad Versace <chad.versace at intel.com>
The update of the wrapping renderbuffer's region was done in
intel_renderbuffer_texture(). Move the update into intel_update_wrapper(),
which is a more logical location for updates.
The next commits allocates and updates the texture's hiz region in
intel_update_wrapper(), and having the two region updates in the same
function makes good form.
Signed-off-by: Chad Versace <chad.versace at intel.com>
---
src/mesa/drivers/dri/intel/intel_fbo.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 7e3f698..d20009e 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -397,6 +397,8 @@ static GLboolean
intel_update_wrapper(struct gl_context *ctx, struct intel_renderbuffer *irb,
struct gl_texture_image *texImage)
{
+ struct intel_texture_image *intel_image = intel_texture_image(texImage);
+
if (!intel_span_supports_format(texImage->TexFormat)) {
DBG("Render to texture BAD FORMAT %s\n",
_mesa_get_format_name(texImage->TexFormat));
@@ -415,6 +417,12 @@ intel_update_wrapper(struct gl_context *ctx, struct intel_renderbuffer *irb,
irb->Base.Delete = intel_delete_renderbuffer;
irb->Base.AllocStorage = intel_nop_alloc_storage;
+ /* Point the renderbuffer's region to the texture's region. */
+ if (irb->region != intel_image->mt->region) {
+ intel_region_release(&irb->region);
+ intel_region_reference(&irb->region, intel_image->mt->region);
+ }
+
return GL_TRUE;
}
@@ -520,13 +528,6 @@ intel_render_texture(struct gl_context * ctx,
att->Texture->Name, newImage->Width, newImage->Height,
irb->Base.RefCount);
- /* point the renderbufer's region to the texture image region */
- if (irb->region != intel_image->mt->region) {
- if (irb->region)
- intel_region_release(&irb->region);
- intel_region_reference(&irb->region, intel_image->mt->region);
- }
-
intel_set_draw_offset_for_image(intel_image, att->Zoffset);
intel_image->used_as_render_target = GL_TRUE;
--
1.7.5
More information about the mesa-dev
mailing list