vkd3d-shader/hlsl: Don't allocate all texture registers for synthetic separated samplers.

This commit is contained in:
Francisco Casas 2022-12-01 20:17:08 -03:00 committed by Alexandre Julliard
parent a55973d695
commit 3bafd036bb
Notes: Alexandre Julliard 2023-07-17 23:25:21 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/209

View File

@ -3277,9 +3277,12 @@ static void calculate_resource_register_counts(struct hlsl_ctx *ctx)
{
for (i = 0; i < type->reg_size[k]; ++i)
{
/* Samplers are only allocated until the last used one. */
bool is_separated = var->is_separated_resource;
/* Samplers (and textures separated from them) are only allocated until the last
* used one. */
if (var->objects_usage[k][i].used)
var->regs[k].bind_count = (k == HLSL_REGSET_SAMPLERS) ? i + 1 : type->reg_size[k];
var->regs[k].bind_count = (k == HLSL_REGSET_SAMPLERS || is_separated) ? i + 1 : type->reg_size[k];
}
}
}