Take into account the number of locations taken up by a uniform
When assigning uniform locations it now takes into account the number of locations occupied by the type. For uniforms, all types except arrays and structs take up one location. For arrays the base location count is multiplied by the array dimensions and for structs it is the sum of the locations of each member.
This commit is contained in:
parent
1fe4a44759
commit
2d53904999
3 changed files with 36 additions and 1 deletions
|
|
@ -443,7 +443,11 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver
|
|||
return -1;
|
||||
}
|
||||
|
||||
return nextUniformLocation++;
|
||||
int location = nextUniformLocation;
|
||||
|
||||
nextUniformLocation += TIntermediate::computeTypeUniformLocationSize(type);
|
||||
|
||||
return location;
|
||||
}
|
||||
bool validateInOut(EShLanguage /*stage*/, const char* /*name*/, const TType& /*type*/, bool /*is_live*/) override
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue