diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-01-24 15:06:08 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-24 15:06:08 -0500 |
| commit | b8f294445b998eadb9b09e2b91eb462b881eaf2e (patch) | |
| tree | 8607e5d2f6c2c2b4b7545a721d6d58e6e557e5c0 /tests | |
| parent | 394983d61efa2bf99ba96aa68a47df8927a8a634 (diff) | |
Texture Sample available in CUDA (#1176)
* WIP: Trying to figure out how texturing will work with CUDA.
* WIP: Fixes for CUDA layout. Initial CUDA texture test.
* WIP: Outputs something compilable by CUDA for TextureND.Sample
* 2d texture working with CUDA.
* Fix how binding for SamplerState occurs in CUDA.
* Small tidy up of comments.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/cuda/cuda-texture.slang | 22 | ||||
| -rw-r--r-- | tests/cuda/cuda-texture.slang.expected.txt | 4 |
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/cuda/cuda-texture.slang b/tests/cuda/cuda-texture.slang new file mode 100644 index 000000000..3b5bae8ee --- /dev/null +++ b/tests/cuda/cuda-texture.slang @@ -0,0 +1,22 @@ +//TEST(compute):COMPARE_COMPUTE:-cpu -compute +//TEST(compute):COMPARE_COMPUTE:-cuda -compute + +//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer +RWStructuredBuffer<float> outputBuffer : register(u0); + +//TEST_INPUT: Texture2D(size=4, content=one):name texture +Texture2D<float> texture; + +//TEST_INPUT: Sampler:name sampler +SamplerState sampler; + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + int tid = int(dispatchThreadID.x); + float u = tid * (1.0f / 3.0f); + float v = 1.0f - u; + float2 uv = float2(u, v); + + outputBuffer[tid] = texture.Sample(sampler, uv); +} diff --git a/tests/cuda/cuda-texture.slang.expected.txt b/tests/cuda/cuda-texture.slang.expected.txt new file mode 100644 index 000000000..cc5e55ab6 --- /dev/null +++ b/tests/cuda/cuda-texture.slang.expected.txt @@ -0,0 +1,4 @@ +3F800000 +3F800000 +3F800000 +3F800000 |
