summaryrefslogtreecommitdiff
path: root/tests/cross-compile/integer-input.slang.glsl
AgeCommit message (Expand)Author
2018-02-02Remove support for the -no-checking flag (#392)Tim Foley
2017-07-17Handle `flat` interpolation cases in cross compilationTim Foley
8' href='#n28'>28 29 30 31 32 33 34 35
//TEST_CATEGORY(wave, compute)
// Disabled because main tests is wave-shuffle.slang, this just tests VK 
//DISABLE_TEST:COMPARE_COMPUTE_EX:-cpu -compute -shaderobj
//DISABLE_TEST:COMPARE_COMPUTE_EX:-slang -compute -shaderobj
//DISABLE_TEST:COMPARE_COMPUTE_EX:-slang -compute -dx12 -use-dxil -profile cs_6_0 -shaderobj
//TEST(vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj
//TEST:COMPARE_COMPUTE_EX:-cuda -compute -render-features cuda_sm_7_0 -shaderobj
//TEST:COMPARE_COMPUTE_EX:-wgpu -compute -shaderobj
//TEST:COMPARE_COMPUTE_EX:-metal -compute -shaderobj

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

[numthreads(4, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
    int idx = int(dispatchThreadID.x);
    
    int value = 0;
    
    // Scalar
    
    value += WaveShuffle(idx, (idx + 1) & 3);
    
    // vector
    
    {
        float2 v = float2(idx + 1, idx + 2);
        float2 readValue = WaveShuffle(v, (idx - 1) & 3);
        
        value += int(readValue[0] + readValue[1]);
    }
    
    outputBuffer[idx] = value;
}