Skip to content

Commit 14a3be1

Browse files
committed
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.
1 parent 504ec2d commit 14a3be1

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/vsg/app/CompileTraversal.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -387,14 +387,9 @@ void CompileTraversal::apply(RenderGraph& renderGraph)
387387
auto previousOverridePipelineStates = context->overridePipelineStates;
388388

389389
context->renderPass = renderGraph.getRenderPass();
390-
if (renderGraph.window)
391-
{
392-
mergeGraphicsPipelineStates(context->mask, context->defaultPipelineStates, ViewportState::create(renderGraph.window->extent2D()));
393-
}
394-
else if (renderGraph.framebuffer)
395-
{
396-
mergeGraphicsPipelineStates(context->mask, context->defaultPipelineStates, ViewportState::create(renderGraph.framebuffer->extent2D()));
397-
}
390+
auto const& ra = renderGraph.renderArea;
391+
mergeGraphicsPipelineStates(context->mask, context->defaultPipelineStates,
392+
ViewportState::create(ra.offset.x, ra.offset.y, ra.extent.width, ra.extent.height));
398393

399394
if (context->renderPass)
400395
{

0 commit comments

Comments
 (0)