[PR #1723] [CLOSED] liverpool: Correct compute queue context switches #2261

Closed
opened 2026-02-27 21:15:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/1723
Author: @raphaelthegreat
Created: 12/9/2024
Status: Closed

Base: mainHead: asc-fix


📝 Commits (1)

  • 813fe1c liverpool: Correct compute queue context switches

📊 Changes

3 files changed (+17 additions, -7 deletions)

View changed files

📝 src/core/libraries/gnmdriver/gnmdriver.cpp (+1 -1)
📝 src/video_core/amdgpu/liverpool.cpp (+15 -5)
📝 src/video_core/amdgpu/liverpool.h (+1 -1)

📄 Description

  • Indirect buffers would always yield at least once, even when they finished executing successfully on their first call. Fix that by calling the task outside of the loop first.

  • Add additional compute register backups and restores where applicable. Compute registers are distinct per queue and thus must be context switched when we switch queues. On main there could be cases where, for example, queue 1 executes some dispatches, context switches to queue 5 which loads its registers, and then context switch to queue 1 again, which has a fresh task. But this time it wouldn't properly restore that context, leading to a crash


🔄 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/1723 **Author:** [@raphaelthegreat](https://github.com/raphaelthegreat) **Created:** 12/9/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `asc-fix` --- ### 📝 Commits (1) - [`813fe1c`](https://github.com/shadps4-emu/shadPS4/commit/813fe1c67656f646c88ba0bdfbdd79e6da7d65af) liverpool: Correct compute queue context switches ### 📊 Changes **3 files changed** (+17 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/gnmdriver/gnmdriver.cpp` (+1 -1) 📝 `src/video_core/amdgpu/liverpool.cpp` (+15 -5) 📝 `src/video_core/amdgpu/liverpool.h` (+1 -1) </details> ### 📄 Description * Indirect buffers would always yield at least once, even when they finished executing successfully on their first call. Fix that by calling the task outside of the loop first. * Add additional compute register backups and restores where applicable. Compute registers are distinct per queue and thus must be context switched when we switch queues. On main there could be cases where, for example, queue 1 executes some dispatches, context switches to queue 5 which loads its registers, and then context switch to queue 1 again, which has a fresh task. But this time it wouldn't properly restore that context, leading to a crash --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:15:48 +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#2261
No description provided.