Revert "Merge pull request #1792 from Roy-AMD/automapping-opengl-location"
This reverts commit50ada66c27, reversing changes made to3464b6f519.
This commit is contained in:
parent
50ada66c27
commit
302fe97e7b
4 changed files with 491 additions and 1130 deletions
|
|
@ -646,9 +646,8 @@ protected:
|
|||
const TType* type;
|
||||
};
|
||||
|
||||
class TReflection;
|
||||
class TIoMapper;
|
||||
struct TVarEntryInfo;
|
||||
class TReflection;
|
||||
class TIoMapper;
|
||||
|
||||
// Allows to customize the binding layout after linking.
|
||||
// All used uniform variables will invoke at least validateBinding.
|
||||
|
|
@ -669,61 +668,51 @@ struct TVarEntryInfo;
|
|||
// notifiy callbacks, this phase ends with a call to endNotifications.
|
||||
// Phase two starts directly after the call to endNotifications
|
||||
// and calls all other callbacks to validate and to get the
|
||||
// bindings, sets, locations, component and color indices.
|
||||
// bindings, sets, locations, component and color indices.
|
||||
//
|
||||
// NOTE: that still limit checks are applied to bindings and sets
|
||||
// and may result in an error.
|
||||
class TIoMapResolver
|
||||
{
|
||||
public:
|
||||
virtual ~TIoMapResolver() {}
|
||||
virtual ~TIoMapResolver() {}
|
||||
|
||||
// Should return true if the resulting/current binding would be okay.
|
||||
// Basic idea is to do aliasing binding checks with this.
|
||||
virtual bool validateBinding(EShLanguage stage, TVarEntryInfo& ent) = 0;
|
||||
// Should return a value >= 0 if the current binding should be overridden.
|
||||
// Return -1 if the current binding (including no binding) should be kept.
|
||||
virtual int resolveBinding(EShLanguage stage, TVarEntryInfo& ent) = 0;
|
||||
// Should return a value >= 0 if the current set should be overridden.
|
||||
// Return -1 if the current set (including no set) should be kept.
|
||||
virtual int resolveSet(EShLanguage stage, TVarEntryInfo& ent) = 0;
|
||||
// Should return a value >= 0 if the current location should be overridden.
|
||||
// Return -1 if the current location (including no location) should be kept.
|
||||
virtual int resolveUniformLocation(EShLanguage stage, TVarEntryInfo& ent) = 0;
|
||||
// Should return true if the resulting/current setup would be okay.
|
||||
// Basic idea is to do aliasing checks and reject invalid semantic names.
|
||||
virtual bool validateInOut(EShLanguage stage, TVarEntryInfo& ent) = 0;
|
||||
// Should return a value >= 0 if the current location should be overridden.
|
||||
// Return -1 if the current location (including no location) should be kept.
|
||||
virtual int resolveInOutLocation(EShLanguage stage, TVarEntryInfo& ent) = 0;
|
||||
// Should return a value >= 0 if the current component index should be overridden.
|
||||
// Return -1 if the current component index (including no index) should be kept.
|
||||
virtual int resolveInOutComponent(EShLanguage stage, TVarEntryInfo& ent) = 0;
|
||||
// Should return a value >= 0 if the current color index should be overridden.
|
||||
// Return -1 if the current color index (including no index) should be kept.
|
||||
virtual int resolveInOutIndex(EShLanguage stage, TVarEntryInfo& ent) = 0;
|
||||
// Notification of a uniform variable
|
||||
virtual void notifyBinding(EShLanguage stage, TVarEntryInfo& ent) = 0;
|
||||
// Notification of a in or out variable
|
||||
virtual void notifyInOut(EShLanguage stage, TVarEntryInfo& ent) = 0;
|
||||
// Called by mapIO when it starts its notify pass for the given stage
|
||||
virtual void beginNotifications(EShLanguage stage) = 0;
|
||||
// Called by mapIO when it has finished the notify pass
|
||||
virtual void endNotifications(EShLanguage stage) = 0;
|
||||
// Called by mipIO when it starts its resolve pass for the given stage
|
||||
virtual void beginResolve(EShLanguage stage) = 0;
|
||||
// Called by mapIO when it has finished the resolve pass
|
||||
virtual void endResolve(EShLanguage stage) = 0;
|
||||
// Called by mapIO when it starts its symbol collect for teh given stage
|
||||
virtual void beginCollect(EShLanguage stage) = 0;
|
||||
// Called by mapIO when it has finished the symbol collect
|
||||
virtual void endCollect(EShLanguage stage) = 0;
|
||||
// Called by TSlotCollector to resolve storage locations or bindings
|
||||
virtual void reserverStorageSlot(TVarEntryInfo& ent, TInfoSink& infoSink) = 0;
|
||||
// Called by TSlotCollector to resolve resource locations or bindings
|
||||
virtual void reserverResourceSlot(TVarEntryInfo& ent, TInfoSink& infoSink) = 0;
|
||||
// Called by mapIO.addStage to set shader stage mask to mark a stage be added to this pipeline
|
||||
virtual void addStage(EShLanguage stage) = 0;
|
||||
// Should return true if the resulting/current binding would be okay.
|
||||
// Basic idea is to do aliasing binding checks with this.
|
||||
virtual bool validateBinding(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
|
||||
// Should return a value >= 0 if the current binding should be overridden.
|
||||
// Return -1 if the current binding (including no binding) should be kept.
|
||||
virtual int resolveBinding(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
|
||||
// Should return a value >= 0 if the current set should be overridden.
|
||||
// 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 a value >= 0 if the current location should be overridden.
|
||||
// Return -1 if the current location (including no location) should be kept.
|
||||
virtual int resolveUniformLocation(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
|
||||
// Should return true if the resulting/current setup would be okay.
|
||||
// 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 overridden.
|
||||
// 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 overridden.
|
||||
// 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 overridden.
|
||||
// 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;
|
||||
// Notification of a uniform variable
|
||||
virtual void notifyBinding(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
|
||||
// Notification of a in or out variable
|
||||
virtual void notifyInOut(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
|
||||
// Called by mapIO when it has finished the notify pass
|
||||
virtual void endNotifications(EShLanguage stage) = 0;
|
||||
// Called by mapIO when it starts its notify pass for the given stage
|
||||
virtual void beginNotifications(EShLanguage stage) = 0;
|
||||
// Called by mipIO when it starts its resolve pass for the given stage
|
||||
virtual void beginResolve(EShLanguage stage) = 0;
|
||||
// Called by mapIO when it has finished the resolve pass
|
||||
virtual void endResolve(EShLanguage stage) = 0;
|
||||
};
|
||||
|
||||
// Make one TProgram per set of shaders that will get linked together. Add all
|
||||
|
|
@ -835,7 +824,7 @@ public:
|
|||
// I/O mapping: apply base offsets and map live unbound variables
|
||||
// If resolver is not provided it uses the previous approach
|
||||
// and respects auto assignment and offsets.
|
||||
bool mapIO(TIoMapResolver* pResolver = nullptr, TIoMapper* pIoMapper = nullptr);
|
||||
bool mapIO(TIoMapResolver* resolver = NULL);
|
||||
|
||||
protected:
|
||||
bool linkStage(EShLanguage, EShMessages);
|
||||
|
|
@ -846,6 +835,7 @@ protected:
|
|||
bool newedIntermediate[EShLangCount]; // track which intermediate were "new" versus reusing a singleton unit in a stage
|
||||
TInfoSink* infoSink;
|
||||
TReflection* reflection;
|
||||
TIoMapper* ioMapper;
|
||||
bool linked;
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue