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
|
|
@ -434,7 +434,7 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver
|
|||
|
||||
return 0;
|
||||
}
|
||||
int resolveUniformLocation(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool /*is_live*/) override
|
||||
int resolveUniformLocation(EShLanguage /*stage*/, const char* name, const glslang::TType& type, bool /*is_live*/) override
|
||||
{
|
||||
// kick out of not doing this
|
||||
if (!doAutoLocationMapping())
|
||||
|
|
@ -455,7 +455,11 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver
|
|||
return -1;
|
||||
}
|
||||
|
||||
int location = nextUniformLocation;
|
||||
int location = intermediate.getUniformLocationOverride(name);
|
||||
if (location != -1)
|
||||
return location;
|
||||
|
||||
location = nextUniformLocation;
|
||||
|
||||
nextUniformLocation += TIntermediate::computeTypeUniformLocationSize(type);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue