diff options
| author | 2019-06-10 10:39:59 -0400 | |
|---|---|---|
| committer | 2019-06-20 21:38:34 -0300 | |
| commit | 561ce29c98bf822941061023e1f71a62175318ae (patch) | |
| tree | 9d263aed4986702c145cb7dbc6afd8340e6a1cb5 /src/video_core/texture_cache | |
| parent | shader_ir: Fix image copy rebase issues (diff) | |
| download | yuzu-561ce29c98bf822941061023e1f71a62175318ae.tar.gz yuzu-561ce29c98bf822941061023e1f71a62175318ae.tar.xz yuzu-561ce29c98bf822941061023e1f71a62175318ae.zip | |
texture_cache: correct mutex locks
Diffstat (limited to 'src/video_core/texture_cache')
| -rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index d2c27bcef..503bd2b43 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h | |||
| @@ -90,6 +90,7 @@ public: | |||
| 90 | 90 | ||
| 91 | TView GetTextureSurface(const Tegra::Texture::FullTextureInfo& config, | 91 | TView GetTextureSurface(const Tegra::Texture::FullTextureInfo& config, |
| 92 | const VideoCommon::Shader::Sampler& entry) { | 92 | const VideoCommon::Shader::Sampler& entry) { |
| 93 | std::lock_guard lock{mutex}; | ||
| 93 | const auto gpu_addr{config.tic.Address()}; | 94 | const auto gpu_addr{config.tic.Address()}; |
| 94 | if (!gpu_addr) { | 95 | if (!gpu_addr) { |
| 95 | return {}; | 96 | return {}; |
| @@ -99,6 +100,7 @@ public: | |||
| 99 | } | 100 | } |
| 100 | 101 | ||
| 101 | TView GetDepthBufferSurface(bool preserve_contents) { | 102 | TView GetDepthBufferSurface(bool preserve_contents) { |
| 103 | std::lock_guard lock{mutex}; | ||
| 102 | auto& maxwell3d = system.GPU().Maxwell3D(); | 104 | auto& maxwell3d = system.GPU().Maxwell3D(); |
| 103 | 105 | ||
| 104 | if (!maxwell3d.dirty_flags.zeta_buffer) { | 106 | if (!maxwell3d.dirty_flags.zeta_buffer) { |
| @@ -127,6 +129,7 @@ public: | |||
| 127 | } | 129 | } |
| 128 | 130 | ||
| 129 | TView GetColorBufferSurface(std::size_t index, bool preserve_contents) { | 131 | TView GetColorBufferSurface(std::size_t index, bool preserve_contents) { |
| 132 | std::lock_guard lock{mutex}; | ||
| 130 | ASSERT(index < Tegra::Engines::Maxwell3D::Regs::NumRenderTargets); | 133 | ASSERT(index < Tegra::Engines::Maxwell3D::Regs::NumRenderTargets); |
| 131 | auto& maxwell3d = system.GPU().Maxwell3D(); | 134 | auto& maxwell3d = system.GPU().Maxwell3D(); |
| 132 | if (!maxwell3d.dirty_flags.color_buffer[index]) { | 135 | if (!maxwell3d.dirty_flags.color_buffer[index]) { |
| @@ -188,6 +191,7 @@ public: | |||
| 188 | void DoFermiCopy(const Tegra::Engines::Fermi2D::Regs::Surface& src_config, | 191 | void DoFermiCopy(const Tegra::Engines::Fermi2D::Regs::Surface& src_config, |
| 189 | const Tegra::Engines::Fermi2D::Regs::Surface& dst_config, | 192 | const Tegra::Engines::Fermi2D::Regs::Surface& dst_config, |
| 190 | const Tegra::Engines::Fermi2D::Config& copy_config) { | 193 | const Tegra::Engines::Fermi2D::Config& copy_config) { |
| 194 | std::lock_guard lock{mutex}; | ||
| 191 | std::pair<TSurface, TView> dst_surface = GetFermiSurface(dst_config); | 195 | std::pair<TSurface, TView> dst_surface = GetFermiSurface(dst_config); |
| 192 | std::pair<TSurface, TView> src_surface = GetFermiSurface(src_config); | 196 | std::pair<TSurface, TView> src_surface = GetFermiSurface(src_config); |
| 193 | ImageBlit(src_surface.second, dst_surface.second, copy_config); | 197 | ImageBlit(src_surface.second, dst_surface.second, copy_config); |
| @@ -245,8 +249,6 @@ protected: | |||
| 245 | virtual void BufferCopy(TSurface& src_surface, TSurface& dst_surface) = 0; | 249 | virtual void BufferCopy(TSurface& src_surface, TSurface& dst_surface) = 0; |
| 246 | 250 | ||
| 247 | void Register(TSurface surface) { | 251 | void Register(TSurface surface) { |
| 248 | std::lock_guard lock{mutex}; | ||
| 249 | |||
| 250 | const GPUVAddr gpu_addr = surface->GetGpuAddr(); | 252 | const GPUVAddr gpu_addr = surface->GetGpuAddr(); |
| 251 | const CacheAddr cache_ptr = ToCacheAddr(memory_manager->GetPointer(gpu_addr)); | 253 | const CacheAddr cache_ptr = ToCacheAddr(memory_manager->GetPointer(gpu_addr)); |
| 252 | const std::size_t size = surface->GetSizeInBytes(); | 254 | const std::size_t size = surface->GetSizeInBytes(); |
| @@ -266,8 +268,6 @@ protected: | |||
| 266 | } | 268 | } |
| 267 | 269 | ||
| 268 | void Unregister(TSurface surface) { | 270 | void Unregister(TSurface surface) { |
| 269 | std::lock_guard lock{mutex}; | ||
| 270 | |||
| 271 | if (guard_cache && surface->IsProtected()) { | 271 | if (guard_cache && surface->IsProtected()) { |
| 272 | return; | 272 | return; |
| 273 | } | 273 | } |