https://github.com/shader-slang/slang
Raw File
Tip revision: e698b4ae92b996ac54d023c831170a5467b2d1a0 authored by Sai Praveen Bangaru on 28 September 2023, 05:45:09 UTC
Remove `[NoSideEffect]` from `DiffTensorView.store()` (#3247)
Tip revision: e698b4a
global-type-param.slang
//DISABLED_TEST(smoke,compute):COMPARE_COMPUTE: -shaderobj

//TEST_INPUT:type Wrapper<Impl>

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

interface IBase
{
    float compute();
}

struct Wrapper<T : IBase> : IBase
{
    T obj;
    float compute()
    {
        return obj.compute();        
    }
};

struct Impl : IBase
{
    float compute()
    {
        return 1.0;
    }
};

[numthreads(1, 1, 1)]
void computeMain<TImpl:IBase>(
    uniform TImpl impl,
    uint3 dispatchThreadID : SV_DispatchThreadID)
{
	uint tid = dispatchThreadID.x;
	float outVal = impl.compute();
	outputBuffer[tid] = outVal;
}
back to top