mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-02 22:29:21 +00:00
Force 60fps
This commit is contained in:
parent
c4d9d175e8
commit
32c64e4fda
1 changed files with 21 additions and 3 deletions
|
@ -69,16 +69,34 @@ VkSurfaceKHR SwapChain::CreateVulkanSurface(VkInstance instance, VkPhysicalDevic
|
||||||
return VK_NULL_HANDLE;
|
return VK_NULL_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
VkDisplayModePropertiesKHR mode_props;
|
auto *all_mode_props = static_cast<VkDisplayModePropertiesKHR*>(calloc(mode_count, sizeof(*all_mode_props)));
|
||||||
mode_count = 1;
|
|
||||||
if (VkResult err = vkGetDisplayModePropertiesKHR(physical_device, display_props.display,
|
if (VkResult err = vkGetDisplayModePropertiesKHR(physical_device, display_props.display,
|
||||||
&mode_count, &mode_props);
|
&mode_count, all_mode_props);
|
||||||
err != VK_SUCCESS && err != VK_INCOMPLETE)
|
err != VK_SUCCESS && err != VK_INCOMPLETE)
|
||||||
{
|
{
|
||||||
LOG_VULKAN_ERROR(err, "vkGetDisplayModePropertiesKHR failed: ");
|
LOG_VULKAN_ERROR(err, "vkGetDisplayModePropertiesKHR failed: ");
|
||||||
return VK_NULL_HANDLE;
|
return VK_NULL_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < mode_count; ++i)
|
||||||
|
{
|
||||||
|
VkDisplayModeParametersKHR *params = &all_mode_props[i].parameters;
|
||||||
|
printf("Mode %d: %d x %d (%.2f fps)\n", i,
|
||||||
|
params->visibleRegion.width, params->visibleRegion.height,
|
||||||
|
static_cast<float>(params->refreshRate) / 1000.0f);
|
||||||
|
|
||||||
|
if (params->refreshRate < 60000)
|
||||||
|
{
|
||||||
|
printf("Removing mode %d\n", i);
|
||||||
|
mode_count--;
|
||||||
|
for (int j = i; j < mode_count; ++j)
|
||||||
|
all_mode_props[j] = all_mode_props[j + 1];
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
VkDisplayModePropertiesKHR mode_props = all_mode_props[0];
|
||||||
|
|
||||||
// Get the list of planes
|
// Get the list of planes
|
||||||
uint32_t plane_count = 0;
|
uint32_t plane_count = 0;
|
||||||
if (VkResult err =
|
if (VkResult err =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue