diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-02-14 15:06:35 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-14 15:06:35 -0500 |
| commit | 2c097545eaa324a91a035327abad2e8b4fa60469 (patch) | |
| tree | 95fd3890f2bfb0184ddbc7f1008de30698651473 /tests/compute | |
| parent | dfd3d263704445b6dcebea54dc47193897548822 (diff) | |
Feature/cuda coverage (#1223)
* Add cubemap support.
* Add CUDA fence instrinsics.
* Added Gather for CUDA.
* Use the CUDA driver API as much as possible.
* * Support 1D texture on CPU
* WIP on 1D texture on CUDA
* Added simplified texture test
* Fix test.
* Improve texture-simple tests.
Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'tests/compute')
| -rw-r--r-- | tests/compute/texture-simple.slang | 31 | ||||
| -rw-r--r-- | tests/compute/texture-simple.slang.expected.txt | 4 |
2 files changed, 35 insertions, 0 deletions
diff --git a/tests/compute/texture-simple.slang b/tests/compute/texture-simple.slang new file mode 100644 index 000000000..040af2784 --- /dev/null +++ b/tests/compute/texture-simple.slang @@ -0,0 +1,31 @@ +//TEST(compute):COMPARE_COMPUTE_EX:-cpu -compute +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 +//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 -profile cs_6_0 -use-dxil +// TODO(JS): Doesn't work on vk currently +//DISABLE_TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute +//TEST(compute):COMPARE_COMPUTE_EX:-cuda -compute + +//TEST_INPUT: Texture1D(size=4, content = one):name t1D +Texture1D<float> t1D; +//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, 4, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + int idx = dispatchThreadID.x; + float u = idx * (1.0f / 4); + + float val = 0.0f; + val += t1D.SampleLevel(samplerState, u, 0); + val += t2D.SampleLevel(samplerState, float2(u, u), 0); + + outputBuffer[idx] = val; +} diff --git a/tests/compute/texture-simple.slang.expected.txt b/tests/compute/texture-simple.slang.expected.txt new file mode 100644 index 000000000..f5cf6fb10 --- /dev/null +++ b/tests/compute/texture-simple.slang.expected.txt @@ -0,0 +1,4 @@ +40000000 +40000000 +40000000 +40000000 |
