microsoft/compiler: Correctly flag when using raw buffers
authorEnrico Galli <enrico.galli@intel.com>
Thu, 29 Jul 2021 00:05:26 +0000 (17:05 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 29 Jul 2021 01:44:45 +0000 (01:44 +0000)
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12119>

src/microsoft/compiler/nir_to_dxil.c

index d0bc4b9..a19f4f8 100644 (file)
@@ -4396,6 +4396,7 @@ emit_module(struct ntd_context *ctx, const struct nir_to_dxil_options *opts)
          return false;
    } else {
       /* Handle read/write SSBOs as UAVs */
+      int uav_count = 0;
       nir_foreach_variable_with_modes(var, ctx->shader, nir_var_mem_ssbo) {
          if ((var->data.access & ACCESS_NON_WRITEABLE) == 0) {
             unsigned count = 1;
@@ -4405,8 +4406,12 @@ emit_module(struct ntd_context *ctx, const struct nir_to_dxil_options *opts)
                         count, DXIL_COMP_TYPE_INVALID,
                         DXIL_RESOURCE_KIND_RAW_BUFFER, var->name))
                return false;
+            
+            ++uav_count;
          }
       }
+      if (uav_count > 0)
+         ctx->mod.raw_and_structured_buffers = true;
    }
 
    nir_foreach_variable_with_modes(var, ctx->shader, nir_var_uniform) {