diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-02-18 14:14:16 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-18 14:14:16 -0500 |
| commit | 8ee39e08c48a315163fe1850dbb12ca292020d4d (patch) | |
| tree | 5041064a194849399aa587ac13b46db2088bdb05 /prelude/slang-cpp-types.h | |
| parent | e109985375712b449d365450b3d3e39416a171ce (diff) | |
First pass Texture Array support on CUDA/CPU (#1225)
* 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.
* CPU and CUDA support for cube maps.
* Add CPU support for Texture1DArray.
* Support CUDA Layered/Array type in meta library.
Diffstat (limited to 'prelude/slang-cpp-types.h')
| -rw-r--r-- | prelude/slang-cpp-types.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/prelude/slang-cpp-types.h b/prelude/slang-cpp-types.h index 936233afc..4c6848b9f 100644 --- a/prelude/slang-cpp-types.h +++ b/prelude/slang-cpp-types.h @@ -279,6 +279,38 @@ struct Texture3D ITexture3D* texture; }; +struct ITextureCube +{ + 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 TextureCube +{ + 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; } + + ITextureCube* texture; +}; + +struct ITexture1DArray +{ + virtual void Load(const int3& v, void* out) = 0; + virtual void Sample(SamplerState samplerState, const float2& loc, void* out) = 0; + virtual void SampleLevel(SamplerState samplerState, const float2& loc, float level, void* out) = 0; +}; + +template <typename T> +struct Texture1DArray +{ + T Load(const int3& v) const { T out; texture->Load(v, &out); return out; } + T Sample(SamplerState samplerState, const float2& v) const { T out; texture->Sample(samplerState, v, &out); return out; } + T SampleLevel(SamplerState samplerState, const float2& v, float level) { T out; texture->SampleLevel(samplerState, v, level, &out); return out; } + + ITexture1DArray* texture; +}; + /* Varying input for Compute */ /* Used when running a single thread */ |
