nv50: maintain pipe surface status field
authorBen Skeggs <skeggsb@gmail.com>
Mon, 23 Jun 2008 13:43:34 +0000 (23:43 +1000)
committerBen Skeggs <skeggsb@gmail.com>
Sun, 29 Jun 2008 05:46:19 +0000 (15:46 +1000)
src/gallium/drivers/nv50/nv50_clear.c
src/gallium/drivers/nv50/nv50_state_validate.c

index 552b92f72e233b352e1aaaf73437cad6d7636f4b..f35087b37ef1fda41b329907b888e68abf527b9a 100644 (file)
@@ -9,4 +9,5 @@ nv50_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 8229bce89ee57a0b957c90f586c1465ba3255380..f5c734699fc21a6279f78a608e2b9636707ccb6f 100644 (file)
@@ -157,10 +157,17 @@ nv50_state_emit(struct nv50_context *nv50)
 boolean
 nv50_state_validate(struct nv50_context *nv50)
 {
+       const struct pipe_framebuffer_state *fb = &nv50->framebuffer;
        struct nouveau_grobj *tesla = nv50->screen->tesla;
        struct nouveau_stateobj *so;
        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;
+
        if (nv50->dirty & NV50_NEW_FRAMEBUFFER)
                nv50_state_validate_fb(nv50);