Fix defects in uniform array flattening
Fix for two defects as follows: - The IO mapping traverser was not setting inVisit, and would skip some AST nodes. Depending on the order of nodes, this could have prevented the binding from showing up in the generated SPIR-V. - If a uniform array was flattened, each of the flattened scalars from the array is still a (now-scalar) uniform. It was being converted to a temporary.
This commit is contained in:
@@ -248,7 +248,8 @@ public:
|
||||
int baseSamplerBinding,
|
||||
int baseTextureBinding,
|
||||
int baseUboBinding,
|
||||
bool autoMapBindings)
|
||||
bool autoMapBindings,
|
||||
bool flattenUniformArrays)
|
||||
{
|
||||
const EShLanguage kind = GetShaderStage(GetSuffix(shaderName));
|
||||
|
||||
@@ -257,6 +258,7 @@ public:
|
||||
shader.setShiftTextureBinding(baseTextureBinding);
|
||||
shader.setShiftUboBinding(baseUboBinding);
|
||||
shader.setAutoMapBindings(autoMapBindings);
|
||||
shader.setFlattenUniformArrays(flattenUniformArrays);
|
||||
|
||||
bool success = compile(&shader, code, entryPointName, controls);
|
||||
|
||||
@@ -433,7 +435,8 @@ public:
|
||||
int baseSamplerBinding,
|
||||
int baseTextureBinding,
|
||||
int baseUboBinding,
|
||||
bool autoMapBindings)
|
||||
bool autoMapBindings,
|
||||
bool flattenUniformArrays)
|
||||
{
|
||||
const std::string inputFname = testDir + "/" + testName;
|
||||
const std::string expectedOutputFname =
|
||||
@@ -446,7 +449,8 @@ public:
|
||||
const EShMessages controls = DeriveOptions(source, semantics, target);
|
||||
GlslangResult result = compileLinkIoMap(testName, input, entryPointName, controls,
|
||||
baseSamplerBinding, baseTextureBinding, baseUboBinding,
|
||||
autoMapBindings);
|
||||
autoMapBindings,
|
||||
flattenUniformArrays);
|
||||
|
||||
// Generate the hybrid output in the way of glslangValidator.
|
||||
std::ostringstream stream;
|
||||
|
||||
Reference in New Issue
Block a user