diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2013-07-09 15:16:35 -0700 |
---|---|---|
committer | Jordan Justen <jordan.l.justen@intel.com> | 2014-02-24 17:25:16 -0800 |
commit | ed69b979c993f6b6d189a72da3e3ce3b31ca9957 (patch) | |
tree | 4a9d297dbc3b57bd69e483163f89b97f904031dd | |
parent | 40a05fe875d0cc0cd8c8e1455ca5ebb764a72082 (diff) |
gen6 depth surface: calculate depth (array size) for depth surface
(bc1acaa for gen6)
This will be used in 3DSTATE_DEPTH_BUFFER in a later patch.
Note: Cube maps are treated as 2D arrays with 6 times as
many array elements as the cube map array would have.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_misc_state.c | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/gen6_blorp.cpp | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index 56a4e3d4ce..3c01dca114 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -603,6 +603,7 @@ brw_emit_depth_stencil_hiz(struct brw_context *brw, struct gl_context *ctx = &brw->ctx; struct gl_framebuffer *fb = ctx->DrawBuffer; uint32_t surftype; + unsigned int depth = 1; GLenum gl_target = GL_TEXTURE_2D; const struct intel_renderbuffer *irb = NULL; const struct gl_renderbuffer *rb = NULL; @@ -633,6 +634,7 @@ brw_emit_depth_stencil_hiz(struct brw_context *brw, rb = (struct gl_renderbuffer*) irb; if (rb) { + depth = MAX2(rb->Depth, 1); if (rb->TexImage) gl_target = rb->TexImage->TexObject->Target; } @@ -646,6 +648,7 @@ brw_emit_depth_stencil_hiz(struct brw_context *brw, * equivalent. */ surftype = BRW_SURFACE_2D; + depth *= 6; break; default: surftype = translate_tex_target(gl_target); diff --git a/src/mesa/drivers/dri/i965/gen6_blorp.cpp b/src/mesa/drivers/dri/i965/gen6_blorp.cpp index 151f9aa07f..adc950053e 100644 --- a/src/mesa/drivers/dri/i965/gen6_blorp.cpp +++ b/src/mesa/drivers/dri/i965/gen6_blorp.cpp @@ -793,6 +793,7 @@ gen6_blorp_emit_depth_stencil_config(struct brw_context *brw, uint32_t draw_y = params->depth.y_offset; uint32_t tile_mask_x, tile_mask_y; uint32_t surftype; + unsigned int depth = MAX2(params->depth.mt->logical_depth0, 1); GLenum gl_target = params->depth.mt->target; switch (gl_target) { @@ -804,6 +805,7 @@ gen6_blorp_emit_depth_stencil_config(struct brw_context *brw, * equivalent. */ surftype = BRW_SURFACE_2D; + depth *= 6; break; default: surftype = translate_tex_target(gl_target); |