yum-mirror/slang

Making it easier to work with shaders

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

Yong HeUse user defined type name in glsl buffer declarations. (#5242)b8aab84e2

master
495 B23 linesraw
1// texture-load.slang
2
3// Confirm that texture `Load` operations yield the
4// expected type when compiled to SPIR-V.
5
6//TEST:SIMPLE(filecheck=CHECK):-target spirv-assembly -entry main -stage compute -emit-spirv-via-glsl
7
8Texture2D<float2>   inputTexture;
9RWTexture2D<float2> outputTexture;
10
11cbuffer C
12{
13	int2 pos;
14}
15
16// CHECK: OpImageWrite
17
18[numthreads(16, 16, 1)]
19void main(uint2 pixelIndex : SV_DispatchThreadID)
20{
21	float2 tmp = inputTexture.Load(int3(pos,0));
22    outputTexture[pos] = tmp;
23}