yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Alexey PanteleevSupport for querying which parameters are used in emitted code (#2239)69cb6e8f3

master
740 B23 linesraw
1//TEST:REFLECTION:-profile sm_5_1 -stage fragment -target hlsl -no-codegen
2
3// This test is to confirm that we do not allocate a "default"
4// space/set for global shader parameters unless it is
5// really required. In particular, if there are global-scope
6// resource parameters *but* they are all explicitly bound,
7// then a default space isn't needed.
8
9
10// An explicitly-bound global texture.
11Texture2D a : register(t0, space99);
12
13// An implicitly-bound global parameter block.
14//
15// This parameter should be given `space0`, because
16// it is the first available space after all explicitly-bound
17// parameters have claimed their registers/spaces.
18//
19struct B { Texture2D b; }
20ParameterBlock<B> b;
21
22float4 main() : SV_Target
23{ return 0.0; }