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-syntax.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-syntax.cpp')
| -rw-r--r-- | source/slang/slang-syntax.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/slang/slang-syntax.cpp b/source/slang/slang-syntax.cpp index f70d2bd85..249969729 100644 --- a/source/slang/slang-syntax.cpp +++ b/source/slang/slang-syntax.cpp @@ -573,9 +573,17 @@ Index getFilterCountImpl(const ReflectClassInfo& clsInfo, MemberFilterStyle filt else if (magicMod->magicName == "Texture") { SLANG_ASSERT(subst && subst->getArgs().getCount() >= 1); + auto textureTag = TextureFlavor(magicMod->tag); + Val* sampleCount = nullptr; + if (textureTag.isMultisample() && textureTag.getAccess() == SLANG_RESOURCE_ACCESS_READ_WRITE) + { + if (subst->getArgs().getCount() >= 2) + sampleCount = ExtractGenericArgInteger(subst->getArgs().getLast()); + } auto textureType = astBuilder->getOrCreate<TextureType>( - TextureFlavor(magicMod->tag), - ExtractGenericArgType(subst->getArgs()[0])); + textureTag, + ExtractGenericArgType(subst->getArgs()[0]), + sampleCount); textureType->declRef = declRef; return textureType; } |
