From 24d84e2ee233c904e7c4a0cc6e8431fd1f4808cb Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Thu, 16 Oct 2025 14:26:33 -0500 Subject: [PATCH] vkd3d-shader/spirv: Allow swizzling parameters. This was previously not a concern, since all of our parameter usage involved trivial swizzles and write masks, but bump parameters will not. --- libs/vkd3d-shader/spirv.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index d720e10ef..fcdaccec0 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -4752,8 +4752,14 @@ static uint32_t spirv_compiler_emit_load_reg(struct spirv_compiler *compiler, else if (reg->type == VKD3DSPR_UNDEF) return spirv_compiler_emit_load_undef(compiler, reg, write_mask); else if (reg->type == VKD3DSPR_PARAMETER) - return spirv_compiler_emit_shader_parameter(compiler, reg->idx[0].offset, + { + val_id = spirv_compiler_emit_shader_parameter(compiler, reg->idx[0].offset, reg->data_type, reg->dimension == VSIR_DIMENSION_VEC4 ? 4 : 1); + if (reg->dimension != VSIR_DIMENSION_VEC4) + return val_id; + return spirv_compiler_emit_swizzle(compiler, val_id, + VKD3DSP_WRITEMASK_ALL, reg->data_type, swizzle, write_mask); + } component_count = vsir_write_mask_component_count(write_mask);