diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-07-01 10:32:01 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-07-01 10:32:01 +0200 |
commit | 4705d1b523aff5e51de73cba4121433533c7c917 (patch) | |
tree | 85fc497361877a0448e566433d8828e62566326b /src/video_core/renderer_opengl | |
parent | Merge pull request #2603 from WamWooWam/master (diff) | |
download | yuzu-4705d1b523aff5e51de73cba4121433533c7c917.tar yuzu-4705d1b523aff5e51de73cba4121433533c7c917.tar.gz yuzu-4705d1b523aff5e51de73cba4121433533c7c917.tar.bz2 yuzu-4705d1b523aff5e51de73cba4121433533c7c917.tar.lz yuzu-4705d1b523aff5e51de73cba4121433533c7c917.tar.xz yuzu-4705d1b523aff5e51de73cba4121433533c7c917.tar.zst yuzu-4705d1b523aff5e51de73cba4121433533c7c917.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/gl_buffer_cache.cpp | 2 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_global_cache.cpp | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_buffer_cache.cpp b/src/video_core/renderer_opengl/gl_buffer_cache.cpp index 48b86f3bd..2b9bd142e 100644 --- a/src/video_core/renderer_opengl/gl_buffer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_buffer_cache.cpp @@ -23,6 +23,7 @@ OGLBufferCache::OGLBufferCache(RasterizerOpenGL& rasterizer, std::size_t size) GLintptr OGLBufferCache::UploadMemory(GPUVAddr gpu_addr, std::size_t size, std::size_t alignment, bool cache) { + std::lock_guard lock{mutex}; auto& memory_manager = Core::System::GetInstance().GPU().MemoryManager(); // Cache management is a big overhead, so only cache entries with a given size. @@ -62,6 +63,7 @@ GLintptr OGLBufferCache::UploadMemory(GPUVAddr gpu_addr, std::size_t size, std:: GLintptr OGLBufferCache::UploadHostMemory(const void* raw_pointer, std::size_t size, std::size_t alignment) { + std::lock_guard lock{mutex}; AlignBuffer(alignment); std::memcpy(buffer_ptr, raw_pointer, size); const GLintptr uploaded_offset = buffer_offset; diff --git a/src/video_core/renderer_opengl/gl_global_cache.cpp b/src/video_core/renderer_opengl/gl_global_cache.cpp index ea4a593af..d5e385151 100644 --- a/src/video_core/renderer_opengl/gl_global_cache.cpp +++ b/src/video_core/renderer_opengl/gl_global_cache.cpp @@ -76,6 +76,7 @@ GlobalRegionCacheOpenGL::GlobalRegionCacheOpenGL(RasterizerOpenGL& rasterizer) GlobalRegion GlobalRegionCacheOpenGL::GetGlobalRegion( const GLShader::GlobalMemoryEntry& global_region, Tegra::Engines::Maxwell3D::Regs::ShaderStage stage) { + std::lock_guard lock{mutex}; auto& gpu{Core::System::GetInstance().GPU()}; auto& memory_manager{gpu.MemoryManager()}; |