st/mesa: update stencil surface if it comes from texture
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 24 Apr 2015 23:17:11 +0000 (19:17 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Tue, 12 May 2015 22:41:11 +0000 (18:41 -0400)
Now that ARB_texture_stencil8 is supported, this might happen.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/mesa/state_tracker/st_atom_framebuffer.c

index b195c55b347e4fa8ee534433e9732615c2605fe1..ae883a2535e32ad98931632d4e5b406de1cf67f7 100644 (file)
@@ -134,7 +134,10 @@ update_framebuffer_state( struct st_context *st )
    else {
       strb = st_renderbuffer(fb->Attachment[BUFFER_STENCIL].Renderbuffer);
       if (strb) {
-         assert(strb->surface);
+         if (strb->is_rtt) {
+            /* rendering to a GL texture, may have to update surface */
+            st_update_renderbuffer_surface(st, strb);
+         }
          pipe_surface_reference(&framebuffer->zsbuf, strb->surface);
          update_framebuffer_size(framebuffer, strb->surface);
       }