Add a command-line option to override uniform locations
This commit is contained in:
parent
4508a8170a
commit
16f53474c8
5 changed files with 54 additions and 2 deletions
|
|
@ -671,6 +671,20 @@ public:
|
|||
void addProcessArgument(const std::string& arg) { processes.addArgument(arg); }
|
||||
const std::vector<std::string>& getProcesses() const { return processes.getProcesses(); }
|
||||
|
||||
void addUniformLocationOverride(const TString& name, int location)
|
||||
{
|
||||
uniformLocationOverrides[name] = location;
|
||||
}
|
||||
|
||||
int getUniformLocationOverride(const TString& name) const
|
||||
{
|
||||
auto pos = uniformLocationOverrides.find(name);
|
||||
if (pos == uniformLocationOverrides.end())
|
||||
return -1;
|
||||
else
|
||||
return pos->second;
|
||||
}
|
||||
|
||||
void setNeedsLegalization() { needToLegalize = true; }
|
||||
bool needsLegalization() const { return needToLegalize; }
|
||||
|
||||
|
|
@ -796,6 +810,8 @@ protected:
|
|||
bool needToLegalize;
|
||||
bool binaryDoubleOutput;
|
||||
|
||||
std::unordered_map<TString, int> uniformLocationOverrides;
|
||||
|
||||
private:
|
||||
void operator=(TIntermediate&); // prevent assignments
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue