Revision b1384a9addfdcbc16ae0e11b85ae2f6ba08f999b authored by jsmall-nvidia on 29 October 2021, 21:19:12 UTC, committed by GitHub on 29 October 2021, 21:19:12 UTC
* #include an absolute path didn't work - because paths were taken to always be relative.

* Update slang-llvm deps.
1 parent 22e7f3f
Raw File
func-param-legalize.slang
//TEST(compute):COMPARE_COMPUTE: -shaderobj

struct Param
{
    Texture2D tex;
    SamplerState samplerState;
    float base;
};

//TEST_INPUT:Texture2D(size=4, content = one):name=diffuseMap
Texture2D diffuseMap;
//TEST_INPUT: Sampler:name=samplerState
SamplerState samplerState;
//TEST_INPUT: ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<float> outputBuffer;

float4 run(Param p)
{
    return p.tex.SampleLevel(p.samplerState, float2(0.0), 0) + p.base;
}

[numthreads(1, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
    Param p;
    p.tex = diffuseMap;
    p.samplerState = samplerState;
    p.base = -0.5;
	float4 outVal = run(p);
	
    outputBuffer[0] = outVal.x;
	outputBuffer[1] = outVal.y;
	outputBuffer[2] = outVal.z;
	outputBuffer[3] = outVal.w;
}
back to top