i965/gen4: Set depth offset when there is stencil attachment only
[mesa.git] / src / mesa / drivers / dri / i965 / brw_misc_state.c
index df521652107f6d2d1db6eb826ec9e56d418ec559..bf0a147126eff814a733c6ea8e36d5ecb5c2643f 100644 (file)
@@ -432,6 +432,12 @@ brw_workaround_depthstencil_alignment(struct brw_context *brw,
          brw->depthstencil.stencil_offset =
             (stencil_draw_y & ~tile_mask_y) * stencil_mt->pitch +
             (stencil_draw_x & ~tile_mask_x) * 64;
+      } else if (!depth_irb) {
+         brw->depthstencil.depth_offset =
+            intel_miptree_get_aligned_offset(
+               stencil_mt,
+               stencil_irb->draw_x & ~tile_mask_x,
+               stencil_irb->draw_y & ~tile_mask_y);
       }
    }
 }