summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
diff options
context:
space:
mode:
authorNanley Chery <nanley.g.chery@intel.com>2018-06-08 17:50:39 -0700
committerNanley Chery <nanley.g.chery@intel.com>2018-07-13 08:36:19 -0700
commit74cf188985f4556a998570ac97b637c0c553d3c6 (patch)
tree72b811b26b291aa3f33b3f81eea2310029f780d4 /src/mesa/drivers/dri/i965/intel_mipmap_tree.c
parentffac81fa5c26d1c1a42f52d3f938ba5edd48cf53 (diff)
i965/miptree: Init r8stencil_needs_update to false
The current behavior masked two bugs where the flag was not set to true after modifying the stencil texture. One case was a regression introduced with commit bdbb527a65fc729e7a9319ae67de60d03d06c3fd and another was a bug in the depthstencil mapping code. These have since been fixed. To prevent such bugs from being masked in the future, initialize r8stencil_needs_update to false. v2: Keep the delayed allocation. Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_mipmap_tree.c')
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 820c1d85934..b537e2bf4fd 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -668,8 +668,6 @@ make_separate_stencil_surface(struct brw_context *brw,
if (!mt->stencil_mt)
return false;
- mt->stencil_mt->r8stencil_needs_update = true;
-
return true;
}
@@ -2933,7 +2931,7 @@ intel_update_r8stencil(struct brw_context *brw,
assert(devinfo->gen >= 7);
struct intel_mipmap_tree *src =
mt->format == MESA_FORMAT_S_UINT8 ? mt : mt->stencil_mt;
- if (!src || devinfo->gen >= 8 || !src->r8stencil_needs_update)
+ if (!src || devinfo->gen >= 8)
return;
assert(src->surf.size > 0);
@@ -2957,6 +2955,9 @@ intel_update_r8stencil(struct brw_context *brw,
assert(mt->r8stencil_mt);
}
+ if (src->r8stencil_needs_update == false)
+ return;
+
struct intel_mipmap_tree *dst = mt->r8stencil_mt;
for (int level = src->first_level; level <= src->last_level; level++) {