summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2016-07-22 18:16:45 -0700
committerFrancisco Jerez <[email protected]>2016-08-25 18:36:07 -0700
commit071665c16191e3738f4ee173398da45c008e005a (patch)
tree2bc91dd53626d98523cfabd3cc2e41685e8a53c4 /src/mesa/drivers/dri/i965
parentf24e393bd5caee85994b00b93f141e6c4b99e273 (diff)
i965: Return whether the miptree was resolved from intel_miptree_resolve_color().
This will allow optimizing out the cache flush in some cases when resolving wasn't necessary. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c12
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.h2
2 files changed, 9 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 0836b92f983..24355c5e4f9 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -2133,7 +2133,7 @@ intel_miptree_all_slices_resolve_depth(struct brw_context *brw,
}
-void
+bool
intel_miptree_resolve_color(struct brw_context *brw,
struct intel_mipmap_tree *mt,
int flags)
@@ -2144,21 +2144,25 @@ intel_miptree_resolve_color(struct brw_context *brw,
*/
if ((flags & INTEL_MIPTREE_IGNORE_CCS_E) &&
intel_miptree_is_lossless_compressed(brw, mt))
- return;
+ return false;
switch (mt->fast_clear_state) {
case INTEL_FAST_CLEAR_STATE_NO_MCS:
case INTEL_FAST_CLEAR_STATE_RESOLVED:
/* No resolve needed */
- break;
+ return false;
case INTEL_FAST_CLEAR_STATE_UNRESOLVED:
case INTEL_FAST_CLEAR_STATE_CLEAR:
/* Fast color clear resolves only make sense for non-MSAA buffers. */
if (mt->msaa_layout == INTEL_MSAA_LAYOUT_NONE ||
intel_miptree_is_lossless_compressed(brw, mt)) {
brw_blorp_resolve_color(brw, mt);
+ return true;
+ } else {
+ return false;
}
- break;
+ default:
+ unreachable("Invalid fast clear state");
}
}
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
index c28fb3364f6..94bf6648d36 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
@@ -941,7 +941,7 @@ intel_miptree_used_for_rendering(struct intel_mipmap_tree *mt)
*/
#define INTEL_MIPTREE_IGNORE_CCS_E (1 << 0)
-void
+bool
intel_miptree_resolve_color(struct brw_context *brw,
struct intel_mipmap_tree *mt,
int flags);