summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2014-05-28 10:44:13 -0700
committerJordan Justen <jordan.l.justen@intel.com>2014-05-28 19:27:04 -0700
commit029f10c486ad27b85ec0dcd1eb30fc64bd0ad294 (patch)
treea2f4bf071f98d5c3a804ab171b183de1b0196b71
parent0f79dd8fa7f0cc3e1f0f8848d4c735fb80f9961d (diff)
i965/gen6: Force array_spacing_lod0 for stencil/hizgen6-layered-5
gen6 stencil only supports LOD0 for stencil, forcing us to use an array_spacing_lod0 type of miptree layout. We use a combination of array_spacing_lod0 and a regular miptree in that all slices of a particular LOD are combined without spacing for additional LODs. This allows the surface to be set up like the hardware expects, and also tries to minimize the overall texture size. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 2d4224cb71..aff00b097a 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -367,6 +367,7 @@ intel_miptree_create_layout(struct brw_context *brw,
_mesa_get_format_base_format(format) == GL_DEPTH_STENCIL &&
(brw->must_use_separate_stencil ||
(brw->has_separate_stencil && brw_is_hiz_depth_format(brw, format)))) {
+ bool separate_lods = brw->gen == 6;
mt->stencil_mt = intel_miptree_create(brw,
mt->target,
MESA_FORMAT_S_UINT8,
@@ -378,7 +379,7 @@ intel_miptree_create_layout(struct brw_context *brw,
true,
num_samples,
INTEL_MIPTREE_TILING_ANY,
- false);
+ separate_lods);
if (!mt->stencil_mt) {
intel_miptree_release(&mt);
return NULL;
@@ -1393,6 +1394,7 @@ intel_miptree_alloc_hiz(struct brw_context *brw,
struct intel_mipmap_tree *mt)
{
assert(mt->hiz_mt == NULL);
+ bool separate_lods = brw->gen == 6;
mt->hiz_mt = intel_miptree_create(brw,
mt->target,
mt->format,
@@ -1404,7 +1406,7 @@ intel_miptree_alloc_hiz(struct brw_context *brw,
true,
mt->num_samples,
INTEL_MIPTREE_TILING_ANY,
- false);
+ separate_lods);
if (!mt->hiz_mt)
return false;