[Mesa-dev] [PATCH 3/9] i965/miptree: Track the staleness of the ASTC shadow

Nanley Chery nanleychery at gmail.com
Wed Sep 26 23:31:05 UTC 2018


Track whether or not the ASTC shadow miptree will need to be updated
prior to sampling.
---
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 5 ++++-
 src/mesa/drivers/dri/i965/intel_mipmap_tree.h | 6 ++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 5e99b563102..090e20e1d70 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -2451,8 +2451,11 @@ intel_miptree_finish_write(struct brw_context *brw,
 
    switch (mt->aux_usage) {
    case ISL_AUX_USAGE_NONE:
-      if (mt->format == MESA_FORMAT_S_UINT8 && devinfo->gen <= 7)
+      if (mt->format == MESA_FORMAT_S_UINT8 && devinfo->gen <= 7) {
          mt->shadow_needs_update = true;
+      } else if (intel_miptree_has_astc_shadow(mt)) {
+         mt->shadow_needs_update = true;
+      }
       break;
 
    case ISL_AUX_USAGE_MCS:
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
index b22514de386..3ae0117d68f 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
@@ -726,6 +726,12 @@ intel_miptree_blt_pitch(struct intel_mipmap_tree *mt)
    return pitch;
 }
 
+static inline bool
+intel_miptree_has_astc_shadow(const struct intel_mipmap_tree *mt)
+{
+   return _mesa_get_format_layout(mt->format) == MESA_FORMAT_LAYOUT_ASTC &&
+           mt->shadow_mt != NULL;
+}
 #ifdef __cplusplus
 }
 #endif
-- 
2.19.0



More information about the mesa-dev mailing list