Add an option to set the base uniform location
This will be used to generate uniform locations with --aml
This commit is contained in:
parent
16f53474c8
commit
b0f3d794c8
5 changed files with 22 additions and 2 deletions
|
|
@ -1763,6 +1763,10 @@ void TShader::addUniformLocationOverride(const char* name, int loc)
|
|||
{
|
||||
intermediate->addUniformLocationOverride(name, loc);
|
||||
}
|
||||
void TShader::setUniformLocationBase(int base)
|
||||
{
|
||||
intermediate->setUniformLocationBase(base);
|
||||
}
|
||||
// See comment above TDefaultHlslIoMapper in iomapper.cpp:
|
||||
void TShader::setHlslIoMapping(bool hlslIoMap) { intermediate->setHlslIoMapping(hlslIoMap); }
|
||||
void TShader::setFlattenUniformArrays(bool flatten) { intermediate->setFlattenUniformArrays(flatten); }
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver
|
|||
{
|
||||
TDefaultIoResolverBase(const TIntermediate &intermediate) :
|
||||
intermediate(intermediate),
|
||||
nextUniformLocation(0),
|
||||
nextUniformLocation(intermediate.getUniformLocationBase()),
|
||||
nextInputLocation(0),
|
||||
nextOutputLocation(0)
|
||||
{ }
|
||||
|
|
|
|||
|
|
@ -252,7 +252,8 @@ public:
|
|||
hlslIoMapping(false),
|
||||
textureSamplerTransformMode(EShTexSampTransKeep),
|
||||
needToLegalize(false),
|
||||
binaryDoubleOutput(false)
|
||||
binaryDoubleOutput(false),
|
||||
uniformLocationBase(0)
|
||||
{
|
||||
localSize[0] = 1;
|
||||
localSize[1] = 1;
|
||||
|
|
@ -685,6 +686,9 @@ public:
|
|||
return pos->second;
|
||||
}
|
||||
|
||||
void setUniformLocationBase(int base) { uniformLocationBase = base; }
|
||||
int getUniformLocationBase() const { return uniformLocationBase; }
|
||||
|
||||
void setNeedsLegalization() { needToLegalize = true; }
|
||||
bool needsLegalization() const { return needToLegalize; }
|
||||
|
||||
|
|
@ -811,6 +815,7 @@ protected:
|
|||
bool binaryDoubleOutput;
|
||||
|
||||
std::unordered_map<TString, int> uniformLocationOverrides;
|
||||
int uniformLocationBase;
|
||||
|
||||
private:
|
||||
void operator=(TIntermediate&); // prevent assignments
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue