summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-05-01 18:21:02 -0600
committerBrian Paul <[email protected]>2009-05-01 18:21:02 -0600
commita7ef5b76d6889c4a6614eddea0c021c83f6a8703 (patch)
treea21244a45d23a40b686318045ba3d6ae3e6ac142 /src/mesa/state_tracker
parent602833b107cdf3d70117dbd0970c7d574fb55f3b (diff)
parent0a56a4968786bd93d9117af2a0a3bda13ea71c4d (diff)
Merge branch 'mesa_7_5_branch'
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 9ae4208a18d..c249f3b3578 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -345,6 +345,7 @@ st_render_texture(GLcontext *ctx,
struct gl_framebuffer *fb,
struct gl_renderbuffer_attachment *att)
{
+ struct pipe_screen *screen = ctx->st->pipe->screen;
struct st_renderbuffer *strb;
struct gl_renderbuffer *rb;
struct pipe_texture *pt = st_get_texobj_texture(att->Texture);
@@ -367,6 +368,8 @@ st_render_texture(GLcontext *ctx,
rb->AllocStorage = NULL; /* should not get called */
strb = st_renderbuffer(rb);
+ assert(strb->Base.RefCount > 0);
+
/* get the texture for the texture object */
stObj = st_texture_object(att->Texture);
@@ -386,7 +389,14 @@ st_render_texture(GLcontext *ctx,
pipe_surface_reference(&strb->surface, NULL);
- /* the new surface will be created during framebuffer validation */
+ /* new surface for rendering into the texture */
+ strb->surface = screen->get_tex_surface(screen,
+ strb->texture,
+ strb->rtt_face,
+ strb->rtt_level,
+ strb->rtt_slice,
+ PIPE_BUFFER_USAGE_GPU_READ |
+ PIPE_BUFFER_USAGE_GPU_WRITE);
init_renderbuffer_bits(strb, pt->format);