[Mesa-dev] [PATCH 12/12] i965/gen7: Enable support for fast color clears.
Paul Berry
stereotype441 at gmail.com
Tue May 21 16:52:16 PDT 2013
This patch adds code to place mcs_state into INTEL_MCS_STATE_RESOLVED
for miptrees that are capable of supporting fast color clears. This
will have no effect on buffers that don't undergo a fast color clear;
however, for buffers that do undergo a fast color clear, an MCS
miptree will be allocated (at the time of the first fast clear), and
will be used thereafter.
---
src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 7a3c135..5b9771f 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -602,6 +602,16 @@ intel_miptree_create(struct intel_context *intel,
return NULL;
}
+#ifndef I915
+ /* If this miptree is capable of supporting fast color clears, set
+ * mcs_state appropriately to ensure that fast clears will occur.
+ * Allocation of the MCS miptree will be deferred until the first fast
+ * clear actually occurs.
+ */
+ if (intel_is_non_msrt_mcs_buffer_supported(intel, mt))
+ mt->mcs_state = INTEL_MCS_STATE_RESOLVED;
+#endif
+
return mt;
}
@@ -657,6 +667,16 @@ intel_miptree_create_for_dri2_buffer(struct intel_context *intel,
if (!singlesample_mt)
return NULL;
+#ifndef I915
+ /* If this miptree is capable of supporting fast color clears, set
+ * mcs_state appropriately to ensure that fast clears will occur.
+ * Allocation of the MCS miptree will be deferred until the first fast
+ * clear actually occurs.
+ */
+ if (intel_is_non_msrt_mcs_buffer_supported(intel, singlesample_mt))
+ singlesample_mt->mcs_state = INTEL_MCS_STATE_RESOLVED;
+#endif
+
if (num_samples == 0)
return singlesample_mt;
--
1.8.2.3
More information about the mesa-dev
mailing list