Mesa (main): microsoft/compiler: Correctly flag when using raw buffers

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 29 02:10:41 UTC 2021


Module: Mesa
Branch: main
Commit: fec1a04c53df17a8a55a2a66cf4958be0748c407
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fec1a04c53df17a8a55a2a66cf4958be0748c407

Author: Enrico Galli <enrico.galli at intel.com>
Date:   Wed Jul 28 17:05:26 2021 -0700

microsoft/compiler: Correctly flag when using raw buffers

Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12119>

---

 src/microsoft/compiler/nir_to_dxil.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/microsoft/compiler/nir_to_dxil.c b/src/microsoft/compiler/nir_to_dxil.c
index d0bc4b9db26..a19f4f8a16f 100644
--- a/src/microsoft/compiler/nir_to_dxil.c
+++ b/src/microsoft/compiler/nir_to_dxil.c
@@ -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) {



More information about the mesa-commit mailing list