r300g: fix fb_state atom size
authorMarek Olšák <maraeo@gmail.com>
Thu, 5 Aug 2010 17:04:01 +0000 (19:04 +0200)
committerMarek Olšák <maraeo@gmail.com>
Thu, 5 Aug 2010 17:06:09 +0000 (19:06 +0200)
src/gallium/drivers/r300/r300_state.c

index 374aa254f0985896664ba527451aebf5ff9c91bf..1e6b81d7989c700e635a65a85059634665980047 100644 (file)
@@ -684,6 +684,7 @@ void r300_mark_fb_state_dirty(struct r300_context *r300,
                               enum r300_fb_state_change change)
 {
     struct pipe_framebuffer_state *state = r300->fb_state.state;
+    boolean has_hyperz = r300->rws->get_value(r300->rws, R300_CAN_HYPERZ);
 
     /* What is marked as dirty depends on the enum r300_fb_state_change. */
     r300->gpu_flush.dirty = TRUE;
@@ -701,8 +702,11 @@ void r300_mark_fb_state_dirty(struct r300_context *r300,
 
     if (r300->cbzb_clear)
         r300->fb_state.size += 10;
-    else if (state->zsbuf)
-        r300->fb_state.size += r300->screen->caps.hiz_ram ? 18 : 14;
+    else if (state->zsbuf) {
+        r300->fb_state.size += 10;
+        if (has_hyperz)
+            r300->fb_state.size += r300->screen->caps.hiz_ram ? 8 : 4;
+    }
 
     /* The size of the rest of atoms stays the same. */
 }