spirv2dxil: Mark SSBO reads for bindless as CAN_REORDER
authorJesse Natalie <jenatali@microsoft.com>
Mon, 1 May 2023 20:07:01 +0000 (13:07 -0700)
committerMarge Bot <emma+marge@anholt.net>
Mon, 1 May 2023 21:12:43 +0000 (21:12 +0000)
This makes it so that they can be CSE'd, which helps prevent redundant
reads of the same data.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22786>

src/microsoft/spirv_to_dxil/dxil_spirv_nir_lower_bindless.c

index b6ccfff..6dda984 100644 (file)
@@ -57,7 +57,8 @@ load_vulkan_ssbo(nir_builder *b, unsigned buf_idx,
                         nir_channel(b, descriptor, 0),
                         offset,
                         .align_mul = num_comps * 4,
-                        .align_offset = 0);
+                        .align_offset = 0,
+                        .access = ACCESS_NON_WRITEABLE | ACCESS_CAN_REORDER);
 }
 
 static nir_ssa_def *