Mesa (main): microsoft/compiler: Add support for more scaled formats

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 14 18:18:56 UTC 2022


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

Author: Louis-Francis Ratté-Boulianne <lfrb at collabora.com>
Date:   Wed Apr 20 11:38:56 2022 -0400

microsoft/compiler: Add support for more scaled formats

Lower 8 and 16 bit scaled formats to integer formats.

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/15955>

---

 src/microsoft/compiler/dxil_nir_lower_vs_vertex_conversion.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/microsoft/compiler/dxil_nir_lower_vs_vertex_conversion.c b/src/microsoft/compiler/dxil_nir_lower_vs_vertex_conversion.c
index 6c14ae10404..711ad99ab6d 100644
--- a/src/microsoft/compiler/dxil_nir_lower_vs_vertex_conversion.c
+++ b/src/microsoft/compiler/dxil_nir_lower_vs_vertex_conversion.c
@@ -132,6 +132,12 @@ lower_vs_vertex_conversion_impl(nir_builder *b, nir_instr *instr, void *options)
          return from_10_10_10_2_scaled(b, src, lshift_rgba(b), nir_ushr);
       case PIPE_FORMAT_B10G10R10A2_USCALED:
          return from_10_10_10_2_scaled(b, src, lshift_bgra(b), nir_ushr);
+      case PIPE_FORMAT_R8G8B8A8_USCALED:
+      case PIPE_FORMAT_R16G16B16A16_USCALED:
+         return nir_u2f32(b, &intr->dest.ssa);
+      case PIPE_FORMAT_R8G8B8A8_SSCALED:
+      case PIPE_FORMAT_R16G16B16A16_SSCALED:
+         return nir_i2f32(b, &intr->dest.ssa);
 
       default:
          unreachable("Unsupported emulated vertex format");



More information about the mesa-commit mailing list