diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 37afdc2d..765b1907 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -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; diff --git a/tests/register-reservations.shader_test b/tests/register-reservations.shader_test index 23d4ae5c..26f4381d 100644 --- a/tests/register-reservations.shader_test +++ b/tests/register-reservations.shader_test @@ -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]