summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2013-07-09 15:32:42 -0700
committerJordan Justen <jordan.l.justen@intel.com>2014-07-30 11:49:43 -0700
commit74929d1ccb715469a0e6d304f48569e95df36848 (patch)
tree05dc1012f3de59263d6cb71aff9276aad3e14e9d
parentc7091429b4b69e1a6d4b84662d37e0ddc9e88a11 (diff)
i965/gen6 blorp depth: calculate base surface width/height
(e3a49e1 for gen6) This will be used in 3DSTATE_DEPTH_BUFFER in a later patch. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
-rw-r--r--src/mesa/drivers/dri/i965/gen6_blorp.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_blorp.cpp b/src/mesa/drivers/dri/i965/gen6_blorp.cpp
index ff1732d0e5..dca6bfc79b 100644
--- a/src/mesa/drivers/dri/i965/gen6_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/gen6_blorp.cpp
@@ -791,6 +791,7 @@ gen6_blorp_emit_depth_stencil_config(struct brw_context *brw,
uint32_t draw_x = params->depth.x_offset;
uint32_t draw_y = params->depth.y_offset;
uint32_t tile_mask_x, tile_mask_y;
+ uint32_t surfwidth, surfheight;
uint32_t surftype;
unsigned int depth = MAX2(params->depth.mt->logical_depth0, 1);
unsigned int min_array_element;
@@ -823,6 +824,18 @@ gen6_blorp_emit_depth_stencil_config(struct brw_context *brw,
lod = params->depth.level - params->depth.mt->first_level;
+ if (params->hiz_op != GEN6_HIZ_OP_NONE && lod == 0) {
+ /* HIZ ops for lod 0 may set the width & height a little
+ * larger to allow the fast depth clear to fit the hardware
+ * alignment requirements. (8x4)
+ */
+ surfwidth = params->depth.width;
+ surfheight = params->depth.height;
+ } else {
+ surfwidth = params->depth.mt->logical_width0;
+ surfheight = params->depth.mt->logical_height0;
+ }
+
/* 3DSTATE_DEPTH_BUFFER */
{
uint32_t tile_x = draw_x & tile_mask_x;