Metal debug lines (#1888)

This commit is contained in:
Stefan Karschti
2023-11-28 07:51:18 +02:00
committed by GitHub
parent 634ce8089b
commit 178454bdba
2 changed files with 223 additions and 73 deletions

View File

@@ -159,6 +159,8 @@ void Renderer::Impl::render(const RenderTree& renderTree,
// Tweakers are run in the upload pass so they can set up uniforms.
orchestrator.visitLayerGroups(
[&](LayerGroupBase& layerGroup) { layerGroup.runTweakers(renderTree, parameters); });
orchestrator.visitDebugLayerGroups(
[&](LayerGroupBase& layerGroup) { layerGroup.runTweakers(renderTree, parameters); });
// Update the debug layer groups
orchestrator.updateDebugLayerGroups(renderTree, parameters);
@@ -324,7 +326,12 @@ void Renderer::Impl::render(const RenderTree& renderTree,
{
const auto debugGroup(parameters.renderPass->createDebugGroup("debug"));
orchestrator.visitDebugLayerGroups([&](LayerGroupBase& layerGroup) {
visitLayerGroupDrawables(layerGroup, [&](gfx::Drawable& drawable) { drawable.draw(parameters); });
visitLayerGroupDrawables(layerGroup, [&](gfx::Drawable& drawable) {
for (const auto& tweaker : drawable.getTweakers()) {
tweaker->execute(drawable, parameters);
}
drawable.draw(parameters);
});
});
}
};