1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-19 05:52:11 +01:00

[vulkan] Add supportsColorSpace method to Presenter

This commit is contained in:
Joshua Ashton 2022-12-18 22:59:20 +00:00 committed by Philip Rebohle
parent fd661d587e
commit 50054d4675
2 changed files with 21 additions and 0 deletions

View File

@ -220,6 +220,19 @@ namespace dxvk::vk {
} }
bool Presenter::supportsColorSpace(VkColorSpaceKHR colorspace) {
std::vector<VkSurfaceFormatKHR> 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) { void Presenter::setFrameRateLimit(double frameRate) {
m_fpsLimiter.setTargetFrameRate(frameRate); m_fpsLimiter.setTargetFrameRate(frameRate);
} }

View File

@ -183,6 +183,14 @@ namespace dxvk::vk {
return m_swapchain; 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: private:
Rc<InstanceFn> m_vki; Rc<InstanceFn> m_vki;