summaryrefslogtreecommitdiffstats
path: root/prelude/slang-cpp-types.h
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-02-20 18:24:00 -0500
committerGitHub <noreply@github.com>2020-02-20 15:24:00 -0800
commit1f401d04e32c6feaeb35243ea5bfc2b14520344b (patch)
tree64394bc2f9fbef3dec3237c69604a0277d019f3c /prelude/slang-cpp-types.h
parentf9d99fde581c7dfdeb46e87f32da1fed8ac5441c (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 'prelude/slang-cpp-types.h')
-rw-r--r--prelude/slang-cpp-types.h15
1 files changed, 15 insertions, 0 deletions
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 <typename T>
+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 */