vkd3d-shader/spirv: Use the register index count in I/O registers in vkd3d_symbol_make_register().

This commit is contained in:
Conor McCarthy 2023-05-26 16:39:49 +10:00 committed by Alexandre Julliard
parent 532fe01818
commit ec5f195b6b
Notes: Alexandre Julliard 2023-05-26 22:16:37 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/213

View File

@ -2060,11 +2060,8 @@ static void vkd3d_symbol_make_register(struct vkd3d_symbol *symbol,
if (vkd3d_shader_register_is_input(reg) || vkd3d_shader_register_is_output(reg)
|| vkd3d_shader_register_is_patch_constant(reg))
{
unsigned int i;
for (i = 2; i > 0; --i)
if (reg->idx[i].offset != ~0u)
break;
symbol->key.reg.idx = reg->idx[i].offset;
symbol->key.reg.idx = reg->idx_count ? reg->idx[reg->idx_count - 1].offset : ~0u;
assert(!reg->idx_count || symbol->key.reg.idx != ~0u);
}
else if (reg->type != VKD3DSPR_IMMCONSTBUFFER)
symbol->key.reg.idx = reg->idx[0].offset;