yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
69cb6e8f3
master
1//TEST:REFLECTION:-profile ps_4_0 -target spirv -no-codegen 2 3// Confirm that we can generate reflection info for arrays 4// 5// Note: just working with fixed-size arrays for now. 6// Unbounded arrays may require more work. 7 8layout ( binding = 0 , set = 1 ) cbuffer MyConstantBuffer 9{ 10float x ; 11 12float a [ 10 ]; 13 14float y ; 15} 16 17struct MyPushConstantStruct 18{ 19float pushX ; 20float pushY ; 21}; 22 23/* This style doesn't work 24[[vk::push_constant]] MyPushConstantStruct pushConstantBuffer; 25*/ 26 27// This style does work 28[[vk ::push_constant ]]ConstantBuffer < MyPushConstantStruct > pushConstantBuffer ; 29 30/* This style works too 31layout(push_constant) 32cbuffer MyPushConstantBuffer 33{ 34float pushX; 35float pushY; 36} 37*/ 38 39/* This works too 40[[vk::push_constant]] cbuffer MyPushConstantBuffer 41{ 42float pushX; 43float pushY; 44} 45*/ 46 47[[vk ::binding ( 1 , 2 ) ]]Texture2D tx ; 48[ gl::binding ( 2 , 3 )] Texture2D ta ; 49Texture2D ty ; 50SamplerState sx ; 51SamplerState sa [ 4 ]; 52SamplerState sy ; 53 54float4 main () : SV_Target 55{ 56return 0.0 + pushConstantBuffer . pushX ; 57}