diff --git a/src/vulkan/vulkan_presenter.cpp b/src/vulkan/vulkan_presenter.cpp index 0a10676ea..5bcebfaec 100644 --- a/src/vulkan/vulkan_presenter.cpp +++ b/src/vulkan/vulkan_presenter.cpp @@ -220,6 +220,19 @@ namespace dxvk::vk { } + bool Presenter::supportsColorSpace(VkColorSpaceKHR colorspace) { + std::vector surfaceFormats; + getSupportedFormats(surfaceFormats, VK_FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT); + + for (const auto& surfaceFormat : surfaceFormats) { + if (surfaceFormat.colorSpace == colorspace) + return true; + } + + return false; + } + + void Presenter::setFrameRateLimit(double frameRate) { m_fpsLimiter.setTargetFrameRate(frameRate); } diff --git a/src/vulkan/vulkan_presenter.h b/src/vulkan/vulkan_presenter.h index 170d81c38..0de46d44c 100644 --- a/src/vulkan/vulkan_presenter.h +++ b/src/vulkan/vulkan_presenter.h @@ -183,6 +183,14 @@ namespace dxvk::vk { return m_swapchain; } + /** + * \brief Checks if a presenter supports the colorspace + * + * \param [in] colorspace The colorspace to test + * * \returns \c true if the presenter supports the colorspace + */ + bool supportsColorSpace(VkColorSpaceKHR colorspace); + private: Rc m_vki;