summaryrefslogtreecommitdiffstats
path: root/tests/ir/string-literal-hash.slang
blob: 2d61a84c190aa2b8608f602d08268e8c54c9fef7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//TEST(compute):COMPARE_COMPUTE: -shaderobj
//TEST(compute):COMPARE_COMPUTE: -vk -shaderobj
//TEST(compute):COMPARE_COMPUTE:-wgpu

// Note: disabled on CPU target until we can fill
// in a more correct/complete `String` and `getStringHash`
// for that target.
//
//TEST_DISABLED(compute):COMPARE_COMPUTE: -cpu


import string_literal_module;

//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer
RWStructuredBuffer<int> outputBuffer;

[numthreads(4, 1, 1)]
void computeMain(
    uint3 tid   : SV_DispatchThreadID)
{
    int value = doSomethingElse() + getStringHash("Hello \t\n\0x083 World");   
    outputBuffer[tid.x] = value;
}