broadcom/compiler: don't apply robust buffer access to shared variables

This feature is only concerned with buffers bound through a descriptor
set. We are still keeping the code for this (disabled by default) since
it may be useful for debugging some scenarios.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18744>
This commit is contained in:
Iago Toral Quiroga 2022-09-22 08:41:50 +02:00 committed by Marge Bot
parent 44b02b5cb1
commit 4ea916f704

View file

@ -24,6 +24,12 @@
#include "compiler/v3d_compiler.h"
#include "compiler/nir/nir_builder.h"
/* Vulkan's robustBufferAccess feature is only concerned with buffers that are
* bound through descriptor sets, so shared memory is not included, but it may
* be useful to enable this for debugging.
*/
const bool robust_shared_enabled = false;
static void
rewrite_offset(nir_builder *b,
nir_intrinsic_instr *instr,
@ -172,8 +178,11 @@ lower_instr(nir_builder *b, nir_instr *instr, void *_state)
case nir_intrinsic_shared_atomic_xor:
case nir_intrinsic_shared_atomic_exchange:
case nir_intrinsic_shared_atomic_comp_swap:
lower_shared(c, b, intr);
return true;
if (robust_shared_enabled) {
lower_shared(c, b, intr);
return true;
}
return false;
default:
return false;
}