vkd3d-shader/ir: Require default swizzles on vec4 immediate constants.

The SPIR-V, GLSL and MSL backends implicitly handle swizzles on
immediate constants, but the TPF and d3d-asm backends assume a default
swizzle. In principle there's no reason those couldn't support swizzles
on immediate constants, but they're a little pointless.
This commit is contained in:
Henri Verbeet
2025-09-04 22:31:45 +02:00
parent a1451f8113
commit 47f2ec1a08
Notes: Henri Verbeet 2025-09-18 11:44:36 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1734
3 changed files with 24 additions and 2 deletions

View File

@@ -3483,7 +3483,9 @@ static uint32_t sm4_encode_register(const struct tpf_compiler *tpf, const struct
switch (sm4_swizzle_type)
{
case VKD3D_SM4_SWIZZLE_NONE:
VKD3D_ASSERT(sm4_swizzle || register_is_constant(reg));
if (register_is_constant(reg))
break;
VKD3D_ASSERT(sm4_swizzle);
token |= (sm4_swizzle << VKD3D_SM4_WRITEMASK_SHIFT) & VKD3D_SM4_WRITEMASK_MASK;
break;