mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 14:52:10 +01:00
[vulkan] Add supportsColorSpace method to Presenter
This commit is contained in:
parent
fd661d587e
commit
50054d4675
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user