From abbcf0461f86222062667cc34cb9d9fcac58209d Mon Sep 17 00:00:00 2001 From: Victor Chiletto Date: Wed, 3 Jul 2024 14:05:58 -0300 Subject: [PATCH] vkd3d-shader/hlsl: Reserve register slots for unused buffers. --- libs/vkd3d-shader/hlsl_codegen.c | 2 +- tests/hlsl/register-reservations-numeric.shader_test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 520ba20a..f2367dc5 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -4777,7 +4777,7 @@ static const struct hlsl_buffer *get_reserved_buffer(struct hlsl_ctx *ctx, uint3 LIST_FOR_EACH_ENTRY(buffer, &ctx->buffers, const struct hlsl_buffer, entry) { - if (buffer->used_size && buffer->reservation.reg_type == 'b' + if (buffer->reservation.reg_type == 'b' && buffer->reservation.reg_space == space && buffer->reservation.reg_index == index) return buffer; } diff --git a/tests/hlsl/register-reservations-numeric.shader_test b/tests/hlsl/register-reservations-numeric.shader_test index 1e977271..b03bf07d 100644 --- a/tests/hlsl/register-reservations-numeric.shader_test +++ b/tests/hlsl/register-reservations-numeric.shader_test @@ -717,7 +717,7 @@ float4 main(uniform float param) : sv_target return glob * param * a * b * c * d * e * f * g * h * i * j * k * l * m; } -[pixel shader fail todo] +[pixel shader fail] // Unused cbuffers still reserve their slot, and count towards the limit. float glob;