added semantic handling and support for remapping variables with semantics

Change-Id: I3c6b5fc1d4f1da6ec6f436fea72849453a13559d
This commit is contained in:
t.jung 2017-01-04 17:55:31 +01:00 committed by Tiemo Jung
parent 7225a1cb1e
commit 8bb3ee53c5
5 changed files with 183 additions and 36 deletions

View file

@ -459,10 +459,12 @@ class TIoMapper;
// and resolveSet are invoked to resolve the binding and descriptor
// set index respectively.
// Invocations happen in a particular order:
// 1) var with binding and set already defined
// 2) var with binding but no set defined
// 3) var with set but no binding defined
// 4) var with no binding and no set defined
// 1) all shader inputs
// 2) all shader outputs
// 3) all uniforms with binding and set already defined
// 4) all uniforms with binding but no set defined
// 5) all uniforms with set but no binding defined
// 6) all uniforms with no binding and no set defined
//
// NOTE: that still limit checks are applied to bindings and sets
// and may result in an error.
@ -480,6 +482,18 @@ public:
// Should return a value >= 0 if the current set should be overriden.
// Return -1 if the current set (including no set) should be kept.
virtual int resolveSet(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
// Should return true if the resuling/current setup would be ok.
// Basic idea is to do aliasing checks and reject invalid semantic names.
virtual bool validateInOut(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
// Should return a value >= 0 if the current location should be overriden.
// Return -1 if the current location (including no location) should be kept.
virtual int resolveInOutLocation(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
// Should return a value >= 0 if the current component index should be overriden.
// Return -1 if the current component index (including no index) should be kept.
virtual int resolveInOutComponent(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
// Should return a value >= 0 if the current color index should be overriden.
// Return -1 if the current color index (including no index) should be kept.
virtual int resolveInOutIndex(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
};
// Make one TProgram per set of shaders that will get linked together. Add all