From 8bbd41f274972d8533ff0932a22da740eb82843c Mon Sep 17 00:00:00 2001 From: Malcolm Bechard Date: Mon, 22 Mar 2021 13:51:45 -0400 Subject: [PATCH] Don't check precision qualifiers on cross-stage checks Fixes #2586 --- glslang/MachineIndependent/linkValidate.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index 33af7bb..42b416d 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -871,12 +871,13 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy } } - // Qualifiers have to (almost) match + bool isInOut = crossStage && + ((symbol.getQualifier().storage == EvqVaryingIn && unitSymbol.getQualifier().storage == EvqVaryingOut) || + (symbol.getQualifier().storage == EvqVaryingOut && unitSymbol.getQualifier().storage == EvqVaryingIn)); + // Qualifiers have to (almost) match // Storage... - if (symbol.getQualifier().storage != unitSymbol.getQualifier().storage && - !((crossStage && symbol.getQualifier().storage == EvqVaryingIn && unitSymbol.getQualifier().storage == EvqVaryingOut) || - (crossStage && symbol.getQualifier().storage == EvqVaryingOut && unitSymbol.getQualifier().storage == EvqVaryingIn))) { + if (!isInOut && symbol.getQualifier().storage != unitSymbol.getQualifier().storage) { error(infoSink, "Storage qualifiers must match:"); writeTypeComparison = true; } @@ -898,7 +899,7 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy } // Precision... - if (symbol.getQualifier().precision != unitSymbol.getQualifier().precision) { + if (!isInOut && symbol.getQualifier().precision != unitSymbol.getQualifier().precision) { error(infoSink, "Precision qualifiers must match:"); writeTypeComparison = true; } -- 2.7.4