summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics/generic-invalid-type-specialization.slang
blob: 28d1556430e5c2c0eb5a863d43075145b9154937 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//DIAGNOSTIC_TEST:SIMPLE:

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

struct Check<T>
{
    T v;
};

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

    // Invalid as should only accept a type
    Check<2 + 2> v; 
    
    outputBuffer[index] = index; 
}