[Mesa-dev] [PATCH 4/4] mesa: Make FinishRenderTexture just take the renderbuffer being finished.

Eric Anholt eric at anholt.net
Fri May 10 23:37:30 PDT 2013


Now that the rb has a reference to the teximage, we didn't need anything
else out of the attachment.
---
 src/mesa/drivers/dri/intel/intel_fbo.c     | 4 +---
 src/mesa/drivers/dri/nouveau/nouveau_fbo.c | 4 ++--
 src/mesa/drivers/dri/radeon/radeon_fbo.c   | 5 ++---
 src/mesa/main/dd.h                         | 2 +-
 src/mesa/main/fbobject.c                   | 6 +++---
 src/mesa/state_tracker/st_cb_fbo.c         | 5 ++---
 src/mesa/swrast/s_texrender.c              | 4 ++--
 src/mesa/swrast/swrast.h                   | 2 +-
 8 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index bf8e48d..69f8629 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -617,11 +617,9 @@ intel_render_texture(struct gl_context * ctx,
  * Called by Mesa when rendering to a texture is done.
  */
 static void
-intel_finish_render_texture(struct gl_context * ctx,
-                            struct gl_renderbuffer_attachment *att)
+intel_finish_render_texture(struct gl_context * ctx, struct gl_renderbuffer *rb)
 {
    struct intel_context *intel = intel_context(ctx);
-   struct gl_renderbuffer *rb = att->Renderbuffer;
 
    DBG("Finish render %s texture\n", _mesa_get_format_name(rb->Format));
 
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c
index f997ac8..25543e4 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c
@@ -263,9 +263,9 @@ nouveau_render_texture(struct gl_context *ctx, struct gl_framebuffer *fb,
 
 static void
 nouveau_finish_render_texture(struct gl_context *ctx,
-			      struct gl_renderbuffer_attachment *att)
+			      struct gl_renderbuffer *rb)
 {
-	texture_dirty(att->Texture);
+	texture_dirty(rb->TexImage->TexObject);
 }
 
 void
diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c
index 1fdcf05..63bc7e8 100644
--- a/src/mesa/drivers/dri/radeon/radeon_fbo.c
+++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c
@@ -850,10 +850,9 @@ radeon_render_texture(struct gl_context * ctx,
 }
 
 static void
-radeon_finish_render_texture(struct gl_context * ctx,
-                            struct gl_renderbuffer_attachment *att)
+radeon_finish_render_texture(struct gl_context *ctx, struct gl_renderbuffer *rb)
 {
-    struct gl_texture_image *image = att->Renderbuffer->TexImage;
+    struct gl_texture_image *image = rb->TexImage;
     radeon_texture_image *radeon_image = (radeon_texture_image *)image;
 
     if (radeon_image)
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index adace3b..13c7a83 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -625,7 +625,7 @@ struct dd_function_table {
                          struct gl_framebuffer *fb,
                          struct gl_renderbuffer_attachment *att);
    void (*FinishRenderTexture)(struct gl_context *ctx,
-                               struct gl_renderbuffer_attachment *att);
+                               struct gl_renderbuffer *rb);
    void (*ValidateFramebuffer)(struct gl_context *ctx,
                                struct gl_framebuffer *fb);
    /*@}*/
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 070fb8c..7c13421 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -327,7 +327,7 @@ _mesa_remove_attachment(struct gl_context *ctx,
 
    /* tell driver that we're done rendering to this texture. */
    if (rb && rb->NeedsFinishRenderTexture)
-      ctx->Driver.FinishRenderTexture(ctx, att);
+      ctx->Driver.FinishRenderTexture(ctx, rb);
 
    if (att->Type == GL_TEXTURE) {
       ASSERT(att->Texture);
@@ -410,7 +410,7 @@ _mesa_set_texture_attachment(struct gl_context *ctx,
    struct gl_renderbuffer *rb = att->Renderbuffer;
 
    if (rb && rb->NeedsFinishRenderTexture)
-      ctx->Driver.FinishRenderTexture(ctx, att);
+      ctx->Driver.FinishRenderTexture(ctx, rb);
 
    if (att->Texture == texObj) {
       /* re-attaching same texture */
@@ -1886,7 +1886,7 @@ check_end_texture_render(struct gl_context *ctx, struct gl_framebuffer *fb)
          struct gl_renderbuffer_attachment *att = fb->Attachment + i;
          struct gl_renderbuffer *rb = att->Renderbuffer;
          if (rb && rb->NeedsFinishRenderTexture) {
-            ctx->Driver.FinishRenderTexture(ctx, att);
+            ctx->Driver.FinishRenderTexture(ctx, rb);
          }
       }
    }
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index db4728b..826722b 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -449,10 +449,9 @@ st_render_texture(struct gl_context *ctx,
  * Called via ctx->Driver.FinishRenderTexture.
  */
 static void
-st_finish_render_texture(struct gl_context *ctx,
-                         struct gl_renderbuffer_attachment *att)
+st_finish_render_texture(struct gl_context *ctx, struct gl_renderbuffer *rb)
 {
-   struct st_renderbuffer *strb = st_renderbuffer(att->Renderbuffer);
+   struct st_renderbuffer *strb = st_renderbuffer(rb);
 
    if (!strb)
       return;
diff --git a/src/mesa/swrast/s_texrender.c b/src/mesa/swrast/s_texrender.c
index 643f2bc..751d776 100644
--- a/src/mesa/swrast/s_texrender.c
+++ b/src/mesa/swrast/s_texrender.c
@@ -92,12 +92,12 @@ _swrast_render_texture(struct gl_context *ctx,
 
 void
 _swrast_finish_render_texture(struct gl_context *ctx,
-                              struct gl_renderbuffer_attachment *att)
+                              struct gl_renderbuffer *rb)
 {
    /* do nothing */
    /* The renderbuffer texture wrapper will get deleted by the
     * normal mechanism for deleting renderbuffers.
     */
    (void) ctx;
-   (void) att;
+   (void) rb;
 }
diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h
index e437c0a..359a985 100644
--- a/src/mesa/swrast/swrast.h
+++ b/src/mesa/swrast/swrast.h
@@ -270,7 +270,7 @@ _swrast_render_texture(struct gl_context *ctx,
 
 extern void
 _swrast_finish_render_texture(struct gl_context *ctx,
-                              struct gl_renderbuffer_attachment *att);
+                              struct gl_renderbuffer *rb);
 
 
 /**
-- 
1.8.3.rc0



More information about the mesa-dev mailing list