mesa: Make FinishRenderTexture just take the renderbuffer being finished.
authorEric Anholt <eric@anholt.net>
Fri, 10 May 2013 19:17:52 +0000 (12:17 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 17 May 2013 20:04:05 +0000 (13:04 -0700)
Now that the rb has a reference to the teximage, we didn't need anything
else out of the attachment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/intel/intel_fbo.c
src/mesa/drivers/dri/nouveau/nouveau_fbo.c
src/mesa/drivers/dri/radeon/radeon_fbo.c
src/mesa/main/dd.h
src/mesa/main/fbobject.c
src/mesa/state_tracker/st_cb_fbo.c
src/mesa/swrast/s_texrender.c
src/mesa/swrast/swrast.h

index bf8e48d779bf84fa12981a4ae83b91220582d137..69f862930d6c2048e77b013a48759ff1190821a9 100644 (file)
@@ -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));
 
index f997ac888f9f076c7e197868fdd0a5da73eda94d..25543e458b44e9b0fb30b1c81b92ee4e3925304e 100644 (file)
@@ -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
index 1fdcf05656215a273c63276415cab2585c89203b..63bc7e8ab6472ac724deba17aeac5862c97b37d5 100644 (file)
@@ -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)
index adace3b70a9e49a623b25e8e11d6482db618d00d..13c7a83d4bba3c8fda068625bf033db75c6f04ed 100644 (file)
@@ -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);
    /*@}*/
index 070fb8c535628aa92346d1d699478830a1fca652..7c134212c910053714016c799e8c691bf8475bdb 100644 (file)
@@ -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);
          }
       }
    }
index db4728b3237af21a7ee14b743c894ad99e2d30dd..826722be862d5b82567782bb6d6634a8eb3f515f 100644 (file)
@@ -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;
index 643f2bc2c24e3b8d636a8d98c7bebe5e64344be5..751d7767b91df1b1ad1ecef2aea9a61de3897638 100644 (file)
@@ -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;
 }
index e437c0a2459c5364534dbc90417c6226408c3348..359a985fdead76a21a2f316c62e711b531252657 100644 (file)
@@ -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);
 
 
 /**