microsoft/spirv_to_dxil: Add drive_location assignment
authorEnrico Galli <enrico.galli@intel.com>
Tue, 25 May 2021 21:41:33 +0000 (14:41 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 24 Jun 2021 20:05:13 +0000 (20:05 +0000)
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10989>

src/microsoft/spirv_to_dxil/spirv_to_dxil.c

index c5462dd..e1a5fd5 100644 (file)
@@ -131,6 +131,16 @@ spirv_to_dxil(const uint32_t *words, size_t word_count,
 
    nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));
 
+   nir->info.inputs_read =
+      dxil_reassign_driver_locations(nir, nir_var_shader_in, 0);
+
+   if (stage != MESA_SHADER_FRAGMENT) {
+      nir->info.outputs_written =
+         dxil_reassign_driver_locations(nir, nir_var_shader_out, 0);
+   } else {
+      dxil_sort_ps_outputs(nir);
+   }
+
    struct nir_to_dxil_options opts = {.vulkan_environment = true};
 
    struct blob dxil_blob;