diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2011-09-22 17:01:18 +0200 |
---|---|---|
committer | Marek Olšák <maraeo@gmail.com> | 2011-10-02 03:45:43 +0200 |
commit | bb38f931a8b883b50858462882e458424dd4ee3a (patch) | |
tree | 8b9ab61e85cc863b069165de6dc9778a2504935c | |
parent | 726ce042f8a88003b34fd2c068691a0f67427c58 (diff) |
st/mesa: Finalize texture on render-to-texture.
This makes sure that stObj->pt exists and is up to date.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39193 and piglit
fbo-incomplete-texture-03.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit de414f491526610bb260c73805c81ba413388e20)
-rw-r--r-- | 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 5b9e2037423..9fe5d2109f6 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" @@ -342,15 +343,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); |