diff options
Diffstat (limited to 'glslang/MachineIndependent')
-rw-r--r-- | glslang/MachineIndependent/linkValidate.cpp | 15 | ||||
-rw-r--r-- | glslang/MachineIndependent/localintermediate.h | 1 |
2 files changed, 14 insertions, 2 deletions
diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index 2e101347..bc473abc 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -60,6 +60,13 @@ void TIntermediate::error(TInfoSink& infoSink, const char* message) ++numErrors; } +// Link-time warning. +void TIntermediate::warn(TInfoSink& infoSink, const char* message) +{ + infoSink.info.prefix(EPrefixWarning); + infoSink.info << "Linking " << StageName(language) << " stage: " << message << "\n"; +} + // TODO: 4.4 offset/align: "Two blocks linked together in the same program with the same block // name must have the exact same set of members qualified with offset and their integral-constant // expression values must be the same, or a link-time error results." @@ -370,8 +377,12 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy // void TIntermediate::finalCheck(TInfoSink& infoSink) { - if (source == EShSourceGlsl && numEntryPoints < 1) - error(infoSink, "Missing entry point: Each stage requires one entry point"); + if (numEntryPoints < 1) { + if (source == EShSourceGlsl) + error(infoSink, "Missing entry point: Each stage requires one entry point"); + else + warn(infoSink, "Entry point not found"); + } if (numPushConstants > 1) error(infoSink, "Only one push_constant block is allowed per stage"); diff --git a/glslang/MachineIndependent/localintermediate.h b/glslang/MachineIndependent/localintermediate.h index 6a4cfd08..e8608240 100644 --- a/glslang/MachineIndependent/localintermediate.h +++ b/glslang/MachineIndependent/localintermediate.h @@ -385,6 +385,7 @@ public: protected: TIntermSymbol* addSymbol(int Id, const TString&, const TType&, const TConstUnionArray&, TIntermTyped* subtree, const TSourceLoc&); void error(TInfoSink& infoSink, const char*); + void warn(TInfoSink& infoSink, const char*); void mergeBodies(TInfoSink&, TIntermSequence& globals, const TIntermSequence& unitGlobals); void mergeLinkerObjects(TInfoSink&, TIntermSequence& linkerObjects, const TIntermSequence& unitLinkerObjects); void mergeImplicitArraySizes(TType&, const TType&); |