Mesa (master): anv: Enable MSAA fast-clears
Jason Ekstrand
jekstrand at kemper.freedesktop.org
Thu Mar 1 22:08:27 UTC 2018
Module: Mesa
Branch: master
Commit: 89f78cf333a06384728627e9755d1a9b2e3370d7
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=89f78cf333a06384728627e9755d1a9b2e3370d7
Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date: Fri Feb 23 21:12:50 2018 -0800
anv: Enable MSAA fast-clears
This speeds up the Sascha Willems multisampling demo by around 25% when
using 8x or 16x MSAA.
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
---
src/intel/vulkan/anv_image.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index a2bae7b382..922c46936a 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -952,8 +952,10 @@ anv_layout_to_fast_clear_type(const struct gen_device_info * const devinfo,
assert(image->aspects & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV);
- /* Multisample fast-clear is not yet supported. */
- if (image->samples > 1)
+ /* We don't support MSAA fast-clears on Ivybridge or Bay Trail because they
+ * lack the MI ALU which we need to determine the predicates.
+ */
+ if (devinfo->gen == 7 && !devinfo->is_haswell && image->samples > 1)
return ANV_FAST_CLEAR_NONE;
switch (layout) {
@@ -964,12 +966,13 @@ anv_layout_to_fast_clear_type(const struct gen_device_info * const devinfo,
return ANV_FAST_CLEAR_NONE;
default:
- /* If the image has CCS_E enabled all the time then we can use
+ /* If the image has MCS or CCS_E enabled all the time then we can use
* fast-clear as long as the clear color is the default value of zero
* since this is the default value we program into every surface state
* used for texturing.
*/
- if (image->planes[plane].aux_usage == ISL_AUX_USAGE_CCS_E)
+ if (image->planes[plane].aux_usage == ISL_AUX_USAGE_MCS ||
+ image->planes[plane].aux_usage == ISL_AUX_USAGE_CCS_E)
return ANV_FAST_CLEAR_DEFAULT_VALUE;
else
return ANV_FAST_CLEAR_NONE;
More information about the mesa-commit
mailing list