From e0a090adfd7169a666805655ed2b7ab66710fdbe Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Wed, 15 Mar 2023 08:48:35 -0700 Subject: [PATCH] spirv2dxil: Only lower readonly images to SRVs when the option is set This handles the case where readonly is explicitly marked in the shader, rather than just inferred based on opt_access. Part-of: --- src/microsoft/spirv_to_dxil/dxil_spirv_nir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/microsoft/spirv_to_dxil/dxil_spirv_nir.c b/src/microsoft/spirv_to_dxil/dxil_spirv_nir.c index c0379b019c9..cc9c731d50e 100644 --- a/src/microsoft/spirv_to_dxil/dxil_spirv_nir.c +++ b/src/microsoft/spirv_to_dxil/dxil_spirv_nir.c @@ -1085,7 +1085,8 @@ dxil_spirv_nir_passes(nir_shader *nir, } while (progress); } - NIR_PASS_V(nir, nir_lower_readonly_images_to_tex, true); + if (conf->read_only_images_as_srvs) + NIR_PASS_V(nir, nir_lower_readonly_images_to_tex, true); nir_lower_tex_options lower_tex_options = { .lower_txp = UINT32_MAX, .lower_invalid_implicit_lod = true,