yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Yong HeSPIRV `Block` decoration fixes. (#4303)9a23a9aab

master
507 B26 linesraw
1// vk-push-constant.slang
2
3// Test to confirm that a `[[vk::push_constant]]` buffer
4// doesn't end up reserving `space=0` for global scope
5// parameters and shifting a parameer block over to
6// `space=1`.
7
8//TEST:SIMPLE(filecheck=CHECK):-target spirv-assembly -entry main -stage fragment
9
10struct S
11{
12	float4 v;
13}
14
15[[vk::push_constant]]
16ConstantBuffer<S> x;
17
18// CHECK: OpDecorate %y Binding 0
19// CHECK: OpDecorate %y DescriptorSet 0
20
21ParameterBlock<S> y;
22
23float4 main() : SV_Target
24{
25    return x.v + y.v;
26}