Merge pull request #527 from steve-lunarg/array-flattening-fix
HLSL: Restrict uniform array flattening to sampler and texture arrays
This commit is contained in:
commit
d4f48b8a5a
@ -941,7 +941,7 @@ void usage()
|
|||||||
" explicit bindings.\n"
|
" explicit bindings.\n"
|
||||||
" --amb synonym for --auto-map-bindings\n"
|
" --amb synonym for --auto-map-bindings\n"
|
||||||
"\n"
|
"\n"
|
||||||
" --flatten-uniform-arrays flatten uniform array references to scalars\n"
|
" --flatten-uniform-arrays flatten uniform texture & sampler arrays to scalars\n"
|
||||||
" --fua synonym for --flatten-uniform-arrays\n"
|
" --fua synonym for --flatten-uniform-arrays\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -736,7 +736,9 @@ bool HlslParseContext::shouldFlattenUniform(const TType& type) const
|
|||||||
|
|
||||||
return type.isArray() &&
|
return type.isArray() &&
|
||||||
intermediate.getFlattenUniformArrays() &&
|
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)
|
void HlslParseContext::flatten(const TSourceLoc& loc, const TVariable& variable)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user