Zebediah Figura (@zfigura) commented about libs/vkd3d-shader/hlsl_sm4.c:
if (profile->major_version >= 5) { - put_u32(&buffer, 0); /* texture start */ - put_u32(&buffer, 0); /* texture count */ - put_u32(&buffer, 0); /* sampler start */ - put_u32(&buffer, 0); /* sampler count */ + unsigned int tex_alloc = !!var->regs[HLSL_REGSET_TEXTURES].allocated; + unsigned int sam_alloc = !!var->regs[HLSL_REGSET_SAMPLERS].allocated; + + put_u32(&buffer, tex_alloc * var->regs[HLSL_REGSET_TEXTURES].id); + put_u32(&buffer, tex_alloc * var->regs[HLSL_REGSET_TEXTURES].count); + put_u32(&buffer, sam_alloc * var->regs[HLSL_REGSET_SAMPLERS].id); + put_u32(&buffer, sam_alloc * var->regs[HLSL_REGSET_SAMPLERS].count);
Why do we need to check "allocated" here? Even with the hacks in 1/8 I don't think it should be necessary, should it? -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/159#note_29997