From 6d5ef9b650a9db35f7774ca09d9225d0c30849e4 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 11 Jun 2024 00:01:12 -0700 Subject: Fix `GetAttributeAtVertex` for spirv and glsl targets. (#4334) --- source/slang/slang-emit-spirv.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/slang/slang-emit-spirv.cpp') diff --git a/source/slang/slang-emit-spirv.cpp b/source/slang/slang-emit-spirv.cpp index 1db323993..4f7410f00 100644 --- a/source/slang/slang-emit-spirv.cpp +++ b/source/slang/slang-emit-spirv.cpp @@ -3535,6 +3535,15 @@ struct SPIRVEmitContext (IRInterpolationMode)getIntVal(decoration->getOperand(0)), dstID); break; + case kIROp_PerVertexDecoration: + ensureExtensionDeclaration(UnownedStringSlice("SPV_KHR_fragment_shader_barycentric")); + requireSPIRVCapability(SpvCapabilityFragmentBarycentricKHR); + emitOpDecorate( + getSection(SpvLogicalSectionID::Annotations), + decoration, + dstID, + SpvDecorationPerVertexKHR); + break; case kIROp_MemoryQualifierSetDecoration: { auto collection = as(decoration); -- cgit v1.2.3