nv40: maintain pipe_surface status field
authorBen Skeggs <skeggsb@gmail.com>
Mon, 24 Mar 2008 02:45:38 +0000 (13:45 +1100)
committerBen Skeggs <skeggsb@gmail.com>
Mon, 24 Mar 2008 02:45:38 +0000 (13:45 +1100)
src/gallium/drivers/nv40/nv40_clear.c
src/gallium/drivers/nv40/nv40_state_emit.c

index 2c4e8f01fdac7ff4406784dc888eb62864713925..59efd620e3257a1218d8c430faa0bc9c996c4697 100644 (file)
@@ -9,4 +9,5 @@ nv40_clear(struct pipe_context *pipe, struct pipe_surface *ps,
           unsigned clearValue)
 {
        pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, clearValue);
+       ps->status = PIPE_SURFACE_STATUS_CLEAR;
 }
index 056238cc8367f5e900f9b1febe58e25aa67bb19d..a9a9abc92200fc78c6fa63fecaf14f1499b10992 100644 (file)
@@ -40,6 +40,14 @@ static void
 nv40_state_do_validate(struct nv40_context *nv40,
                       struct nv40_state_entry **states)
 {
+       const struct pipe_framebuffer_state *fb = &nv40->framebuffer;
+       unsigned i;
+
+       for (i = 0; i < fb->num_cbufs; i++)
+               fb->cbufs[i]->status = PIPE_SURFACE_STATUS_DEFINED;
+       if (fb->zsbuf)
+               fb->zsbuf->status = PIPE_SURFACE_STATUS_DEFINED;
+
        while (*states) {
                struct nv40_state_entry *e = *states;