diff options
| author | Yong He <yonghe@outlook.com> | 2023-07-19 16:20:52 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-19 16:20:52 -0700 |
| commit | 3509059cd8357455155260d8587b8a438c34e49f (patch) | |
| tree | 59933528a4e93bb02b93d80c8f4ebfe38509b24d /source/slang/slang-emit-hlsl.cpp | |
| parent | a5987aad211d2e0b9391bdda4b67873ec9873074 (diff) | |
Add `sampleCount` parameter for MS textures. (#3001)
* Add `sampleCount` parameter for MS textures.
* Fix test.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-emit-hlsl.cpp')
| -rw-r--r-- | source/slang/slang-emit-hlsl.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/slang/slang-emit-hlsl.cpp b/source/slang/slang-emit-hlsl.cpp index bc6b7a159..30de45773 100644 --- a/source/slang/slang-emit-hlsl.cpp +++ b/source/slang/slang-emit-hlsl.cpp @@ -287,6 +287,15 @@ void HLSLSourceEmitter::_emitHLSLTextureType(IRTextureTypeBase* texType) } m_writer->emit("<"); emitType(texType->getElementType()); + if (texType->getOperandCount() == 2) + { + auto sampleCount = as<IRIntLit>(texType->getSampleCount()); + if (sampleCount->getValue() != 0) + { + m_writer->emit(", "); + m_writer->emit(sampleCount->getValue()); + } + } m_writer->emit(" >"); } |
