yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
00474731a
master
1//TEST:SIMPLE(filecheck=CHECK): -target spirv -emit-spirv-directly 2 3// CHECK: OpEntryPoint 4 5struct Globals_s 6{ 7 float4 g_vSomeConstantA; 8 float4 g_vTestFloat4; 9 float4 g_vSomeConstantB; 10}; 11 12typedef vk::BufferPointer<Globals_s> Globals_p; 13 14struct TestPushConstant_t 15{ 16 Globals_p m_nBufferDeviceAddress; 17}; 18 19[[vk::push_constant]] TestPushConstant_t g_PushConstants; 20 21[shader("fragment")] 22float4 MainPs(void) : SV_Target0 23{ 24 float4 vTest = float4(1.0,0.0,0.0,0.0); 25 g_PushConstants.m_nBufferDeviceAddress.Get().g_vTestFloat4 = vTest; 26 return vTest; 27}