From 48a2207511a9579f7aa485694694af735a57d582 Mon Sep 17 00:00:00 2001 From: Feifan He Date: Wed, 9 Oct 2024 16:45:05 +0800 Subject: [PATCH] vkd3d-shader/msl: Implement support for VKD3DSPR_INPUT registers. --- libs/vkd3d-shader/msl.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libs/vkd3d-shader/msl.c b/libs/vkd3d-shader/msl.c index 2910d1e8..8640822c 100644 --- a/libs/vkd3d-shader/msl.c +++ b/libs/vkd3d-shader/msl.c @@ -112,6 +112,25 @@ static void msl_print_register_name(struct vkd3d_string_buffer *buffer, msl_print_register_datatype(buffer, gen, reg->data_type); break; + case VKD3DSPR_INPUT: + if (reg->idx_count != 1) + { + msl_compiler_error(gen, VKD3D_SHADER_ERROR_MSL_INTERNAL, + "Internal compiler error: Unhandled input register index count %u.", reg->idx_count); + vkd3d_string_buffer_printf(buffer, "", reg->type); + break; + } + if (reg->idx[0].rel_addr) + { + msl_compiler_error(gen, VKD3D_SHADER_ERROR_MSL_INTERNAL, + "Internal compiler error: Unhandled input register indirect addressing."); + vkd3d_string_buffer_printf(buffer, "", reg->type); + break; + } + vkd3d_string_buffer_printf(buffer, "v[%u]", reg->idx[0].offset); + msl_print_register_datatype(buffer, gen, reg->data_type); + break; + case VKD3DSPR_CONSTBUFFER: if (reg->idx_count != 3) {