From 60a39805615fb0480eb57416f5e9ec17e7c91ce4 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Thu, 23 Sep 2021 03:14:10 +0200 Subject: Vulkan Rasterizer: Correct DepthBias/PolygonOffset on Vulkan. --- src/video_core/vulkan_common/vulkan_device.cpp | 4 ++++ src/video_core/vulkan_common/vulkan_device.h | 5 +++++ 2 files changed, 9 insertions(+) (limited to 'src/video_core/vulkan_common') diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index c2ec9f76a..3a048900b 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -618,6 +618,10 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR is_float16_supported = false; } + supports_d24_depth = + IsFormatSupported(VK_FORMAT_D24_UNORM_S8_UINT, + VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, FormatType::Optimal); + graphics_queue = logical.GetQueue(graphics_family); present_queue = logical.GetQueue(present_family); } diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index bc180a32a..f14e4001e 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -327,6 +327,10 @@ public: return sets_per_pool; } + bool SupportsD24DepthBuffer() const { + return supports_d24_depth; + } + private: /// Checks if the physical device is suitable. void CheckSuitability(bool requires_swapchain) const; @@ -419,6 +423,7 @@ private: bool nv_device_diagnostics_config{}; ///< Support for VK_NV_device_diagnostics_config. bool has_renderdoc{}; ///< Has RenderDoc attached bool has_nsight_graphics{}; ///< Has Nsight Graphics attached + bool supports_d24_depth{}; ///< Supports D24 depth buffers. // Telemetry parameters std::string vendor_name; ///< Device's driver name. -- cgit v1.2.3