summaryrefslogtreecommitdiff
path: root/prelude
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-02-18 12:40:14 -0500
committerGitHub <noreply@github.com>2020-02-18 12:40:14 -0500
commite109985375712b449d365450b3d3e39416a171ce (patch)
tree56a2c805368d5afbfa568e514af0704b8ed7346c /prelude
parent2c097545eaa324a91a035327abad2e8b4fa60469 (diff)
CUDA/CPU resource coverage (#1224)
* 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. * * Add CPU support for 3d textures * Add support for mip maps to CUDA * Disable warnings in nvrtc * Update CUDA docs * WIP on 3d texture support. * Add support for 3d textures for CPU and CUDA.
Diffstat (limited to 'prelude')
-rw-r--r--prelude/slang-cpp-types.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/prelude/slang-cpp-types.h b/prelude/slang-cpp-types.h
index 2238727c5..936233afc 100644
--- a/prelude/slang-cpp-types.h
+++ b/prelude/slang-cpp-types.h
@@ -262,6 +262,23 @@ struct Texture2D
ITexture2D* texture;
};
+struct ITexture3D
+{
+ virtual void Load(const int4& v, void* out) = 0;
+ virtual void Sample(SamplerState samplerState, const float3& loc, void* out) = 0;
+ virtual void SampleLevel(SamplerState samplerState, const float3& loc, float level, void* out) = 0;
+};
+
+template <typename T>
+struct Texture3D
+{
+ T Load(const int4& v) const { T out; texture->Load(v, &out); return out; }
+ T Sample(SamplerState samplerState, const float3& v) const { T out; texture->Sample(samplerState, v, &out); return out; }
+ T SampleLevel(SamplerState samplerState, const float3& v, float level) { T out; texture->SampleLevel(samplerState, v, level, &out); return out; }
+
+ ITexture3D* texture;
+};
+
/* Varying input for Compute */
/* Used when running a single thread */