panvk: Replace robust2_modes with robust_modes

There's no real difference for us between robustness and robustness2.
The only thing robust_modes does in nir_opt_load_store_vectorize() is to
tell it to be a bit more careful about integer overflow in address
calculations so you don't end up wrapping something around and getting a
non-zero load when you should have gotten an zero from OOB.  There's no
good reason why we should only set it for robustness2.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40576>
This commit is contained in:
Faith Ekstrand 2026-03-23 20:54:34 -04:00 committed by Marge Bot
parent fb7e1fe81c
commit 3c1a1d2006
3 changed files with 10 additions and 10 deletions

View file

@ -5726,7 +5726,7 @@ bifrost_optimize_nir(nir_shader *nir, unsigned gpu_id)
}
static void
bi_optimize_nir(nir_shader *nir, unsigned gpu_id, nir_variable_mode robust2_modes)
bi_optimize_nir(nir_shader *nir, unsigned gpu_id, nir_variable_mode robust_modes)
{
NIR_PASS(_, nir, nir_opt_shrink_stores, true);
bi_optimize_loop_nir(nir, gpu_id, false);
@ -5739,7 +5739,7 @@ bi_optimize_nir(nir_shader *nir, unsigned gpu_id, nir_variable_mode robust2_mode
nir_var_mem_ubo |
nir_var_shader_temp,
.callback = mem_vectorize_cb,
.robust_modes = robust2_modes,
.robust_modes = robust_modes,
};
NIR_PASS(_, nir, nir_opt_load_store_vectorize, &vectorize_opts);
@ -6963,7 +6963,7 @@ bifrost_compile_shader_nir(nir_shader *nir,
NIR_PASS(_, nir, pan_nir_lower_fs_outputs, skip_atest);
}
bi_optimize_nir(nir, inputs->gpu_id, inputs->robust2_modes);
bi_optimize_nir(nir, inputs->gpu_id, inputs->robust_modes);
{
bool scalar_phis_pass = false;

View file

@ -108,7 +108,7 @@ struct pan_compile_inputs {
bool no_idvs;
uint32_t view_mask;
nir_variable_mode robust2_modes;
nir_variable_mode robust_modes;
/* Whether or not descriptor accesses should add additional robustness
* checks. */
bool robust_descriptors;

View file

@ -1266,17 +1266,17 @@ panvk_compile_shader(struct panvk_device *dev,
if (shader == NULL)
return panvk_error(dev, VK_ERROR_OUT_OF_HOST_MEMORY);
nir_variable_mode robust2_modes = 0;
if (info->robustness->uniform_buffers == VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT)
robust2_modes |= nir_var_mem_ubo;
if (info->robustness->storage_buffers == VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT)
robust2_modes |= nir_var_mem_ssbo;
nir_variable_mode robust_modes = 0;
if (info->robustness->uniform_buffers != VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED_EXT)
robust_modes |= nir_var_mem_ubo;
if (info->robustness->storage_buffers != VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED_EXT)
robust_modes |= nir_var_mem_ssbo;
struct pan_compile_inputs inputs = {
.gpu_id = phys_dev->kmod.dev->props.gpu_id,
.gpu_variant = phys_dev->kmod.dev->props.gpu_variant,
.view_mask = (state && state->rp) ? state->mv->view_mask : 0,
.robust2_modes = robust2_modes,
.robust_modes = robust_modes,
.robust_descriptors = dev->vk.enabled_features.nullDescriptor,
};