aco: prevent invalid loads/stores vectorization if robustness is enabled
Only UBO, SSBO, global and push constants accesses should matter. This fixes a bunch of new robustness2 failures. Note that RADV/LLVM isn't affected because it relies on LLVM for loads/stores vectorization and LLVM doesn't vectorize in this situation as well. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4881>
This commit is contained in:
parent
04718a9cd6
commit
266978f7ca
|
@ -994,12 +994,20 @@ setup_nir(isel_context *ctx, nir_shader *nir)
|
|||
|
||||
bool lower_to_scalar = false;
|
||||
bool lower_pack = false;
|
||||
nir_variable_mode robust_modes = (nir_variable_mode)0;
|
||||
|
||||
if (ctx->options->robust_buffer_access) {
|
||||
robust_modes = (nir_variable_mode)(nir_var_mem_ubo |
|
||||
nir_var_mem_ssbo |
|
||||
nir_var_mem_global |
|
||||
nir_var_mem_push_const);
|
||||
}
|
||||
|
||||
if (nir_opt_load_store_vectorize(nir,
|
||||
(nir_variable_mode)(nir_var_mem_ssbo | nir_var_mem_ubo |
|
||||
nir_var_mem_push_const | nir_var_mem_shared |
|
||||
nir_var_mem_global),
|
||||
mem_vectorize_callback,
|
||||
(nir_variable_mode)0)) {
|
||||
mem_vectorize_callback, robust_modes)) {
|
||||
lower_to_scalar = true;
|
||||
lower_pack = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue