Skip to content

Vulkan: Replace Vulkan 1.0 functionality with 1.1 counterparts#13546

Draft
TheTechnician27 wants to merge 1 commit intoPCSX2:masterfrom
TheTechnician27:vulkan
Draft

Vulkan: Replace Vulkan 1.0 functionality with 1.1 counterparts#13546
TheTechnician27 wants to merge 1 commit intoPCSX2:masterfrom
TheTechnician27:vulkan

Conversation

@TheTechnician27
Copy link
Copy Markdown
Contributor

@TheTechnician27 TheTechnician27 commented Nov 16, 2025

Description of Changes

  • Replaces superseded Vulkan 1.0 functionality with 1.1 counterparts per the Devices and Queues portion of Vulkan's specification.
  • In VKEntryPoints.inl, removes now-unused entry points.
    • These Vulkan 1.0 entry points should not be used in our codebase in the future.
    • Kept vkGetPhysicalDeviceProperties and vkGetPhysicalDeviceMemoryProperties because /3rdparty/vulkan/include uses them, and thus PCSX2 will not compile without them.

This should not impact accuracy or performance in any way, and there's almost no chance it resolves any bugs. This is just housekeeping, and anything else is gravy.

Rationale behind Changes

Decided to investigate a crash PCSX2 has when Windows machines with really outdated Vulkan drivers crash when loading the Settings window. After a while of not finding anything in the code, I decided to look at the Vulkan documentation. There isn't a snowball's chance in hell this PR fixes that, and I and have no way to reproduce it to test. Nevertheless, the documentation very clearly says we should be using the 1.1 versions of various structs and functions used in GSDeviceVK.cpp. As an example:

VK_KHR_get_physical_device_properties2 was incorporated into Vulkan 1.1, which introduced new versions of several physical device query functions. These provide the same functionality as the Vulkan 1.0 functionality but with greater extensibility.

When querying device features, vkGetPhysicalDeviceFeatures2 should be used instead of vkGetPhysicalDeviceFeatures. When enabling device features, VkPhysicalDeviceFeatures2 should be provided in the pNext chain of VkDeviceCreateInfo instead of using VkDeviceCreateInfo::pEnabledFeatures.

Thus, housekeeping.

Suggested Testing Steps

  • Make sure Vulkan still works normally (it should).
  • Make sure the adapter dropdown in Settings still works.

Did you use AI to help find, test, or implement this issue or feature?

No.

@github-actions github-actions bot added the GS label Nov 16, 2025
@TheTechnician27 TheTechnician27 force-pushed the vulkan branch 2 times, most recently from f950994 to c5ff1bd Compare November 16, 2025 06:56
@TheTechnician27 TheTechnician27 changed the title Vulkan: Replace superseded Vulkan 1.0 structs with 1.1 counterparts Vulkan: Replace Vulkan 1.0 functionality with 1.1 counterparts Nov 16, 2025
Copy link
Copy Markdown
Member

@JordanTheToaster JordanTheToaster left a comment

Choose a reason for hiding this comment

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

Seems fine on Windows on Nvidia.

@TheTechnician27 TheTechnician27 force-pushed the vulkan branch 2 times, most recently from b7b9932 to bbf2d2e Compare November 16, 2025 21:41
Copy link
Copy Markdown
Member

@TellowKrinkle TellowKrinkle left a comment

Choose a reason for hiding this comment

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

I'd rather wait until we actually need the functionality of the newer versions to switch to them personally, but if you are going to do it...

I'm not a huge fan of storing vulkan query structs long term on GSDeviceVK. At least the v1 structs are just data, but the v2 structs have next pointer chains and stuff that are only relevant for filling them, yet we're storing them as info on the device, which just feels wrong. It also moves setting up the sType and next pointer chains far from the actual call to GetProperties. I know it doesn't actually hurt anything, but still. Personal preference would be to have our own struct that contains all the properties we care about, query with on-stack vk structs, and then copy the data we need into the GSDeviceVK. Example of me doing this for Dolphin

{
VkPhysicalDeviceProperties props = {};
vkGetPhysicalDeviceProperties(device, &props);
VkPhysicalDeviceProperties2 props2 = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, nullptr, {}};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
VkPhysicalDeviceProperties2 props2 = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, nullptr, {}};
VkPhysicalDeviceProperties2 props2 = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2};
const VkPhysicalDeviceProperties& props = props2.properties;

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.

3 participants