From 1929f434aa986fdc749814bfbccfc300ea239c68 Mon Sep 17 00:00:00 2001 From: John Goetz Date: Wed, 4 Jun 2025 11:05:21 -0700 Subject: [PATCH] use rendergraph renderArea as scissor instead of viewport viewport is used to determine aspect ratio and should be allowed to go outside of the rendering area. The scissor is used to clip the rendered scene to a smaller visible region and should not change any rendering with respect to the camera. --- src/vsg/app/RenderGraph.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vsg/app/RenderGraph.cpp b/src/vsg/app/RenderGraph.cpp index 7839cc866f..e55f04d9d1 100644 --- a/src/vsg/app/RenderGraph.cpp +++ b/src/vsg/app/RenderGraph.cpp @@ -49,7 +49,8 @@ RenderGraph::RenderGraph(ref_ptr in_window, ref_ptr in_view) : renderArea.extent = window->extent2D(); } - viewportState->set(renderArea.offset.x, renderArea.offset.y, renderArea.extent.width, renderArea.extent.height); + viewportState->scissors.resize(1); + viewportState->scissors[0] = renderArea; // set up the clearValues based on the RenderPass's attachments. setClearValues(window->clearColor(), VkClearDepthStencilValue{0.0f, 0}); @@ -150,7 +151,8 @@ void RenderGraph::accept(RecordTraversal& recordTraversal) const vkCmdBeginRenderPass(vk_commandBuffer, &renderPassInfo, contents); // sync the viewportState and push - viewportState->set(renderArea.offset.x, renderArea.offset.y, renderArea.extent.width, renderArea.extent.height); + viewportState->scissors.resize(1); + viewportState->scissors[0] = renderArea; if ((viewportStateHint & DYNAMIC_VIEWPORTSTATE)) {