yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
a23adc221
master
1//TEST:COMPARE_HLSL: -profile sm_4_0 -entry main1 -stage vertex Tests/bindings/multi-file-extra.hlsl -entry main -stage fragment 2 3// Here we are going to test that we can correctly generating bindings when we 4// are presented with a program spanning multiple input files (and multiple entry points) 5 6// This file provides the vertex shader, while the fragment shader resides in 7// the file `multi-file-extra.hlsl` 8 9#include "multi-file-defines.h" 10 11#ifdef __SLANG__ 12import multi_file_shared ; 13#else 14#include "multi-file-shared.slang" 15#endif 16 17Texture2D vertexT R ( :register ( t0 )); 18SamplerState vertexS R ( :register ( s0 )); 19 20BEGIN_CBUFFER ( vertexC ) 21{ 22float3 vertexCA ; 23float vertexCB ; 24float3 vertexCC ; 25float2 vertexCD ; 26} 27END_CBUFFER ( vertexC , register ( b0 )) 28 29float4 main1 () : SV_POSITION 30{ 31// Go ahead and use everything here, just to make sure things got placed correctly 32return use ( sharedT , sharedS ) 33+ use ( CBUFFER_REF ( sharedC , sharedCD )) 34+ use ( vertexT , vertexS ) 35+ use ( CBUFFER_REF ( vertexC , vertexCD )) 36+ use ( sharedTV , vertexS ) 37; 38}