summaryrefslogtreecommitdiffstats
path: root/tests/bugs/obfuscate-specialization-naming.slang
blob: 2511adbea7f7d3a78a5f7188fc9658b58455f1b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -compile-arg -obfuscate -shaderobj 
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -compile-arg -obfuscate -shaderobj

//TEST_INPUT:ubuffer(data=[0 1 2 3], stride=4):name a
RWStructuredBuffer<int> a;
//TEST_INPUT:ubuffer(data=[0 2 4 6], stride=4):name b
RWStructuredBuffer<int> b;

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

int doThing(RWStructuredBuffer<int> buf, int index)
{
    return buf[index];
}

[numthreads(16, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
    int tid = int(dispatchThreadID.x); 

    output[tid] = doThing(a, tid) | doThing(b, tid);
}