diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-02-20 18:24:00 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-20 15:24:00 -0800 |
| commit | 1f401d04e32c6feaeb35243ea5bfc2b14520344b (patch) | |
| tree | 64394bc2f9fbef3dec3237c69604a0277d019f3c /tests/compute/rw-texture-simple.slang | |
| parent | f9d99fde581c7dfdeb46e87f32da1fed8ac5441c (diff) | |
WIP on RWTexture types on CUDA/CPU (#1234)
* CUDA support for array of resources.
* * Add support for Texture2DArray on CPU
* Expand texture-simple.slang to test Texture2DArray
* Reorganise CUDAComputeUtil to split out createTextureResource.
* Add TextureCubeArray support for CPU/CUDA targets.
* Pulled out CUDAResource
Renamed derived classes to reflect that change.
* Creation of SurfObject type.
* Functions to return read/write access for simplifying future additions.
* WIP for RWTexture access on CPU/CUDA.
* CUsurfObject cannot have mips.
* Ability to set number of mips on test data.
Preliminary support for CUsurfObj and RWTexture1D on CUDA.
CUDA docs improvements.
* Fix typo.
Diffstat (limited to 'tests/compute/rw-texture-simple.slang')
| -rw-r--r-- | tests/compute/rw-texture-simple.slang | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/compute/rw-texture-simple.slang b/tests/compute/rw-texture-simple.slang new file mode 100644 index 000000000..dde0ecd4c --- /dev/null +++ b/tests/compute/rw-texture-simple.slang @@ -0,0 +1,27 @@ +//TEST(compute):COMPARE_COMPUTE_EX:-cpu -compute +// Doesn't work on DX11 currently - locks up on binding +//DISABLE_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, because createTextureView not implemented on vk renderer +//DISABLE_TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute +//TEST(compute):COMPARE_COMPUTE_EX:-cuda -compute + +//TEST_INPUT: RWTexture1D(format=R_Float32, size=4, content = one):name rwt1D +RWTexture1D<float> rwt1D; + +//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 += rwt1D.Load(idx); + + outputBuffer[idx] = val; +} |
