https://github.com/shader-slang/slang
Raw File
Tip revision: a7336f53a6235ef7c8b4a13479befb59c7e9e753 authored by Tim Foley on 14 November 2019, 21:39:23 UTC
Update slang-binaries to include Linux x86 glslang (#1125)
Tip revision: a7336f5
select-expr.slang
//TEST(smoke,compute):COMPARE_COMPUTE:
//TEST(smoke,compute):COMPARE_COMPUTE:-cpu

// Test IR code generation for the `?:` "select" operator

int test(int input)
{
	return input > 1 ? -input : input;
}

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

[numthreads(4, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
    outputBuffer[dispatchThreadID.x] = test((int) dispatchThreadID.x);
}
back to top