diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2013-07-09 15:19:55 -0700 |
---|---|---|
committer | Jordan Justen <jordan.l.justen@intel.com> | 2014-02-24 17:25:16 -0800 |
commit | dba4db45d5ed43f6bc0c058b045238e856ad38fd (patch) | |
tree | dd0dbed8d6411695bfb8242840115f5426b1ca3b | |
parent | ed69b979c993f6b6d189a72da3e3ce3b31ca9957 (diff) |
gen6 depth surface: calculate LOD being rendered to
(08ef1dd 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/brw_misc_state.c | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/gen6_blorp.cpp | 3 |
2 files changed, 6 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 3c01dca114..faa3256931 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -605,6 +605,7 @@ brw_emit_depth_stencil_hiz(struct brw_context *brw, uint32_t surftype; unsigned int depth = 1; GLenum gl_target = GL_TEXTURE_2D; + unsigned int lod; const struct intel_renderbuffer *irb = NULL; const struct gl_renderbuffer *rb = NULL; @@ -655,6 +656,8 @@ brw_emit_depth_stencil_hiz(struct brw_context *brw, break; } + lod = irb ? irb->mt_level - irb->mt->first_level : 0; + unsigned int len; if (brw->gen >= 6) len = 7; diff --git a/src/mesa/drivers/dri/i965/gen6_blorp.cpp b/src/mesa/drivers/dri/i965/gen6_blorp.cpp index adc950053e..6b0e1eb5f9 100644 --- a/src/mesa/drivers/dri/i965/gen6_blorp.cpp +++ b/src/mesa/drivers/dri/i965/gen6_blorp.cpp @@ -795,6 +795,7 @@ gen6_blorp_emit_depth_stencil_config(struct brw_context *brw, uint32_t surftype; unsigned int depth = MAX2(params->depth.mt->logical_depth0, 1); GLenum gl_target = params->depth.mt->target; + unsigned int lod; switch (gl_target) { case GL_TEXTURE_CUBE_MAP_ARRAY: @@ -818,6 +819,8 @@ gen6_blorp_emit_depth_stencil_config(struct brw_context *brw, NULL, &tile_mask_x, &tile_mask_y); + lod = params->depth.level - params->depth.mt->first_level; + /* 3DSTATE_DEPTH_BUFFER */ { uint32_t tile_x = draw_x & tile_mask_x; |