diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2020-01-23 12:24:13 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-23 12:24:13 -0800 |
| commit | 394983d61efa2bf99ba96aa68a47df8927a8a634 (patch) | |
| tree | 3a35ed930d8f817d03f19214cad96061ea8d3825 /tests/reflection/mix-explicit-and-implicit-spaces.slang | |
| parent | b9c0662af02bcacb93f0dddb970a2ba13288ed79 (diff) | |
Fix a bug in handling explicit register space bindings (#1175)
The logic for handling explicit `space`/`set` bindings on shader parameters for parameter blocks was not correctly marking the `space`/`set` that gets grabbed as used, and as a result it was possible for another parameter block that relies on implicit assignment to end up with a conflicting space.
This change fixes the original oversight, and adds a test case to prevent against regression.
Diffstat (limited to 'tests/reflection/mix-explicit-and-implicit-spaces.slang')
| -rw-r--r-- | tests/reflection/mix-explicit-and-implicit-spaces.slang | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/reflection/mix-explicit-and-implicit-spaces.slang b/tests/reflection/mix-explicit-and-implicit-spaces.slang new file mode 100644 index 000000000..52dd4321e --- /dev/null +++ b/tests/reflection/mix-explicit-and-implicit-spaces.slang @@ -0,0 +1,18 @@ +// mix-explicit-and-implicit-spaces.slang +//TEST:REFLECTION:-profile cs_5_1 -target hlsl + +// Ensure that correct layout/reflection is computed +// when mixing implicit and explicit spaces for +// parameter blocks. + +struct A { float x; } +ParameterBlock<A> a : register(space0); + +struct B { float y; } +ParameterBlock<B> b : register(space1); + +struct C { float z; } +ParameterBlock<C> c; + +void main() +{} |
