diff options
| author | Yong He <yonghe@outlook.com> | 2024-03-25 09:24:04 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-25 09:24:04 -0700 |
| commit | cbe55261ce07c9f737b5117dd1f703950190d843 (patch) | |
| tree | 2962165562aad4fb94862a41d28c8f6d04e468ab /source/slang/slang-emit-spirv.cpp | |
| parent | c9df734b836a503dbc09c48bfd54b35facd0f105 (diff) | |
Fix missing PerPrimitive decoration in mesh shader output. (#3828)
Diffstat (limited to 'source/slang/slang-emit-spirv.cpp')
| -rw-r--r-- | source/slang/slang-emit-spirv.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp index 6ecffecd1..c48f0e978 100644 --- a/source/slang/slang-emit-spirv.cpp +++ b/source/slang/slang-emit-spirv.cpp @@ -2141,10 +2141,18 @@ struct SPIRVEmitContext } } - if (var->findDecorationImpl(kIROp_RequireSPIRVDescriptorIndexingExtensionDecoration)) + for (auto decor : var->getDecorations()) { - ensureExtensionDeclaration(UnownedStringSlice("SPV_EXT_descriptor_indexing")); - requireSPIRVCapability(SpvCapabilityRuntimeDescriptorArray); + switch (decor->getOp()) + { + case kIROp_GLSLPrimitivesRateDecoration: + emitOpDecorate(getSection(SpvLogicalSectionID::Annotations), decor, varInst, SpvDecorationPerPrimitiveEXT); + break; + case kIROp_RequireSPIRVDescriptorIndexingExtensionDecoration: + ensureExtensionDeclaration(UnownedStringSlice("SPV_EXT_descriptor_indexing")); + requireSPIRVCapability(SpvCapabilityRuntimeDescriptorArray); + break; + } } } |
