Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/renderer/Renderer.cpp
Show First 20 Lines • Show All 476 Lines • ▼ Show 20 Lines | if (postprocManager.IsEnabled()) | ||||
m->sceneRenderer.GetViewCamera().GetNearPlane(), | m->sceneRenderer.GetViewCamera().GetNearPlane(), | ||||
m->sceneRenderer.GetViewCamera().GetFarPlane() | m->sceneRenderer.GetViewCamera().GetFarPlane() | ||||
); | ); | ||||
postprocManager.Initialize(); | postprocManager.Initialize(); | ||||
postprocManager.CaptureRenderOutput(m->deviceCommandContext.get()); | postprocManager.CaptureRenderOutput(m->deviceCommandContext.get()); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
// We don't need to clear the color attachment of the framebuffer as the sky | |||||
// is going to be rendered anyway. | |||||
m->deviceCommandContext->BeginFramebufferPass( | m->deviceCommandContext->BeginFramebufferPass( | ||||
m->deviceCommandContext->GetDevice()->GetCurrentBackbuffer()); | m->deviceCommandContext->GetDevice()->GetCurrentBackbuffer( | ||||
Renderer::Backend::AttachmentLoadOp::DONT_CARE, | |||||
Renderer::Backend::AttachmentStoreOp::STORE, | |||||
Renderer::Backend::AttachmentLoadOp::CLEAR, | |||||
Renderer::Backend::AttachmentStoreOp::DONT_CARE)); | |||||
} | } | ||||
g_Game->GetView()->Render(m->deviceCommandContext.get()); | g_Game->GetView()->Render(m->deviceCommandContext.get()); | ||||
if (postprocManager.IsEnabled()) | if (postprocManager.IsEnabled()) | ||||
{ | { | ||||
m->deviceCommandContext->EndFramebufferPass(); | m->deviceCommandContext->EndFramebufferPass(); | ||||
if (postprocManager.IsMultisampleEnabled()) | if (postprocManager.IsMultisampleEnabled()) | ||||
postprocManager.ResolveMultisampleFramebuffer(m->deviceCommandContext.get()); | postprocManager.ResolveMultisampleFramebuffer(m->deviceCommandContext.get()); | ||||
postprocManager.ApplyPostproc(m->deviceCommandContext.get()); | postprocManager.ApplyPostproc(m->deviceCommandContext.get()); | ||||
postprocManager.ReleaseRenderOutput(m->deviceCommandContext.get()); | |||||
m->deviceCommandContext->BeginFramebufferPass( | Renderer::Backend::IFramebuffer* backbuffer = | ||||
m->deviceCommandContext->GetDevice()->GetCurrentBackbuffer()); | m->deviceCommandContext->GetDevice()->GetCurrentBackbuffer( | ||||
Renderer::Backend::AttachmentLoadOp::LOAD, | |||||
Renderer::Backend::AttachmentStoreOp::STORE, | |||||
Renderer::Backend::AttachmentLoadOp::LOAD, | |||||
Renderer::Backend::AttachmentStoreOp::DONT_CARE); | |||||
postprocManager.ReleaseRenderOutput( | |||||
m->deviceCommandContext.get(), backbuffer); | |||||
m->deviceCommandContext->BeginFramebufferPass(backbuffer); | |||||
} | } | ||||
g_Game->GetView()->RenderOverlays(m->deviceCommandContext.get()); | g_Game->GetView()->RenderOverlays(m->deviceCommandContext.get()); | ||||
g_Game->GetView()->GetCinema()->Render(); | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
// We have a fullscreen background in our UI so we don't need | |||||
// to clear the color attachment. | |||||
// We don't need a depth test to render so we don't care about the | |||||
// depth-stencil attachment content. | |||||
m->deviceCommandContext->BeginFramebufferPass( | m->deviceCommandContext->BeginFramebufferPass( | ||||
m->deviceCommandContext->GetDevice()->GetCurrentBackbuffer()); | m->deviceCommandContext->GetDevice()->GetCurrentBackbuffer( | ||||
Renderer::Backend::AttachmentLoadOp::DONT_CARE, | |||||
Renderer::Backend::AttachmentStoreOp::STORE, | |||||
Renderer::Backend::AttachmentLoadOp::DONT_CARE, | |||||
Renderer::Backend::AttachmentStoreOp::DONT_CARE)); | |||||
} | } | ||||
// If we're in Atlas game view, render special tools | // If we're in Atlas game view, render special tools | ||||
if (g_AtlasGameLoop && g_AtlasGameLoop->view) | if (g_AtlasGameLoop && g_AtlasGameLoop->view) | ||||
{ | { | ||||
g_AtlasGameLoop->view->DrawCinemaPathTool(); | g_AtlasGameLoop->view->DrawCinemaPathTool(); | ||||
} | } | ||||
if (g_Game && g_Game->IsGameStarted()) | |||||
{ | |||||
g_Game->GetView()->GetCinema()->Render(); | |||||
} | |||||
RenderFrame2D(renderGUI, renderLogger); | RenderFrame2D(renderGUI, renderLogger); | ||||
m->deviceCommandContext->EndFramebufferPass(); | m->deviceCommandContext->EndFramebufferPass(); | ||||
EndFrame(); | EndFrame(); | ||||
const Stats& stats = GetStats(); | const Stats& stats = GetStats(); | ||||
PROFILE2_ATTR("draw calls: %zu", stats.m_DrawCalls); | PROFILE2_ATTR("draw calls: %zu", stats.m_DrawCalls); | ||||
▲ Show 20 Lines • Show All 306 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator