From 1f401d04e32c6feaeb35243ea5bfc2b14520344b Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 20 Feb 2020 18:24:00 -0500 Subject: 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. --- prelude/slang-cpp-types.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'prelude/slang-cpp-types.h') diff --git a/prelude/slang-cpp-types.h b/prelude/slang-cpp-types.h index f62333f68..563b4b6e9 100644 --- a/prelude/slang-cpp-types.h +++ b/prelude/slang-cpp-types.h @@ -343,6 +343,21 @@ struct TextureCubeArray ITextureCubeArray* texture; }; +/* !!!!!!!!!!!!!!!!!!!!!!!!!!! RWTexture !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ + +struct IRWTexture1D +{ + virtual void Load(int32_t loc, void* out) = 0; +}; + +template +struct RWTexture1D +{ + T Load(int32_t loc) const { T out; texture->Load(loc, &out); return out; } + + IRWTexture1D* texture; +}; + /* Varying input for Compute */ /* Used when running a single thread */ -- cgit v1.2.3