vkd3d-shader/hlsl: Don't report a register type mismatch for unused reserved variables.

This commit is contained in:
Nikolay Sivov 2023-06-21 12:28:44 -05:00 committed by Alexandre Julliard
parent d6ac823dd6
commit c8ffe8e1a8
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
2 changed files with 6 additions and 6 deletions

View File

@ -2698,7 +2698,7 @@ static void allocate_register_reservations(struct hlsl_ctx *ctx)
continue;
regset = hlsl_type_get_regset(var->data_type);
if (var->reg_reservation.reg_type)
if (var->reg_reservation.reg_type && var->regs[regset].bind_count)
{
if (var->reg_reservation.reg_type != get_regset_name(regset))
{
@ -2710,7 +2710,7 @@ static void allocate_register_reservations(struct hlsl_ctx *ctx)
type_string->buffer, get_regset_name(regset));
hlsl_release_string_buffer(ctx, type_string);
}
else if (var->regs[regset].bind_count)
else
{
var->regs[regset].allocated = true;
var->regs[regset].id = var->reg_reservation.reg_index;

View File

@ -70,7 +70,7 @@ probe all rgba (1.0, 1.0, 1.0, 99.0)
% Register reservation with incorrect register type.
[pixel shader todo]
[pixel shader]
Texture2D unused : register(s0);
Texture2D tex;
@ -80,12 +80,12 @@ float4 main() : sv_target
}
[test]
todo draw quad
draw quad
probe all rgba (0.0, 0.0, 0.0, 99.0)
% Register reservation with incorrect register type.
[pixel shader todo]
[pixel shader]
sampler2D unused : register(t0);
Texture2D tex;
@ -96,7 +96,7 @@ float4 main() : sv_target
[test]
todo draw quad
draw quad
probe all rgba (0.0, 0.0, 0.0, 99.0)
[pixel shader]