From b7314e2438aaf58661ac6333270a076c4010a7e1 Mon Sep 17 00:00:00 2001 From: Feifan He Date: Mon, 30 Sep 2024 12:25:53 +0800 Subject: [PATCH] vkd3d-shader/msl: Handle signature element masks in the prologue and epilogue. --- libs/vkd3d-shader/msl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/msl.c b/libs/vkd3d-shader/msl.c index 5b162446..bfc01395 100644 --- a/libs/vkd3d-shader/msl.c +++ b/libs/vkd3d-shader/msl.c @@ -482,7 +482,9 @@ static void msl_generate_entrypoint_prologue(struct msl_generator *gen) if (e->sysval_semantic == VKD3D_SHADER_SV_NONE) { msl_print_register_datatype(buffer, gen, vkd3d_data_type_from_component_type(e->component_type)); + msl_print_write_mask(buffer, e->mask); vkd3d_string_buffer_printf(buffer, " = input.shader_in_%u", i); + msl_print_write_mask(buffer, e->mask); } else { @@ -513,8 +515,11 @@ static void msl_generate_entrypoint_epilogue(struct msl_generator *gen) case VKD3D_SHADER_SV_NONE: case VKD3D_SHADER_SV_TARGET: case VKD3D_SHADER_SV_POSITION: - vkd3d_string_buffer_printf(buffer, " output.shader_out_%u = %s_out", i, gen->prefix); + vkd3d_string_buffer_printf(buffer, " output.shader_out_%u", i); + msl_print_write_mask(buffer, e->mask); + vkd3d_string_buffer_printf(buffer, " = %s_out", gen->prefix); msl_print_register_datatype(buffer, gen, vkd3d_data_type_from_component_type(e->component_type)); + msl_print_write_mask(buffer, e->mask); break; default: vkd3d_string_buffer_printf(buffer, " ", e->sysval_semantic);