summaryrefslogtreecommitdiffstats
path: root/tests/cross-compile/texture-load.slang
blob: 167db783198b5c09f0fb04769c21b0bee8f747c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// texture-load.slang

// Confirm that texture `Load` operations yield the
// expected type when compiled to SPIR-V.

//TEST:SIMPLE(filecheck=CHECK):-target spirv-assembly -entry main -stage compute -emit-spirv-via-glsl

Texture2D<float2>   inputTexture;
RWTexture2D<float2> outputTexture;

cbuffer C
{
	int2 pos;
}

// CHECK: OpImageWrite

[numthreads(16, 16, 1)]
void main(uint2 pixelIndex : SV_DispatchThreadID)
{
	float2 tmp = inputTexture.Load(int3(pos,0));
    outputTexture[pos] = tmp;
}