From 916f21942cac1b456629af7860de1e8a7a62c997 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Mon, 11 Mar 2019 22:06:51 -0400 Subject: [PATCH] - Reverse the status bar offset when shearing the viewport in Vulkan - fixes the issue with a black bar at the top of the screen --- src/rendering/vulkan/renderer/vk_renderstate.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rendering/vulkan/renderer/vk_renderstate.cpp b/src/rendering/vulkan/renderer/vk_renderstate.cpp index b82237e630..edaca5e2d8 100644 --- a/src/rendering/vulkan/renderer/vk_renderstate.cpp +++ b/src/rendering/vulkan/renderer/vk_renderstate.cpp @@ -313,16 +313,16 @@ void VkRenderState::ApplyScissor() if (mScissorChanged) { VkRect2D scissor; + auto buffers = GetVulkanFrameBuffer()->GetBuffers(); if (mScissorWidth >= 0) { scissor.offset.x = mScissorX; - scissor.offset.y = mScissorY; + scissor.offset.y = buffers->GetHeight() - mScissorY - mViewportHeight; scissor.extent.width = mScissorWidth; scissor.extent.height = mScissorHeight; } else { - auto buffers = GetVulkanFrameBuffer()->GetBuffers(); scissor.offset.x = 0; scissor.offset.y = 0; scissor.extent.width = buffers->GetWidth(); @@ -338,16 +338,16 @@ void VkRenderState::ApplyViewport() if (mViewportChanged) { VkViewport viewport; + auto buffers = GetVulkanFrameBuffer()->GetBuffers(); if (mViewportWidth >= 0) { viewport.x = (float)mViewportX; - viewport.y = (float)mViewportY; + viewport.y = (float)buffers->GetHeight() - mViewportY - mViewportHeight; viewport.width = (float)mViewportWidth; viewport.height = (float)mViewportHeight; } else { - auto buffers = GetVulkanFrameBuffer()->GetBuffers(); viewport.x = 0.0f; viewport.y = 0.0f; viewport.width = (float)buffers->GetWidth();