yum-mirror/slang

Making it easier to work with shaders

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

Yong HeUnify stdlib `Texture` types into one generic type. (#3327)4c78efd0c

master
455 B19 linesraw
1//TEST:SIMPLE(filecheck=CHECK): -profile ps_5_0 -entry main -target spirv-assembly
2//TEST:SIMPLE(filecheck=CHECK): -profile ps_5_0 -entry main -target spirv-assembly -emit-spirv-directly
3
4// Ensure that we can lower to `imageStore` correctly.
5
6RWTexture2D<float4> t;
7
8void writeColor(float3 v)
9{
10    t[uint2(0,0)].xyz += v;
11}
12
13float4 main() : SV_Target
14{
15    // CHECK: OpImageRead
16    // CHECK: OpImageWrite
17	writeColor(float3(1.0));
18	return float4(0);
19}