From 525f5aa7f6954b8b18c187c0eeeb2d0521842461 Mon Sep 17 00:00:00 2001 From: redstrate <54911369+redstrate@users.noreply.github.com> Date: Wed, 23 Sep 2020 12:21:15 -0400 Subject: [PATCH] Flip vulkan viewport --- engine/gfx/vulkan/src/gfx_vulkan.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/engine/gfx/vulkan/src/gfx_vulkan.cpp b/engine/gfx/vulkan/src/gfx_vulkan.cpp index e97c9ef..56fb670 100755 --- a/engine/gfx/vulkan/src/gfx_vulkan.cpp +++ b/engine/gfx/vulkan/src/gfx_vulkan.cpp @@ -86,7 +86,6 @@ VkBlendFactor toVkFactor(GFXBlendFactor factor) { return VK_BLEND_FACTOR_ONE; } - VKAPI_ATTR VkBool32 VKAPI_CALL DebugCallback( VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageType, @@ -835,8 +834,9 @@ void GFXVulkan::submit(GFXCommandBuffer* command_buffer, const int identifier) { renderPassInfo.framebuffer = framebuffer->handle; VkViewport viewport = {}; + viewport.y = static_cast(framebuffer->height); viewport.width = static_cast(framebuffer->width); - viewport.height = static_cast(framebuffer->height); + viewport.height = -static_cast(framebuffer->height); viewport.maxDepth = 1.0f; vkCmdSetViewport(commandBuffers[imageIndex], 0, 1, &viewport); @@ -851,8 +851,9 @@ void GFXVulkan::submit(GFXCommandBuffer* command_buffer, const int identifier) { renderPassInfo.framebuffer = swapchainFramebuffers[imageIndex]; VkViewport viewport = {}; + viewport.y = static_cast(surfaceHeight); viewport.width = static_cast(surfaceWidth); - viewport.height = static_cast(surfaceHeight); + viewport.height = -static_cast(surfaceHeight); viewport.maxDepth = 1.0f; vkCmdSetViewport(commandBuffers[imageIndex], 0, 1, &viewport);