i965: Assert that a depth_mt exists when using HiZ.
authorMatt Turner <mattst88@gmail.com>
Tue, 24 May 2016 20:06:36 +0000 (13:06 -0700)
committerMatt Turner <mattst88@gmail.com>
Wed, 25 May 2016 19:44:34 +0000 (12:44 -0700)
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
src/mesa/drivers/dri/i965/brw_misc_state.c
src/mesa/drivers/dri/i965/gen6_depth_state.c
src/mesa/drivers/dri/i965/gen7_misc_state.c
src/mesa/drivers/dri/i965/gen8_depth_state.c

index 5510d2c36f40e1c1cc92082127cc71def50edc4b..690c2f65fd946c6ff8e860cf28cecc2ca01e668f 100644 (file)
@@ -646,6 +646,7 @@ brw_emit_depth_stencil_hiz(struct brw_context *brw,
 
       /* Emit hiz buffer. */
       if (hiz) {
+         assert(depth_mt);
          struct intel_mipmap_tree *hiz_mt = depth_mt->hiz_buf->mt;
         BEGIN_BATCH(3);
         OUT_BATCH((_3DSTATE_HIER_DEPTH_BUFFER << 16) | (3 - 2));
index febd4781100f6faa43207840aafbd0626fc0bf0c..1a29860580dfb67fd21f377b1c1416e32e40ef5a 100644 (file)
@@ -160,6 +160,7 @@ gen6_emit_depth_stencil_hiz(struct brw_context *brw,
 
       /* Emit hiz buffer. */
       if (hiz) {
+         assert(depth_mt);
          struct intel_mipmap_tree *hiz_mt = depth_mt->hiz_buf->mt;
          uint32_t offset = 0;
 
index 321c425dd47b6f64bfa9973ce291fa3ab9b2271c..ffdf6f22e62b7caada346752f7402e6b3e99d2ca 100644 (file)
@@ -145,6 +145,7 @@ gen7_emit_depth_stencil_hiz(struct brw_context *brw,
       OUT_BATCH(0);
       ADVANCE_BATCH();
    } else {
+      assert(depth_mt);
       struct intel_miptree_aux_buffer *hiz_buf = depth_mt->hiz_buf;
 
       BEGIN_BATCH(3);
index 0eb993fcd7bfc41bfd59b29cea19a01266043f50..a780da6b376293a748b99b1ca94e14eea96c3c92 100644 (file)
@@ -90,6 +90,7 @@ emit_depth_packets(struct brw_context *brw,
       OUT_BATCH(0);
       ADVANCE_BATCH();
    } else {
+      assert(depth_mt);
       BEGIN_BATCH(5);
       OUT_BATCH(GEN7_3DSTATE_HIER_DEPTH_BUFFER << 16 | (5 - 2));
       OUT_BATCH((depth_mt->hiz_buf->pitch - 1) | mocs_wb << 25);