summaryrefslogtreecommitdiff
path: root/source/slang/slang-type-layout.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-02-26 21:13:41 +0000
committerGitHub <noreply@github.com>2020-02-26 21:13:41 +0000
commit7bce066cfc51296a538c7a7d325133d60e352494 (patch)
treece54b40315274c3a7daaf5781de3d2504d72cba2 /source/slang/slang-type-layout.cpp
parent6308a1224672944220a1fee34ae22f70212703a0 (diff)
Support for RWTexture types on CPU and CUDA (#1243)
* Added FloatTextureData as a mechanism to enable CPU based Texture writes. * Add [] RWTexture access for CPU. * Fixed rw-texture-simple.slang.expected.txt * WIP: CUDA stdlib has support for [] surface access. * Made IRWTexture class able to take different locations. Doing a Texture2d access on CUDA works. * Fix bug in outputing UniformState - was missing out padding. Support RWTexture with array. Support RWTexture3D. * Use * for locations for read only textures, so only need a ITexture interface. * Fix problem around application of set/get for CUDA on subscript Texture types.
Diffstat (limited to 'source/slang/slang-type-layout.cpp')
-rw-r--r--source/slang/slang-type-layout.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/slang/slang-type-layout.cpp b/source/slang/slang-type-layout.cpp
index 7e9279964..bd0e6e8e0 100644
--- a/source/slang/slang-type-layout.cpp
+++ b/source/slang/slang-type-layout.cpp
@@ -855,6 +855,10 @@ struct CUDAObjectLayoutRulesImpl : CPUObjectLayoutRulesImpl
// It's a pointer to the actual uniform data
return SimpleLayoutInfo(LayoutResourceKind::Uniform, sizeof(void*), SLANG_ALIGN_OF(void*));
+ case ShaderParameterKind::TextureSampler:
+ case ShaderParameterKind::MutableTextureSampler:
+ // That there is no distinct Sampler on CUDA, so TextureSampler is the same as a Texture
+ // which is an ObjectHandle.
case ShaderParameterKind::MutableTexture:
case ShaderParameterKind::TextureUniformBuffer:
case ShaderParameterKind::Texture:
@@ -882,8 +886,6 @@ struct CUDAObjectLayoutRulesImpl : CPUObjectLayoutRulesImpl
// would presumably have to remove use of variables of this kind throughout IR.
return SimpleLayoutInfo(LayoutResourceKind::Uniform, sizeof(void*), SLANG_ALIGN_OF(void*));
- case ShaderParameterKind::TextureSampler:
- case ShaderParameterKind::MutableTextureSampler:
case ShaderParameterKind::InputRenderTarget:
// TODO: how to handle these?
default: