mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 00:05:58 +03:00
[PR #2788] [MERGED] vk_rasterizer: Control mapped_ranges access with shared lock. #2980
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#2980
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/2788
Author: @squidbus
Created: 4/15/2025
Status: ✅ Merged
Merged: 4/15/2025
Merged by: @squidbus
Base:
main← Head:fix-mem-map📝 Commits (1)
929679cvk_rasterizer: Control mapped_ranges access with shared lock.📊 Changes
2 files changed (+15 additions, -4 deletions)
View changed files
📝
src/video_core/renderer_vulkan/vk_rasterizer.cpp(+12 -4)📝
src/video_core/renderer_vulkan/vk_rasterizer.h(+3 -0)📄 Description
The GPU mapped memory ranges set may be modified by one thread at the same time as another thread checks it. Reading the set mid-write like this can produce an incorrect result, making it think that valid memory is not mapped.
To address this, add a shared lock to control access to
mapped_ranges. Any number of readers can access the map at the same time, but when it is being written by a map/unmap operation, that is given exclusive access.Also made the intervals and set contains check a bit more correct.
Fixes instances of incorrect
Attempted to track non-GPU memoryassert in games that map and unmap memory a lot beyond boot.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.