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-06-12 10:55:36 -0700
commit7df267f2afb8684e0f382b3dfe7bdc45fddcbd63 (patch)
tree3ab4beb0ee6d63760d7fe6485a283dd1f666de7a
parent9a4b38b56e255ae5a9856786727a6ae0ed255613 (diff)
i965/gen6: Force array_spacing_lod0 for stencil/hizgen6-layered-6
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 118e989376..5d5089bda7 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -368,6 +368,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,
@@ -379,7 +380,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;
@@ -1394,6 +1395,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,
@@ -1405,7 +1407,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;