diff options
author | Nanley Chery <nanley.g.chery@intel.com> | 2022-11-30 15:57:16 -0800 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2022-12-06 00:49:17 +0000 |
commit | 5c84b318916c114712b28b6211e4de712ef51ca7 (patch) | |
tree | 13d24f4ab164f28ad83c2be3ff3dd0da8b4a5591 /src/intel | |
parent | 822687f4c06fd178a64295d45780bdc962b2939c (diff) |
anv: Move aux vars up in transition_color_buffer
I'd like to reuse one of them for an assert.
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20118>
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/vulkan/genX_cmd_buffer.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index f717d976476..7de8ae039d3 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -1064,6 +1064,28 @@ transition_color_buffer(struct anv_cmd_buffer *cmd_buffer, if (base_layer >= anv_image_aux_layers(image, aspect, base_level)) return; + enum isl_aux_usage initial_aux_usage = + 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; + } + assert(image->planes[plane].primary_surface.isl.tiling != ISL_TILING_LINEAR); /* The following layouts are equivalent for non-linear images. */ @@ -1228,28 +1250,6 @@ transition_color_buffer(struct anv_cmd_buffer *cmd_buffer, return; } - enum isl_aux_usage initial_aux_usage = - 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. * We can handle transitions between CCS_D/E to and from NONE. What we * don't yet handle is switching between CCS_E and CCS_D within a given |