mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-24 02:41:51 +01:00
Add a mutex to allow preventing buffer recreation
This commit is contained in:
parent
379b4f163d
commit
542651232b
@ -64,6 +64,7 @@ namespace skyline::gpu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
BufferManager::LockedBuffer BufferManager::CoalesceBuffers(span<u8> range, const LockedBuffers &srcBuffers, ContextTag tag) {
|
BufferManager::LockedBuffer BufferManager::CoalesceBuffers(span<u8> range, const LockedBuffers &srcBuffers, ContextTag tag) {
|
||||||
|
std::scoped_lock lock{recreationMutex};
|
||||||
if (!range.valid())
|
if (!range.valid())
|
||||||
range = span<u8>{srcBuffers.front().buffer->guest->begin(), srcBuffers.back().buffer->guest->end()};
|
range = span<u8>{srcBuffers.front().buffer->guest->begin(), srcBuffers.back().buffer->guest->end()};
|
||||||
|
|
||||||
|
@ -70,6 +70,8 @@ namespace skyline::gpu {
|
|||||||
static bool BufferLessThan(const std::shared_ptr<Buffer> &it, u8 *pointer);
|
static bool BufferLessThan(const std::shared_ptr<Buffer> &it, u8 *pointer);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
std::mutex recreationMutex;
|
||||||
|
|
||||||
BufferManager(GPU &gpu);
|
BufferManager(GPU &gpu);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user