r300g: fix cbzb clears when hyperz is off
authorMarek Olšák <maraeo@gmail.com>
Fri, 6 Aug 2010 23:59:31 +0000 (01:59 +0200)
committerMarek Olšák <maraeo@gmail.com>
Sat, 7 Aug 2010 00:00:21 +0000 (02:00 +0200)
src/gallium/drivers/r300/r300_flush.c
src/gallium/drivers/r300/r300_hyperz.c
src/gallium/drivers/r300/r300_render.c
src/gallium/drivers/r300/r300_state.c
src/gallium/drivers/r300/r300_state_derived.c

index 7fed9b5d07478cb105d0cdf7ce1b4ef583160449..fe182b6615b7578cc1f15e7b10b5ef0fc66bc277 100644 (file)
@@ -44,8 +44,7 @@ static void r300_flush(struct pipe_context* pipe,
     u_upload_flush(r300->upload_ib);
 
     if (r300->dirty_hw) {
-        if (r300->rws->get_value(r300->rws, R300_CAN_HYPERZ))
-            r300_emit_hyperz_end(r300);
+        r300_emit_hyperz_end(r300);
         r300_emit_query_end(r300);
 
         r300->flush_counter++;
index 10e440ce3065d28d9470e9b71a3d4e26c67040f5..523d547ea935f2a7293677c14c55dc63240e57bf 100644 (file)
  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  * USE OR OTHER DEALINGS IN THE SOFTWARE. */
 
-#include "util/u_format.h"
-#include "util/u_mm.h"
 #include "r300_context.h"
 #include "r300_hyperz.h"
 #include "r300_reg.h"
 #include "r300_fs.h"
+#include "r300_winsys.h"
+
+#include "util/u_format.h"
+#include "util/u_mm.h"
 
 /*
   HiZ rules - taken from various docs 
@@ -138,6 +140,9 @@ static void r300_update_hyperz(struct r300_context* r300)
         return;
     }
 
+    if (!r300->rws->get_value(r300->rws, R300_CAN_HYPERZ))
+        return;
+
     /* Zbuffer compression. */
     if (r300->z_compression) {
         z->zb_bw_cntl |= R300_RD_COMP_ENABLE;
index 910f5f7113e51e049f9e5159d107aea44f703704..f2ff65b261d1a8f9957d1e8c114ee91d13999acd 100644 (file)
@@ -223,8 +223,7 @@ static void r300_prepare_for_rendering(struct r300_context *r300,
 
     /* Emitted in flush. */
     end_dwords += 26; /* emit_query_end */
-    if (r300->rws->get_value(r300->rws, R300_CAN_HYPERZ))
-        end_dwords += r300->hyperz_state.size + 2; /* emit_hyperz_end + zcache flush */
+    end_dwords += r300->hyperz_state.size + 2; /* emit_hyperz_end + zcache flush */
 
     cs_dwords += end_dwords;
 
index 1e6b81d7989c700e635a65a85059634665980047..9db5e9e0545c27f8581b03dd698a91fb027734ce 100644 (file)
@@ -689,8 +689,7 @@ void r300_mark_fb_state_dirty(struct r300_context *r300,
     /* What is marked as dirty depends on the enum r300_fb_state_change. */
     r300->gpu_flush.dirty = TRUE;
     r300->fb_state.dirty = TRUE;
-    if (r300->rws->get_value(r300->rws, R300_CAN_HYPERZ))
-        r300->hyperz_state.dirty = TRUE;
+    r300->hyperz_state.dirty = TRUE;
 
     if (change == R300_CHANGED_FB_STATE) {
         r300->aa_state.dirty = TRUE;
index f3dad4c2923f11c5092fa4eab72b63245189960f..a85b46f5c7dd0a1d70a3094405ded66511274122 100644 (file)
@@ -694,6 +694,5 @@ void r300_update_derived_state(struct r300_context* r300)
         }
     }
 
-    if (r300->rws->get_value(r300->rws, R300_CAN_HYPERZ))
-        r300_update_hyperz_state(r300);
+    r300_update_hyperz_state(r300);
 }