Skip to content

Commit

Permalink
Use renderArea instead of full window when compiling RenderGraph
Browse files Browse the repository at this point in the history
Use renderArea of RenderGraph instead of the full window/framebuffer extent when creating the compile-context default viewportstate

Nominally, Views are above RenderGraphs in VSG scene graphs, however when a View that takes up a subset of the window/framebuffer extent contains individual RenderGraphs, the recorded default renderArea (viewportstate) was incorrect and resulted in the scene being drawn to the entire window area, but scissored to the render graphs renderArea. This change ensures that the default viewportstate is consistent with the rendergraph being compiled.
  • Loading branch information
theodoregoetz committed Dec 6, 2024
1 parent 7cd17a2 commit 322f2ad
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/vsg/app/CompileTraversal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,14 +387,9 @@ void CompileTraversal::apply(RenderGraph& renderGraph)
auto previousOverridePipelineStates = context->overridePipelineStates;

context->renderPass = renderGraph.getRenderPass();
if (renderGraph.window)
{
mergeGraphicsPipelineStates(context->mask, context->defaultPipelineStates, ViewportState::create(renderGraph.window->extent2D()));
}
else if (renderGraph.framebuffer)
{
mergeGraphicsPipelineStates(context->mask, context->defaultPipelineStates, ViewportState::create(renderGraph.framebuffer->extent2D()));
}
auto const& ra = renderGraph.renderArea;
mergeGraphicsPipelineStates(context->mask, context->defaultPipelineStates,
ViewportState::create(ra.offset.x, ra.offset.y, ra.extent.width, ra.extent.height));

if (context->renderPass)
{
Expand Down

0 comments on commit 322f2ad

Please sign in to comment.