pipeline changes after v3.7.3 (#14998)

This commit is contained in:
hyde zhou
2023-05-10 17:46:45 +08:00
committed by GitHub
parent 98a6965042
commit 6cbad38241
47 changed files with 2816 additions and 1587 deletions
@@ -201,7 +201,6 @@ ShaderProgramData &buildProgramData(
auto shaderID = static_cast<uint32_t>(phase.shaderPrograms.size());
phase.shaderIndex.emplace(programName, shaderID);
auto &programData = phase.shaderPrograms.emplace_back();
// build per-batch
{
auto res = programData.layout.descriptorSets.emplace(
@@ -832,6 +831,11 @@ std::pair<uint32_t, uint32_t> findBinding(
return std::pair{v.set, v.binding};
}
}
for (const auto &v : shaderInfo.subpassInputs) {
if (v.name == name) {
return std::pair{v.set, v.binding};
}
}
CC_EXPECTS(false);
return {};
}
@@ -911,6 +915,14 @@ void overwriteShaderSourceBinding(
newLayout.append(std::to_string(set));
newLayout.append(", binding = ");
newLayout.append(std::to_string(binding));
auto inputIndex = prevLayout.find("input_attachment_index");
if (inputIndex != ccstd::string::npos) {
newLayout.append(", ");
auto endIndex = prevLayout.find_first_of(",)", inputIndex + 1);
newLayout.append(prevLayout.data(), inputIndex, endIndex - inputIndex);
}
newLayout.append(")");
// replace layout expression
@@ -930,14 +942,6 @@ void overwriteShaderSourceBinding(
end += offset;
// find next uniform
pos = source.find(" uniform ", end);
auto exceptionPos = source.find(" uniform subpassInput ", end);
if (exceptionPos != ccstd::string::npos) {
while (pos == exceptionPos) {
end += strlen(" uniform subpassInput ");
pos = source.find(" uniform ", end);
exceptionPos = source.find(" uniform subpassInput ", end);
}
}
}
}