mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-02 08:43:16 +00:00
Replace recursive_mutex with mutex (#708)
* Replace recursive_mutex with mutex * Move mutex lock outside of ObtainBuffer
This commit is contained in:
parent
1d8359f828
commit
f514fdfd18
4 changed files with 10 additions and 5 deletions
|
@ -230,7 +230,6 @@ u32 BufferCache::BindIndexBuffer(bool& is_indexed, u32 index_offset) {
|
|||
|
||||
std::pair<Buffer*, u32> BufferCache::ObtainBuffer(VAddr device_addr, u32 size, bool is_written,
|
||||
bool is_texel_buffer) {
|
||||
std::scoped_lock lk{mutex};
|
||||
static constexpr u64 StreamThreshold = CACHING_PAGESIZE;
|
||||
const bool is_gpu_dirty = memory_tracker.IsRegionGpuModified(device_addr, size);
|
||||
if (!is_written && !is_texel_buffer && size <= StreamThreshold && !is_gpu_dirty) {
|
||||
|
@ -461,6 +460,7 @@ void BufferCache::ChangeRegister(BufferId buffer_id) {
|
|||
}
|
||||
|
||||
bool BufferCache::SynchronizeBuffer(Buffer& buffer, VAddr device_addr, u32 size) {
|
||||
std::scoped_lock lk{mutex};
|
||||
boost::container::small_vector<vk::BufferCopy, 4> copies;
|
||||
u64 total_size_bytes = 0;
|
||||
u64 largest_copy = 0;
|
||||
|
|
|
@ -126,7 +126,7 @@ private:
|
|||
PageManager& tracker;
|
||||
StreamBuffer staging_buffer;
|
||||
StreamBuffer stream_buffer;
|
||||
std::recursive_mutex mutex;
|
||||
std::mutex mutex;
|
||||
Common::SlotVector<Buffer> slot_buffers;
|
||||
MemoryTracker memory_tracker;
|
||||
PageTable page_table;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue