mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/hlsl: Handle reserved vars specially in get_allocated_object().
This commit is contained in:
parent
883ab880e3
commit
1c1f1094a5
Notes:
Alexandre Julliard
2023-06-22 22:04:01 +02:00
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/244
@ -3626,11 +3626,23 @@ static const struct hlsl_ir_var *get_allocated_object(struct hlsl_ctx *ctx, enum
|
||||
|
||||
LIST_FOR_EACH_ENTRY(var, &ctx->extern_vars, const struct hlsl_ir_var, extern_entry)
|
||||
{
|
||||
if (!var->regs[regset].allocated)
|
||||
continue;
|
||||
|
||||
if (var->reg_reservation.reg_type == get_regset_name(regset)
|
||||
&& var->data_type->reg_size[regset])
|
||||
{
|
||||
/* Vars with a reservation prevent non-reserved vars from being
|
||||
* bound there even if the reserved vars aren't used. */
|
||||
start = var->reg_reservation.reg_index;
|
||||
count = var->data_type->reg_size[regset];
|
||||
}
|
||||
else if (var->regs[regset].allocated)
|
||||
{
|
||||
start = var->regs[regset].id;
|
||||
count = var->regs[regset].bind_count;
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (start <= index && index < start + count)
|
||||
return var;
|
||||
|
Loading…
Reference in New Issue
Block a user