[PR #2751] [MERGED] renderer_vulkan: Only update dynamic state when changed. #2953

Closed
opened 2026-02-27 22:01:53 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2751
Author: @squidbus
Created: 4/5/2025
Status: Merged
Merged: 4/8/2025
Merged by: @squidbus

Base: mainHead: ds-dirty


📝 Commits (1)

  • ad3101d renderer_vulkan: Only update dynamic state when changed.

📊 Changes

4 files changed (+415 additions, -87 deletions)

View changed files

📝 src/video_core/renderer_vulkan/vk_rasterizer.cpp (+57 -84)
📝 src/video_core/renderer_vulkan/vk_rasterizer.h (+3 -3)
📝 src/video_core/renderer_vulkan/vk_scheduler.cpp (+136 -0)
📝 src/video_core/renderer_vulkan/vk_scheduler.h (+219 -0)

📄 Description

Implements dynamic state tracking to only emit state update commands when necessary.

Details:

  • Keeps track of all dynamic state values along with corresponding dirty flags.
  • Dirty flags are only set when a value changes or the command buffer changes, to apply the state to the new command buffer.
  • State is only set in the command buffer when needed; for example, if stencil test is disabled, updating any stencil test parameters is skipped. Once it is enabled, any deferred dirty state will be set.

This system will allow us to continue expanding our use of dynamic state where possible without ballooning the number of commands issued for every draw.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/2751 **Author:** [@squidbus](https://github.com/squidbus) **Created:** 4/5/2025 **Status:** ✅ Merged **Merged:** 4/8/2025 **Merged by:** [@squidbus](https://github.com/squidbus) **Base:** `main` ← **Head:** `ds-dirty` --- ### 📝 Commits (1) - [`ad3101d`](https://github.com/shadps4-emu/shadPS4/commit/ad3101d084673cfb92df9268e911898a47d0546f) renderer_vulkan: Only update dynamic state when changed. ### 📊 Changes **4 files changed** (+415 additions, -87 deletions) <details> <summary>View changed files</summary> 📝 `src/video_core/renderer_vulkan/vk_rasterizer.cpp` (+57 -84) 📝 `src/video_core/renderer_vulkan/vk_rasterizer.h` (+3 -3) 📝 `src/video_core/renderer_vulkan/vk_scheduler.cpp` (+136 -0) 📝 `src/video_core/renderer_vulkan/vk_scheduler.h` (+219 -0) </details> ### 📄 Description Implements dynamic state tracking to only emit state update commands when necessary. Details: * Keeps track of all dynamic state values along with corresponding dirty flags. * Dirty flags are only set when a value changes or the command buffer changes, to apply the state to the new command buffer. * State is only set in the command buffer when needed; for example, if stencil test is disabled, updating any stencil test parameters is skipped. Once it is enabled, any deferred dirty state will be set. This system will allow us to continue expanding our use of dynamic state where possible without ballooning the number of commands issued for every draw. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:01:53 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#2953
No description provided.