Revision 39fb45484996f9d71b6551239dbf55eaaaf8db1f authored by Theresa Foley on 17 May 2022, 17:56:36 UTC, committed by GitHub on 17 May 2022, 17:56:36 UTC
Checking in more in-progress proposals in the hopes of sparking discussion and/or guiding future implementation work.
1 parent 5a3aa61
Raw File
syntax-error-op-line-3.slang
// syntax-error-op-line-3.slang

// NOTE! That although this is a 'diagnostic' like test, it tests using downstream compiler
// the downstream compiler being present is a requirement, so we mark as a 'TEST' so that 
// those tests are made.

//TEST:SIMPLE_LINE:-entry computeMain -target spirv 
//TEST:SIMPLE_LINE:-entry computeMain -target dxil -profile cs_6_0 
//TEST:SIMPLE_LINE:-entry computeMain -target dxbc 
//TEST:SIMPLE_LINE:-entry computeMain -target dll 
//TEST:SIMPLE_LINE:-entry computeMain -target ptx 

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

// Here the thing being checked is error reporting around return, and += 

[__unsafeForceInlineEarly]
int doSomething(int a)
{
    a += a;
    
    return a 
    += 
    __SyntaxError();
}

[shader("compute")]
[numthreads(4, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
    int id = int(dispatchThreadID.x);
    
    int v = int(dispatchThreadID.y);
    
    
    
    v += doSomething(id);
    
    outputBuffer[id] = v;
}
back to top