ATOM-15935 Adding draw to pass support to DynamicDrawContext (#2248)

The DynamicDrawContext can output to different scopes: Scene, RenderPipeline or RasterPass.
Updated RasterPass so it can handle not only draw calls from Views but also from DynamicDrawContexts.
This commit is contained in:
Qing Tao
2021-07-19 10:03:59 -07:00
committed by GitHub
parent b01cd0c788
commit 9053079a56
10 changed files with 261 additions and 101 deletions
@@ -83,7 +83,7 @@ namespace AZ::AtomBridge
ViewportData& viewportData = m_viewportData[viewportId];
for (auto& context : viewportData.m_dynamicDrawContexts)
{
context.second->SetRenderPipeline(pipeline.get());
context.second->SetOutputScope(pipeline.get());
}
});
viewportData.m_viewportDestroyedHandler = AZ::Event<AzFramework::ViewportId>::Handler([this, viewportId](AzFramework::ViewportId id)
@@ -106,7 +106,8 @@ namespace AZ::AtomBridge
{
return nullptr;
}
context = RPI::DynamicDrawInterface::Get()->CreateDynamicDrawContext(pipeline);
context = RPI::DynamicDrawInterface::Get()->CreateDynamicDrawContext();
context->SetOutputScope(pipeline);
contextFactoryIt->second(context);
}