gallium: set surface status to CLEAR or DEFINED in clearing/drawing code.
authorBrian <brian.paul@tungstengraphics.com>
Thu, 13 Mar 2008 20:57:19 +0000 (14:57 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Thu, 13 Mar 2008 21:08:18 +0000 (15:08 -0600)
Otherwise, we were never setting these flags.  This confused the state tracker.
Fixes progs/demos/texenv.c, probably others.

src/gallium/drivers/softpipe/sp_clear.c
src/gallium/drivers/softpipe/sp_prim_setup.c

index 8d295a30ca6e3ecfb1425705f42e929088780512..39aed151c73f1a2d5221c3a5acf2b146f6f22563 100644 (file)
@@ -55,6 +55,7 @@ softpipe_clear(struct pipe_context *pipe, struct pipe_surface *ps,
 
    if (ps == sp_tile_cache_get_surface(softpipe->zsbuf_cache)) {
       sp_tile_cache_clear(softpipe->zsbuf_cache, clearValue);
+      softpipe->framebuffer.zsbuf->status = PIPE_SURFACE_STATUS_CLEAR;
 #if TILE_CLEAR_OPTIMIZATION
       return;
 #endif
@@ -63,6 +64,7 @@ softpipe_clear(struct pipe_context *pipe, struct pipe_surface *ps,
    for (i = 0; i < softpipe->framebuffer.num_cbufs; i++) {
       if (ps == sp_tile_cache_get_surface(softpipe->cbuf_cache[i])) {
          sp_tile_cache_clear(softpipe->cbuf_cache[i], clearValue);
+         softpipe->framebuffer.cbufs[i]->status = PIPE_SURFACE_STATUS_CLEAR;
       }
    }
 
index 2feee5c485e51a698d827ce3e949a456b4a34eb3..7aa9cf8e8518b2fdeeba75f89a02f0e39a8f2dfa 100644 (file)
@@ -1164,11 +1164,22 @@ static void setup_begin( struct draw_stage *stage )
    struct setup_stage *setup = setup_stage(stage);
    struct softpipe_context *sp = setup->softpipe;
    const struct sp_fragment_shader *fs = setup->softpipe->fs;
+   uint i;
 
    if (sp->dirty) {
       softpipe_update_derived(sp);
    }
 
+   /* Mark surfaces as defined now */
+   for (i = 0; i < sp->framebuffer.num_cbufs; i++){
+      if (sp->framebuffer.cbufs[i]) {
+         sp->framebuffer.cbufs[i]->status = PIPE_SURFACE_STATUS_DEFINED;
+      }
+   }
+   if (sp->framebuffer.zsbuf) {
+      sp->framebuffer.zsbuf->status = PIPE_SURFACE_STATUS_DEFINED;
+   }
+
    setup->quad.nr_attrs = fs->info.num_inputs;
 
    sp->quad.first->begin(sp->quad.first);