diff options
Diffstat (limited to 'tests/type/texture-sampler/texture-sampler-2d.slang')
| -rw-r--r-- | tests/type/texture-sampler/texture-sampler-2d.slang | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/type/texture-sampler/texture-sampler-2d.slang b/tests/type/texture-sampler/texture-sampler-2d.slang new file mode 100644 index 000000000..974231b9b --- /dev/null +++ b/tests/type/texture-sampler/texture-sampler-2d.slang @@ -0,0 +1,20 @@ +//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj + +//TEST_INPUT: TextureSampler2D(size=4, content=one):name t2D +Sampler2D<float> t2D; + +//TEST_INPUT: ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer +RWStructuredBuffer<float> outputBuffer; + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + int idx = dispatchThreadID.x; + float u = idx * (1.0f / 4); + + float val = 0.0f; + + val += t2D.SampleLevel(float2(u, u), 0); + + outputBuffer[idx] = val; +} |
