mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-03 17:42:41 +08:00
pipeline changes after v3.7.3 (#14998)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user