diff options
| author | Yong He <yonghe@outlook.com> | 2024-10-30 14:07:38 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-30 14:07:38 -0700 |
| commit | 28f20f458c4f7f587556a1738d63b70e87c2b148 (patch) | |
| tree | a3d4fbd77be026979fd5f9802dcbe01404e20396 /source/slang/slang-emit-wgsl.cpp | |
| parent | feec3cf4354524e2badb3e3165fdf2a17c24597e (diff) | |
Write only texture types. (#5454)
* Add support for write-only textures.
* Fix capabilities.
* Fix implementation.
* Fix.
* format code
---------
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-emit-wgsl.cpp')
| -rw-r--r-- | source/slang/slang-emit-wgsl.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/slang/slang-emit-wgsl.cpp b/source/slang/slang-emit-wgsl.cpp index ba89222cd..4aca03a61 100644 --- a/source/slang/slang-emit-wgsl.cpp +++ b/source/slang/slang-emit-wgsl.cpp @@ -405,6 +405,7 @@ void WGSLSourceEmitter::emitSimpleTypeImpl(IRType* type) { switch (texType->getAccess()) { + case SLANG_RESOURCE_ACCESS_WRITE: case SLANG_RESOURCE_ACCESS_READ_WRITE: m_writer->emit("texture_storage"); break; default: m_writer->emit("texture"); break; } @@ -442,7 +443,10 @@ void WGSLSourceEmitter::emitSimpleTypeImpl(IRType* type) m_writer->emit(getWgslImageFormat(texType)); m_writer->emit(", read_write"); break; - + case SLANG_RESOURCE_ACCESS_WRITE: + m_writer->emit(getWgslImageFormat(texType)); + m_writer->emit(", write"); + break; default: if (auto vecElemType = as<IRVectorType>(elemType)) emitSimpleType(vecElemType->getElementType()); |
