r300g: fix cbzb clears when hyperz is off
[mesa.git] / src / gallium / drivers / r300 / r300_hyperz.c
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;