yum-mirror/slang

Making it easier to work with shaders

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

Darren WihandiEmit SPIRV NonReadable decoration for WTexture* (#6922)8f6c6e333

master
1.1 KiB32 linesraw
1//TEST:REFLECTION(filecheck=REFLECT):-stage compute -entry computeMain -target wgsl -no-codegen
2//TEST:SIMPLE(filecheck=SPV): -target spirv -emit-spirv-directly
3//TEST:SIMPLE(filecheck=SPV): -target spirv -emit-spirv-via-glsl
4//TEST:SIMPLE(filecheck=CHECK): -target wgsl -entry computeMain -stage compute
5//TEST:SIMPLE(filecheck=CHECK-WGSL-SPV): -target wgsl-spirv-asm -entry computeMain -stage compute
6//TEST:SIMPLE(filecheck=HLSL): -target hlsl -entry computeMain -profile cs_6_0
7//TEST:SIMPLE(filecheck=GLSL): -target glsl -entry computeMain -stage compute
8
9// CHECK: texture_storage_2d<rgba8unorm, write>
10
11// CHECK-WGSL-SPV: OpDecorate {{.*}} NonReadable
12// CHECK-WGSL-SPV: OpTypeImage %float 2D {{.}} 0 0 2 Rgba8
13
14// SPV: OpDecorate {{.*}} NonReadable
15// SPV: OpTypeImage %float 2D {{.}} 0 0 2 Rgba8
16
17// HLSL: RWTexture2D
18
19// GLSL: writeonly
20// GLSL: image2D
21
22// REFLECT: "name": "writeOnlyTexture"
23// REFLECT: "access": "write"
24
25[format("rgba8")]
26WTexture2D writeOnlyTexture;
27
28[shader("compute")]
29void computeMain()
30{
31    writeOnlyTexture.Store(int2(0,0), float4(0.2, 0.3, 0.4, 1.0));
32}