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

View File

@ -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()};

View File

@ -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);
/** /**