spirv2dxil: Only lower readonly images to SRVs when the option is set
authorJesse Natalie <jenatali@microsoft.com>
Wed, 15 Mar 2023 15:48:35 +0000 (08:48 -0700)
committerMarge Bot <emma+marge@anholt.net>
Thu, 23 Mar 2023 21:48:43 +0000 (21:48 +0000)
This handles the case where readonly is explicitly marked in the shader,
rather than just inferred based on opt_access.

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

src/microsoft/spirv_to_dxil/dxil_spirv_nir.c

index c0379b0..cc9c731 100644 (file)
@@ -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,