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
1.0 KiB36 linesraw
1//TEST:REFLECTION:-D__SLANG__ -entry mainVS -profile vs_4_0 -target hlsl tests/reflection/multi-file-extra.hlsl -entry mainFS -profile ps_4_0 -no-codegen
2
3// Here we are testing the case where multiple translation units are provided
4// at once, so that we want combined reflection information for the resulting
5// program. The other part of this program is in `multi-file-extra.hlsl`.
6
7#include "multi-file-defines.h"
8
9#ifdef __SLANG__
10import multi_file_shared;
11#else
12#include "multi-file-shared.slang"
13#endif
14
15Texture2D vertexT R(: register(t0));
16SamplerState vertexS R(: register(s0));
17
18BEGIN_CBUFFER(vertexC)
19{
20    float3 vertexCA;
21    float  vertexCB;
22    float3 vertexCC;
23    float2 vertexCD;
24}
25END_CBUFFER(vertexC, register(b0))
26
27float4 mainVS() : SV_POSITION
28{
29    // Go ahead and use everything here, just to make sure things got placed correctly
30    return use(sharedT, sharedS)
31        +  use(CBUFFER_REF(sharedC, sharedCD))
32        +  use(vertexT, vertexS)
33        +  use(CBUFFER_REF(vertexC, vertexCD))
34        +  use(sharedTV, vertexS)
35        ;
36}