From 3509059cd8357455155260d8587b8a438c34e49f Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 19 Jul 2023 16:20:52 -0700 Subject: Add `sampleCount` parameter for MS textures. (#3001) * Add `sampleCount` parameter for MS textures. * Fix test. --------- Co-authored-by: Yong He --- source/slang/slang-emit-hlsl.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/slang/slang-emit-hlsl.cpp') 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(texType->getSampleCount()); + if (sampleCount->getValue() != 0) + { + m_writer->emit(", "); + m_writer->emit(sampleCount->getValue()); + } + } m_writer->emit(" >"); } -- cgit v1.2.3