summaryrefslogtreecommitdiff
path: root/tests/compute/texture-simpler.slang
blob: ce4b76f77e161b1f1b43ea3ec96de9d676d2cf09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//TEST(compute, vulkan):COMPARE_COMPUTE:-vk -compute -shaderobj -output-using-type

//TEST_INPUT: Texture2D(size=4, content = one):name t2D
Texture2D<float> t2D;
//TEST_INPUT: Sampler:name samplerState
SamplerState samplerState;

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

[numthreads(4, 1, 1)]
void computeMain(uint i : SV_GroupIndex)
{
    float u = i * 0.25;
    outputBuffer[i] = t2D.SampleLevel(samplerState, float2(u, u), 0);
}