- struct intel_region *region = depth_mt->region;
- uint32_t tile_x, tile_y, offset;
-
- offset = intel_renderbuffer_tile_offsets(drb, &tile_x, &tile_y);
-
- assert(region->tiling == I915_TILING_Y);
-
- /* _NEW_DEPTH, _NEW_STENCIL */
- BEGIN_BATCH(7);
- OUT_BATCH(GEN7_3DSTATE_DEPTH_BUFFER << 16 | (7 - 2));
- OUT_BATCH(((region->pitch * region->cpp) - 1) |
- (brw_depthbuffer_format(brw) << 18) |
- (0 << 22) /* no HiZ buffer */ |
- ((stencil_mt != NULL && ctx->Stencil.WriteMask != 0) << 27) |
- ((ctx->Depth.Mask != 0) << 28) |
- (BRW_SURFACE_2D << 29));
- OUT_RELOC(region->bo,
- I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
- offset);
- OUT_BATCH(((region->width - 1) << 4) | ((region->height - 1) << 18));
- OUT_BATCH(0);
- OUT_BATCH(tile_x | (tile_y << 16));
- OUT_BATCH(0);
+ struct intel_mipmap_tree *hiz_mt = depth_mt->hiz_mt;
+ BEGIN_BATCH(3);
+ OUT_BATCH(GEN7_3DSTATE_HIER_DEPTH_BUFFER << 16 | (3 - 2));
+ OUT_BATCH((mocs << 25) |
+ (hiz_mt->pitch - 1));
+ OUT_RELOC(hiz_mt->bo,
+ I915_GEM_DOMAIN_RENDER,
+ I915_GEM_DOMAIN_RENDER,
+ 0);