summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>2022-02-20 00:00:48 +0200
committerMarge Bot <emma+marge@anholt.net>2022-03-01 17:37:13 +0000
commit214092da879252c3935eaee47b0b2ac42b682268 (patch)
treecbcb61ec3ab1b32c418b42e566fc4dd4664186cf
parent02fab4cf9e3a7fd824dc2fc99e5b1abea02ec8ce (diff)
anv: fix fast clear type value with external images
Disable fast clear if not supported by the external modifier. v2: Set fast_clear value to NONE in case of import/export from/to external v3: Move logic next to existing acquire/release checks (Nanley) Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6056 Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15096>
-rw-r--r--src/intel/vulkan/genX_cmd_buffer.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index d48fa8f7fd9..6a9cac486d9 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -1423,14 +1423,22 @@ transition_color_buffer(struct anv_cmd_buffer *cmd_buffer,
anv_layout_to_aux_usage(devinfo, image, aspect, 0, initial_layout);
enum isl_aux_usage final_aux_usage =
anv_layout_to_aux_usage(devinfo, image, aspect, 0, final_layout);
+ enum anv_fast_clear_type initial_fast_clear =
+ anv_layout_to_fast_clear_type(devinfo, image, aspect, initial_layout);
+ enum anv_fast_clear_type final_fast_clear =
+ anv_layout_to_fast_clear_type(devinfo, image, aspect, final_layout);
/* We must override the anv_layout_to_* functions because they are unaware of
* acquire/release direction.
*/
if (private_binding_acquire) {
initial_aux_usage = isl_mod_info->aux_usage;
+ initial_fast_clear = isl_mod_info->supports_clear_color ?
+ initial_fast_clear : ANV_FAST_CLEAR_NONE;
} else if (private_binding_release) {
final_aux_usage = isl_mod_info->aux_usage;
+ final_fast_clear = isl_mod_info->supports_clear_color ?
+ final_fast_clear : ANV_FAST_CLEAR_NONE;
}
/* The current code assumes that there is no mixing of CCS_E and CCS_D.
@@ -1453,10 +1461,6 @@ transition_color_buffer(struct anv_cmd_buffer *cmd_buffer,
/* If the initial layout supports more fast clear than the final layout
* then we need at least a partial resolve.
*/
- const enum anv_fast_clear_type initial_fast_clear =
- anv_layout_to_fast_clear_type(devinfo, image, aspect, initial_layout);
- const enum anv_fast_clear_type final_fast_clear =
- anv_layout_to_fast_clear_type(devinfo, image, aspect, final_layout);
if (final_fast_clear < initial_fast_clear)
resolve_op = ISL_AUX_OP_PARTIAL_RESOLVE;