Skip to content

GS:VK: Migrate to VK 1.3 and use dynamic rendering. - #14787

Open
TJnotJT wants to merge 4 commits into
PCSX2:masterfrom
TJnotJT:gs-vk-dynamic-rendering
Open

GS:VK: Migrate to VK 1.3 and use dynamic rendering.#14787
TJnotJT wants to merge 4 commits into
PCSX2:masterfrom
TJnotJT:gs-vk-dynamic-rendering

Conversation

@TJnotJT

@TJnotJT TJnotJT commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Description of Changes

Migrate to VK 1.3 (basically use the commands and enums that end in '2' like vkCmdPipelineBarrier2, etc.)

Use dynamic rendering if it's supported, otherwise use traditional render passes.

Some cleanup to remove redundancy in feedback loop flags introduced in #13631.

Use name initializer lists for constructing VK structs.

Rationale behind Changes

Main rationale is that we're using VK 1.3 in #14737, so this is to avoid using deprecated functionality. However, most of the updates should be semantically identical.

Anticipate moving to 1.4 and using only dynamic rendering and removing the traditional render passes/frame buffers.

Code clarity.

Suggested Testing Steps

Test VK to make sure it still works correctly. Everything should be identical to master.

@JordanTheToaster noticed slightly higher CPU usage, so that needs to be looked into.

The first (VK 1.3) and last commits (dynamic rendering + feedback loop flags cleanup) have been dump run.

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

Likely at some point to ask about API usage, semantics, etc.

@crashGG

crashGG commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This PR brings a massive FPS boost when GPU bound. For example, running Soulcalibur III at 5x internal resolution on a 780M: master gets 41.5 FPS, while this PR hits 52.0 FPS.

@SternXD SternXD left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

dGPU

Image Image

iGPU

Image Image

Comment thread pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp Outdated
vkGetPhysicalDeviceProperties(device, &props);
VkPhysicalDeviceProperties2 props2 = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2 };
vkGetPhysicalDeviceProperties2(device, &props2);
VkPhysicalDeviceProperties props = props2.properties;

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
VkPhysicalDeviceProperties props = props2.properties;
const VkPhysicalDeviceProperties& props = props2.properties;

Comment thread pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp Outdated
Comment thread pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp Outdated
Comment thread pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp Outdated
Comment on lines +1290 to +1293
semaphore_signal_info[0] = { VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, nullptr,
present_swap_chain->GetRenderingFinishedSemaphore(), 0, VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, 0 };
semaphore_signal_info[1] = { VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, nullptr,
m_spin_resources[m_current_frame].semaphore, 0, VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, 0 },

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.

Personally I'm not a huge fan of doing this with Vulkan, though I realize we do plenty in the rest of GSDeviceVK.

I'd much prefer

semaphore_signal_info[0] = { VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO };
semaphore_signal_info[0].whatever0 = present_swap_chain->GetRenderingFinishedSemaphore();
semaphore_signal_info[0].whatever1 = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT;

(And if those 0s are important, set them explicitly. If they're not, don't.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I changed this to use a named initializer list, as it's slightly more compact:

semaphore_signal_info[0] = { .sType = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO,
	.semphore = present_swap_chain->GetRenderingFinishedSemaphore(),
	.stageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT };

vkCmdPipelineBarrier(resources.command_buffer, VK_PIPELINE_STAGE_TRANSFER_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, 1, &barrier, 0, nullptr);

const VkBufferMemoryBarrier2 barrier{ VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_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.

Same here

@TJnotJT
TJnotJT force-pushed the gs-vk-dynamic-rendering branch from 883d67b to 37de3c2 Compare August 5, 2026 15:52
@TJnotJT

TJnotJT commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Added a separate commit that changes all VK structs with a structure type member (.sType) to be constructed with named initializer lists.

@lightningterror

Copy link
Copy Markdown
Contributor

I've been thinking about this and it's probably best keeping dynamic rendering as optional without migrating to VK 1.3.
The current hardware prices are unaffordable for majority of people which also impacts the used market and things are only getting worse.
I don't want to kill off VK for Kepler just yet and DX12 support is bad. It would still be somewhat decent for emulation, and in today's age grabbing even a ddr3 system seems like a good deal.

@TJnotJT

TJnotJT commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

I've been thinking about this and it's probably best keeping dynamic rendering as optional without migrating to VK 1.3. The current hardware prices are unaffordable for majority of people which also impacts the used market and things are only getting worse. I don't want to kill off VK for Kepler just yet and DX12 support is bad. It would still be somewhat decent for emulation, and in today's age grabbing even a ddr3 system seems like a good deal.

Sure, there's not an overwhelming reason to use 1.3 yet.

@Mrlinkwii

Copy link
Copy Markdown
Contributor

I think requiring vk1.3 is fair , every gpu in the past 10 years have support for it , if you have kepler gpu you can use a stable build and upgrade it , the ram crisis isnt of our making

@refractionpcsx2

Copy link
Copy Markdown
Member

Also if you can't afford a new gpu because of the ram crisis, you're not buying a kepler, you will at least get a maxwell which will cost you similar to a McDonald's for two people.

If you're going to use 14 year old hardware, you can use old software that supports it

@AmandaRoseChaqueta

Copy link
Copy Markdown

Gotta agree on this one. Kepler is ancient GPU and honestly, an used rx6600 (or the nvidia equivalent) in the used market shouldn't be too bad.

@AmandaRoseChaqueta AmandaRoseChaqueta left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tested a couple of gs dumps and games, couldn't see any issues or regressions on linux.

@kamfretoz

Copy link
Copy Markdown
Contributor

Ditto, Kepler is just simply too old at this point.

Use synchronization2, renderpass2, and others.

Rewrite the VK render pass builder.
@TJnotJT
TJnotJT force-pushed the gs-vk-dynamic-rendering branch from 37de3c2 to 0204fd8 Compare August 11, 2026 22:47
Only used if both dynamic rendering and dynamic local read are available.
Remove one redundant level of flags and use an enum class with overloaded bitwise operators.
@TJnotJT
TJnotJT force-pushed the gs-vk-dynamic-rendering branch from 0204fd8 to d9886d9 Compare August 12, 2026 00:55
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.

10 participants