summaryrefslogtreecommitdiffstats
path: root/tests/spirv/uconvert-vector-typecheck.slang
blob: f4671c89fc7389626c15076da2d30accd4884670 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//TEST:SIMPLE(filecheck=CHECK): -target spirv

// CHECK: %[[PTR:[0-9a-zA-Z_]+]] = OpVectorShuffle %v2uint %{{.*}} %{{.*}} 0 1
// CHECK: %{{.*}} = OpUConvert %v2ushort %[[PTR]]

RWTexture2D<uint> tex;

void writeFlags(int2 position, RWTexture2D<uint> flagsTexture, uint flags)
{
    flagsTexture[position] = flags;
}

[shader("compute")]
[numthreads(1,1,1)]
void main(uint3 threadId : SV_DispatchThreadID)
{
    uint16_t2 position = uint16_t2(threadId.xy);
    uint flags = 1;
    writeFlags(position, tex, flags);
}