https://github.com/shader-slang/slang
Raw File
Tip revision: 3d21e7a654c65a8a3ad6f4b2c591b8fbdbfe1672 authored by Tim Foley on 21 January 2021, 16:38:06 UTC
Upgrade slang-binaries for glslang 11.1.0 (#1664)
Tip revision: 3d21e7a
modern-syntax.slang
// modern-syntax.slang
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
//TEST(compute):COMPARE_COMPUTE_EX:-cpu -slang -compute -shaderobj

// This file exists to confirm that declarations using "modern"
// syntax are handled correctly by the compiler front-end.

typealias MyInt = int;

func test(val: MyInt) -> MyInt
{
	var tmp = val;
	let c : MyInt = 16;
	tmp += c;
	return tmp;
}

//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)
{
	uint tid = dispatchThreadID.x;
	int val = test(tid);
	outputBuffer[tid] = val;
}
back to top