diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-02-14 15:06:35 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-14 15:06:35 -0500 |
| commit | 2c097545eaa324a91a035327abad2e8b4fa60469 (patch) | |
| tree | 95fd3890f2bfb0184ddbc7f1008de30698651473 /prelude | |
| parent | dfd3d263704445b6dcebea54dc47193897548822 (diff) | |
Feature/cuda coverage (#1223)
* 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.
Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'prelude')
| -rw-r--r-- | prelude/slang-cpp-types.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/prelude/slang-cpp-types.h b/prelude/slang-cpp-types.h index 67db607f6..2238727c5 100644 --- a/prelude/slang-cpp-types.h +++ b/prelude/slang-cpp-types.h @@ -228,6 +228,23 @@ struct SamplerComparisonState // Texture +struct ITexture1D +{ + virtual void Load(const int2& v, void* out) = 0; + virtual void Sample(SamplerState samplerState, float loc, void* out) = 0; + virtual void SampleLevel(SamplerState samplerState, float loc, float level, void* out) = 0; +}; + +template <typename T> +struct Texture1D +{ + T Load(const int2& v) const { T out; texture->Load(v, &out); return out; } + T Sample(SamplerState samplerState, float v) const { T out; texture->Sample(samplerState, v, &out); return out; } + T SampleLevel(SamplerState samplerState, float v, float level) { T out; texture->SampleLevel(samplerState, v, level, &out); return out; } + + ITexture1D* texture; +}; + struct ITexture2D { virtual void Load(const int3& v, void* out) = 0; |
