Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the refresh rate precision. (AMDVLK #268) #177

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions icd/api/vk_physical_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9474,7 +9474,7 @@ VkResult PhysicalDevice::GetDisplayModeProperties(
// The refresh rate returned by pal is HZ.
// Spec requires refresh rate to be "the number of times the display is refreshed each second
// multiplied by 1000", in other words, HZ * 1000
properties[i].parameters.refreshRate = pScreenMode[i]->refreshRate * 1000;
properties[i].parameters.refreshRate = (pScreenMode[i]->refreshRate.numerator * 1.0f / pScreenMode[i]->refreshRate.denominator) * 1000;
}

*pPropertyCount = loopCount;
Expand Down Expand Up @@ -9538,7 +9538,7 @@ VkResult PhysicalDevice::CreateDisplayMode(
// The modes are considered as identical if the dimension as well as the refresh rate are the same.
if ((pCreateInfo->parameters.visibleRegion.width == pScreenMode[i]->extent.width) &&
(pCreateInfo->parameters.visibleRegion.height == pScreenMode[i]->extent.height) &&
(pCreateInfo->parameters.refreshRate == pScreenMode[i]->refreshRate * 1000))
(pCreateInfo->parameters.refreshRate == (pScreenMode[i]->refreshRate.numerator * 1.0f / pScreenMode[i]->refreshRate.denominator) * 1000))
{
isValidMode = true;
break;
Expand Down Expand Up @@ -9569,7 +9569,8 @@ VkResult PhysicalDevice::CreateDisplayMode(
{
pNewMode->palScreenMode.extent.width = pCreateInfo->parameters.visibleRegion.width;
pNewMode->palScreenMode.extent.height = pCreateInfo->parameters.visibleRegion.height;
pNewMode->palScreenMode.refreshRate = pCreateInfo->parameters.refreshRate;
pNewMode->palScreenMode.refreshRate.numerator = pCreateInfo->parameters.refreshRate;
pNewMode->palScreenMode.refreshRate.denominator = 1000;
pNewMode->palScreenMode.flags.u32All = 0;
pNewMode->pScreen = pScreen;
*pMode = reinterpret_cast<VkDisplayModeKHR>(pNewMode);
Expand Down
Loading