Skip to content
Permalink
Browse files

- Reverse the status bar offset when shearing the viewport in Vulkan …

…- fixes the issue with a black bar at the top of the screen
  • Loading branch information...
madame-rachelle committed Mar 12, 2019
1 parent f2a311d commit 916f21942cac1b456629af7860de1e8a7a62c997
Showing with 4 additions and 4 deletions.
  1. +4 −4 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();

0 comments on commit 916f219

Please sign in to comment.
You can’t perform that action at this time.