[Mesa-dev] [PATCH] st/mesa: Finalize texture on render-to-texture.

Michel Dänzer michel at daenzer.net
Wed Sep 14 10:16:32 PDT 2011


From: Michel Dänzer <michel.daenzer at amd.com>

This makes sure that stObj->pt exists and is up to date.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39193 .

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/mesa/state_tracker/st_cb_fbo.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index d43f67a..05139ec 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -47,6 +47,7 @@
 #include "st_context.h"
 #include "st_cb_fbo.h"
 #include "st_cb_flush.h"
+#include "st_cb_texture.h"
 #include "st_format.h"
 #include "st_texture.h"
 #include "st_manager.h"
@@ -340,15 +341,17 @@ st_render_texture(struct gl_context *ctx,
    struct pipe_context *pipe = st->pipe;
    struct st_renderbuffer *strb;
    struct gl_renderbuffer *rb;
-   struct pipe_resource *pt = st_get_texobj_resource(att->Texture);
+   struct pipe_resource *pt;
    struct st_texture_object *stObj;
    const struct gl_texture_image *texImage;
    struct pipe_surface surf_tmpl;
 
-   /* When would this fail?  Perhaps assert? */
-   if (!pt) 
+   if (!st_finalize_texture(ctx, pipe, att->Texture))
       return;
 
+   pt = st_get_texobj_resource(att->Texture);
+   assert(pt);
+
    /* get pointer to texture image we're rendeing to */
    texImage = _mesa_get_attachment_teximage(att);
 
-- 
1.7.5.4



More information about the mesa-dev mailing list