Restrict uniform array flattening to sampler and texture arrays.
Previously the uniform array flattening feature would trigger on loose uniform arrays of any basic type (e.g, floats). This PR restricts it to sampler and texture arrays. Other arrays would end up in their own uniform block (anonymous or otherwise). (Atomic counter arrays might be an exception, but those are not currently flattened).
This commit is contained in:
parent
21e7e32126
commit
bc9b7656b7
2 changed files with 4 additions and 2 deletions
|
|
@ -736,7 +736,9 @@ bool HlslParseContext::shouldFlattenUniform(const TType& type) const
|
|||
|
||||
return type.isArray() &&
|
||||
intermediate.getFlattenUniformArrays() &&
|
||||
qualifier == EvqUniform;
|
||||
qualifier == EvqUniform &&
|
||||
// Testing the EbtSampler basic type covers samplers and textures
|
||||
type.getBasicType() == EbtSampler;
|
||||
}
|
||||
|
||||
void HlslParseContext::flatten(const TSourceLoc& loc, const TVariable& variable)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue