From 8010ef8771883167d5e29c5112a19926bf6a5942 Mon Sep 17 00:00:00 2001 From: Victor Chiletto Date: Thu, 26 Sep 2024 17:34:16 -0300 Subject: [PATCH] tests: Add a test for unused overlapping cbuffer reservations. --- .../register-reservations-numeric.shader_test | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/hlsl/register-reservations-numeric.shader_test b/tests/hlsl/register-reservations-numeric.shader_test index 22d7867a..f0e8fb09 100644 --- a/tests/hlsl/register-reservations-numeric.shader_test +++ b/tests/hlsl/register-reservations-numeric.shader_test @@ -824,6 +824,29 @@ float4 main(uniform float param) : sv_target return glob * param * a * b * c * d * e * f * g * h * i * j * k * l; } +[pixel shader todo] +// Multiple cbuffers can share the same reservation if only one of them is actually used. + +cbuffer buf0 : register(b0) +{ + float a; +}; + +cbuffer buf1 : register(b0) +{ + float b; +}; + +float4 other_main() : sv_target +{ + return a * a; +} + +float4 main() : sv_target +{ + return b; +} + [require] shader model >= 5.1