microsoft/spirv_to_dxil: Support doubles
authorJesse Natalie <jenatali@microsoft.com>
Tue, 6 Apr 2021 17:47:34 +0000 (10:47 -0700)
committerMarge Bot <eric+marge@anholt.net>
Fri, 9 Apr 2021 01:54:33 +0000 (01:54 +0000)
First, we need to lower alu to scalar so that all alu ops on doubles
only take one input. Then, we can use our new double lowering pass.

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Reviewed-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10063>

src/microsoft/spirv_to_dxil/spirv_to_dxil.c

index faf8bac..01a9d86 100644 (file)
@@ -87,6 +87,10 @@ spirv_to_dxil(const uint32_t *words, size_t word_count,
    NIR_PASS_V(nir, nir_lower_var_copies);
    NIR_PASS_V(nir, nir_lower_io_arrays_to_elements_no_indirects, false);
 
+   NIR_PASS_V(nir, nir_lower_alu_to_scalar, NULL, NULL);
+   NIR_PASS_V(nir, nir_opt_dce);
+   NIR_PASS_V(nir, dxil_nir_lower_double_math);
+
    {
       bool progress;
       do