https://github.com/shader-slang/slang
Raw File
Tip revision: eaafafe772366a23ed847cbb10770c72aa5cfc28 authored by Tim Foley on 03 October 2018, 23:03:37 UTC
Update DXR API definitions for final spec. (#659)
Tip revision: eaafafe
empty-struct.slang
//TEST(smoke,compute):COMPARE_COMPUTE:
//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
// Confirm that generics syntax can be used in user
// code and generates valid output.

RWStructuredBuffer<float> outputBuffer;

struct Simple
{
    float getVal() {return 1.0;}
};

[numthreads(4, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
    Simple s;
	float outVal = s.getVal();
	outputBuffer[dispatchThreadID.x] = outVal;
}
back to top