tu: Call nir_opt_access
authorConnor Abbott <cwabbott0@gmail.com>
Mon, 21 Feb 2022 18:24:39 +0000 (19:24 +0100)
committerMarge Bot <emma+marge@anholt.net>
Mon, 28 Feb 2022 23:33:22 +0000 (23:33 +0000)
This adds some small optimizations, and enables lowering to isam in more
cases where the app didn't specify readonly.

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

src/freedreno/vulkan/tu_shader.c

index e3e72f5..186e434 100644 (file)
@@ -715,6 +715,11 @@ tu_shader_create(struct tu_device *dev,
    if (!shader)
       return NULL;
 
+   NIR_PASS_V(nir, nir_opt_access, &(nir_opt_access_options) {
+               .is_vulkan = true,
+               .infer_non_readable = true,
+             });
+
    if (nir->info.stage == MESA_SHADER_FRAGMENT) {
       NIR_PASS_V(nir, nir_lower_input_attachments,
                  &(nir_input_attachment_options) {