diff options
Diffstat (limited to 'tests/type')
| -rw-r--r-- | tests/type/texture-sampler/texture-sampler-2d.slang | 20 | ||||
| -rw-r--r-- | tests/type/texture-sampler/texture-sampler-2d.slang.expected.txt | 4 |
2 files changed, 24 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; +} diff --git a/tests/type/texture-sampler/texture-sampler-2d.slang.expected.txt b/tests/type/texture-sampler/texture-sampler-2d.slang.expected.txt new file mode 100644 index 000000000..cc5e55ab6 --- /dev/null +++ b/tests/type/texture-sampler/texture-sampler-2d.slang.expected.txt @@ -0,0 +1,4 @@ +3F800000 +3F800000 +3F800000 +3F800000 |
