From 4ec57381190d632e56d4b56b2a0f1ec7d80d1446 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sun, 22 Apr 2018 22:10:22 -0700 Subject: Fixed Vulkan clip space using viewport inversion & VK_KHR_MAINTENANCE1_EXTENSION_NAME --- Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp | 4 ++-- Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp index ea131505..fb6bff25 100644 --- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp @@ -775,9 +775,9 @@ namespace Diligent for( Uint32 vp = 0; vp < m_NumViewports; ++vp ) { VkViewports[vp].x = m_Viewports[vp].TopLeftX; - VkViewports[vp].y = m_Viewports[vp].TopLeftY; + VkViewports[vp].y = m_FramebufferHeight - m_Viewports[vp].TopLeftY; VkViewports[vp].width = m_Viewports[vp].Width; - VkViewports[vp].height = m_Viewports[vp].Height; + VkViewports[vp].height = -m_Viewports[vp].Height; VkViewports[vp].minDepth = m_Viewports[vp].MinDepth; VkViewports[vp].maxDepth = m_Viewports[vp].MaxDepth; } diff --git a/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp b/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp index 47300c06..2cfab085 100644 --- a/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp +++ b/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp @@ -160,7 +160,11 @@ void EngineFactoryVkImpl::CreateDeviceAndContextsVk( const EngineVkAttribs& Crea DeviceCreateInfo.pEnabledFeatures = &DeviceFeatures; // NULL or a pointer to a VkPhysicalDeviceFeatures structure that contains // boolean indicators of all the features to be enabled. - std::vector DeviceExtensions = { VK_KHR_SWAPCHAIN_EXTENSION_NAME }; + std::vector DeviceExtensions = + { + VK_KHR_SWAPCHAIN_EXTENSION_NAME, + VK_KHR_MAINTENANCE1_EXTENSION_NAME // To allow negative viewport height + }; const bool DebugMarkersSupported = PhysicalDevice->IsExtensionSupported(VK_EXT_DEBUG_MARKER_EXTENSION_NAME); if (DebugMarkersSupported && CreationAttribs.EnableValidation) { -- cgit v1.2.3