yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
62baf92a5
master
1//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -target spirv -emit-spirv-directly -entry vertexMain -stage vertex 2 3// CHECK: error 31002: attribute 'vk_offset' is not valid here 4// CHECK-NEXT: [vk::offset(16)]] struct S1 5// CHECK: error 31002: attribute 'vk_offset' is not valid here 6// CHECK-NEXT: [vk::offset(8)]] VertexOutput output; 7 8[[vk::offset(16)]] struct S1 9{ 10 [[vk::offset(32)]] 11 float2 a; 12 13 float3 b; 14 15 [[vk::offset(16)]] 16 float4 c; 17 } 18 19[[vk::push_constant]] 20S1 pc; 21 22struct VertexOutput 23{ 24 float3 position : SV_Position; 25} 26 27[shader("vertex")] 28VertexOutput vertexMain() 29{ 30 [[vk::offset(8)]] VertexOutput output; 31 output.position = float3(pc.a.x, pc.b.y, pc.c.z); 32 return output; 33} 34