vkd3d-shader/msl: Implement support for VKD3DSPR_CONSTBUFFER registers.

This commit is contained in:
Feifan He 2024-10-09 16:41:52 +08:00 committed by Henri Verbeet
parent 2d7832e738
commit 75e0cde045
Notes: Henri Verbeet 2024-10-10 20:08:53 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1164

View File

@ -111,6 +111,26 @@ static void msl_print_register_name(struct vkd3d_string_buffer *buffer,
vkd3d_string_buffer_printf(buffer, "r[%u]", reg->idx[0].offset); vkd3d_string_buffer_printf(buffer, "r[%u]", reg->idx[0].offset);
msl_print_register_datatype(buffer, gen, reg->data_type); msl_print_register_datatype(buffer, gen, reg->data_type);
break; break;
case VKD3DSPR_CONSTBUFFER:
if (reg->idx_count != 3)
{
msl_compiler_error(gen, VKD3D_SHADER_ERROR_MSL_INTERNAL,
"Internal compiler error: Unhandled constant buffer register index count %u.", reg->idx_count);
vkd3d_string_buffer_printf(buffer, "<unhandled register %#x>", reg->type);
break;
}
if (reg->idx[0].rel_addr || reg->idx[2].rel_addr)
{
msl_compiler_error(gen, VKD3D_SHADER_ERROR_MSL_INTERNAL,
"Internal compiler error: Unhandled constant buffer register indirect addressing.");
vkd3d_string_buffer_printf(buffer, "<unhandled register %#x>", reg->type);
break;
}
vkd3d_string_buffer_printf(buffer, "descriptors.cb_%u[%u]", reg->idx[0].offset, reg->idx[2].offset);
msl_print_register_datatype(buffer, gen, reg->data_type);
break;
default: default:
msl_compiler_error(gen, VKD3D_SHADER_ERROR_MSL_INTERNAL, msl_compiler_error(gen, VKD3D_SHADER_ERROR_MSL_INTERNAL,
"Internal compiler error: Unhandled register type %#x.", reg->type); "Internal compiler error: Unhandled register type %#x.", reg->type);