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

vk: Add support for VK_EXT_custom_border_color #13901

Merged
merged 10 commits into from
May 23, 2023
Merged

Conversation

kd-11
Copy link
Contributor

@kd-11 kd-11 commented May 22, 2023

Turns out some games are really using some unusual border colors (e.g transparent white)
Previous fallback will still exist in case of GPUs without support for this.
Also includes a refactor of how we handle optional features, so that a migration up is easier if we decide to raise our base vulkan version to 1.1 or higher.

Fixes #12451

@@ -286,7 +286,7 @@ namespace vk
vk::gpu_debug_marker::insert(
*m_device,
*m_cb,
fmt::format("0x%x: Enter %s", m_tag, m_message)
fmt::format("0x%llx: Enter %s", m_tag, m_message)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fmt::format doesn't care about these primitive prefixes iirc,

@Darkhost1999
Copy link
Contributor

Infamous master
image
Infamous PR
image
No more purple border 😃

rpcs3/Emu/RSX/VK/vkutils/device.cpp Outdated Show resolved Hide resolved
{
if ((color4.r + color4.g + color4.b) > 1.35f)
{
//If color elements are brighter than roughly 0.5 average, use white border
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//If color elements are brighter than roughly 0.5 average, use white border
// If color elements are brighter than roughly 0.5 average, use white border

als0, why 0.5 ? it's 1.35 above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's about 0.45, though the target is 0.5 with a factor. I must have changed it to fix some game many years ago and forgot to update the comment.

rpcs3/Emu/RSX/VK/vkutils/sampler.cpp Show resolved Hide resolved
info.borderColor = border_color;
info.borderColor = border_color.value;

VkSamplerCustomBorderColorCreateInfoEXT custom_color_info;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't this warn about initialization?

Copy link
Contributor Author

@kd-11 kd-11 May 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. All compilers are smart enough to see it is initialized before use.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The compiler". Which one xD

rpcs3/Emu/RSX/VK/vkutils/sampler.cpp Show resolved Hide resolved
rpcs3/Emu/RSX/VK/vkutils/sampler.cpp Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Text glitch in Ratchet & Clank Future: ToD and in Ratchet & Clank Future: QfB
4 participants