From b12cbfc3f509ff54aac843698f41da530ebc34d9 Mon Sep 17 00:00:00 2001 From: Rex Xu Date: Wed, 6 Dec 2023 16:21:07 +0800 Subject: [PATCH] Fix a typo in markGenericInputOutputUsage Should use setLocation when encountering dynamic indexing. --- lgc/builder/InOutBuilder.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lgc/builder/InOutBuilder.cpp b/lgc/builder/InOutBuilder.cpp index b84c2597e3..4a204f5161 100644 --- a/lgc/builder/InOutBuilder.cpp +++ b/lgc/builder/InOutBuilder.cpp @@ -181,7 +181,7 @@ Value *BuilderImpl::readGenericInputOutput(bool isOutput, Type *resultTy, unsign assert(isOutput == false || m_shaderStage == ShaderStageTessControl); // Fold constant locationOffset into location. (Currently a variable locationOffset is only supported in - // TCS, TES, and FS custom interpolation.) + // TCS, TES, mesh shader, and FS custom interpolation.) bool isDynLocOffset = true; if (auto constLocOffset = dyn_cast(locationOffset)) { location += constLocOffset->getZExtValue(); @@ -409,7 +409,10 @@ void BuilderImpl::markGenericInputOutputUsage(bool isOutput, unsigned location, origLocationInfo.setLocation(i); origLocationInfo.setComponent(inOutInfo.getComponent()); auto &newLocationInfo = (*inOutLocInfoMap)[origLocationInfo]; - newLocationInfo.setData(isDynLocOffset ? i : InvalidValue); + if (isDynLocOffset) + newLocationInfo.setLocation(i); + else + newLocationInfo.setData(InvalidValue); } } if (perPatchInOutLocMap) {