2
0
mirror of https://github.com/skyline-emu/skyline.git synced 2025-07-14 17:06:13 +03:00

Add a mutex to allow preventing buffer recreation

This commit is contained in:
Billy Laws 2022-09-19 14:36:24 +01:00
parent 379b4f163d
commit 542651232b
2 changed files with 3 additions and 0 deletions
app/src/main/cpp/skyline/gpu

@ -64,6 +64,7 @@ namespace skyline::gpu {
}
BufferManager::LockedBuffer BufferManager::CoalesceBuffers(span<u8> range, const LockedBuffers &srcBuffers, ContextTag tag) {
std::scoped_lock lock{recreationMutex};
if (!range.valid())
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);
public:
std::mutex recreationMutex;
BufferManager(GPU &gpu);
/**