Mesa (main): microsoft/compiler: Set typed_uav_load_additional_formats when appropriate

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 14 23:17:13 UTC 2022


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

Author: Boris Brezillon <boris.brezillon at collabora.com>
Date:   Fri Apr 22 14:54:55 2022 +0200

microsoft/compiler: Set typed_uav_load_additional_formats when appropriate

This flag should be set to true when the RWTexture is attached a vector,
and we always declare a vec4 right now, so it should always be true.
Might be worth reworking the dxil_module_get_res_type() to use a scalar
when the image only has one component.

Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16926>

---

 src/microsoft/compiler/nir_to_dxil.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/microsoft/compiler/nir_to_dxil.c b/src/microsoft/compiler/nir_to_dxil.c
index 3eb4a595361..bdca79bf9ec 100644
--- a/src/microsoft/compiler/nir_to_dxil.c
+++ b/src/microsoft/compiler/nir_to_dxil.c
@@ -3670,8 +3670,12 @@ emit_image_load(struct ntd_context *ctx, nir_intrinsic_instr *intr)
       store_dest(ctx, &intr->dest, i, component, out_type);
    }
 
-   if (num_components > 1)
-      ctx->mod.feats.typed_uav_load_additional_formats = true;
+   /* FIXME: This flag should be set to true when the RWTexture is attached
+    * a vector, and we always declare a vec4 right now, so it should always be
+    * true. Might be worth reworking the dxil_module_get_res_type() to use a
+    * scalar when the image only has one component.
+    */
+   ctx->mod.feats.typed_uav_load_additional_formats = true;
 
    return true;
 }



More information about the mesa-commit mailing list