Commit 8a914f42 by Chow

Add Error check flag in io mapper

GLSL could detect contradictory uniform binding, but missing error reporting, even if we could now observe error inside infosink. Add error check when first time validate uniform binding. When doing traversal, it should be zero error. This error check flag will be used during linking time. To quickly report errors like contradictory uniform bindings. Add error check flags for TDefaultGlslIoResolver when catching EPrefixInternalError
parent bd97b6f9
...@@ -831,6 +831,7 @@ void TDefaultGlslIoResolver::reserverStorageSlot(TVarEntryInfo& ent, TInfoSink& ...@@ -831,6 +831,7 @@ void TDefaultGlslIoResolver::reserverStorageSlot(TVarEntryInfo& ent, TInfoSink&
if (iter->second != location) { if (iter->second != location) {
TString errorMsg = "Invalid location: " + name; TString errorMsg = "Invalid location: " + name;
infoSink.info.message(EPrefixInternalError, errorMsg.c_str()); infoSink.info.message(EPrefixInternalError, errorMsg.c_str());
hasError = true;
} }
} }
} }
...@@ -856,6 +857,7 @@ void TDefaultGlslIoResolver::reserverStorageSlot(TVarEntryInfo& ent, TInfoSink& ...@@ -856,6 +857,7 @@ void TDefaultGlslIoResolver::reserverStorageSlot(TVarEntryInfo& ent, TInfoSink&
if (iter->second != location) { if (iter->second != location) {
TString errorMsg = "Invalid location: " + name; TString errorMsg = "Invalid location: " + name;
infoSink.info.message(EPrefixInternalError, errorMsg.c_str()); infoSink.info.message(EPrefixInternalError, errorMsg.c_str());
hasError = true;
} }
} }
} }
...@@ -884,6 +886,7 @@ void TDefaultGlslIoResolver::reserverResourceSlot(TVarEntryInfo& ent, TInfoSink& ...@@ -884,6 +886,7 @@ void TDefaultGlslIoResolver::reserverResourceSlot(TVarEntryInfo& ent, TInfoSink&
if (iter->second != binding) { if (iter->second != binding) {
TString errorMsg = "Invalid binding: " + name; TString errorMsg = "Invalid binding: " + name;
infoSink.info.message(EPrefixInternalError, errorMsg.c_str()); infoSink.info.message(EPrefixInternalError, errorMsg.c_str());
hasError = true;
} }
} }
} }
......
...@@ -129,6 +129,7 @@ public: ...@@ -129,6 +129,7 @@ public:
uint32_t computeTypeLocationSize(const TType& type, EShLanguage stage); uint32_t computeTypeLocationSize(const TType& type, EShLanguage stage);
TSlotSetMap slots; TSlotSetMap slots;
bool hasError = false;
protected: protected:
TDefaultIoResolverBase(TDefaultIoResolverBase&); TDefaultIoResolverBase(TDefaultIoResolverBase&);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment