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:
@@ -48,6 +48,7 @@ struct IoMapData {
|
||||
int baseTextureBinding;
|
||||
int baseUboBinding;
|
||||
bool autoMapBindings;
|
||||
bool flattenUniforms;
|
||||
};
|
||||
|
||||
std::string FileNameAsCustomTestSuffixIoMap(
|
||||
@@ -119,7 +120,8 @@ TEST_P(HlslSemantics, FromFile)
|
||||
GetParam().baseSamplerBinding,
|
||||
GetParam().baseTextureBinding,
|
||||
GetParam().baseUboBinding,
|
||||
GetParam().autoMapBindings);
|
||||
GetParam().autoMapBindings,
|
||||
GetParam().flattenUniforms);
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
@@ -251,8 +253,9 @@ INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
Hlsl, HlslSemantics,
|
||||
::testing::ValuesIn(std::vector<IoMapData>{
|
||||
{ "spv.register.autoassign.frag", "main_ep", 5, 10, 15, true },
|
||||
{ "spv.register.noautoassign.frag", "main_ep", 5, 10, 15, false },
|
||||
{ "spv.register.autoassign.frag", "main_ep", 5, 10, 15, true, false },
|
||||
{ "spv.register.noautoassign.frag", "main_ep", 5, 10, 15, false, false },
|
||||
{ "spv.register.autoassign-2.frag", "main", 5, 10, 15, true, true },
|
||||
}),
|
||||
FileNameAsCustomTestSuffixIoMap
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user