diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-06-10 16:39:59 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-06-21 02:38:34 +0200 |
commit | 561ce29c98bf822941061023e1f71a62175318ae (patch) | |
tree | 9d263aed4986702c145cb7dbc6afd8340e6a1cb5 | |
parent | shader_ir: Fix image copy rebase issues (diff) | |
download | yuzu-561ce29c98bf822941061023e1f71a62175318ae.tar yuzu-561ce29c98bf822941061023e1f71a62175318ae.tar.gz yuzu-561ce29c98bf822941061023e1f71a62175318ae.tar.bz2 yuzu-561ce29c98bf822941061023e1f71a62175318ae.tar.lz yuzu-561ce29c98bf822941061023e1f71a62175318ae.tar.xz yuzu-561ce29c98bf822941061023e1f71a62175318ae.tar.zst yuzu-561ce29c98bf822941061023e1f71a62175318ae.zip |
-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: TView GetTextureSurface(const Tegra::Texture::FullTextureInfo& config, const VideoCommon::Shader::Sampler& entry) { + std::lock_guard lock{mutex}; const auto gpu_addr{config.tic.Address()}; if (!gpu_addr) { return {}; @@ -99,6 +100,7 @@ public: } TView GetDepthBufferSurface(bool preserve_contents) { + std::lock_guard lock{mutex}; auto& maxwell3d = system.GPU().Maxwell3D(); if (!maxwell3d.dirty_flags.zeta_buffer) { @@ -127,6 +129,7 @@ public: } TView GetColorBufferSurface(std::size_t index, bool preserve_contents) { + std::lock_guard lock{mutex}; ASSERT(index < Tegra::Engines::Maxwell3D::Regs::NumRenderTargets); auto& maxwell3d = system.GPU().Maxwell3D(); if (!maxwell3d.dirty_flags.color_buffer[index]) { @@ -188,6 +191,7 @@ public: void DoFermiCopy(const Tegra::Engines::Fermi2D::Regs::Surface& src_config, const Tegra::Engines::Fermi2D::Regs::Surface& dst_config, const Tegra::Engines::Fermi2D::Config& copy_config) { + std::lock_guard lock{mutex}; std::pair<TSurface, TView> dst_surface = GetFermiSurface(dst_config); std::pair<TSurface, TView> src_surface = GetFermiSurface(src_config); ImageBlit(src_surface.second, dst_surface.second, copy_config); @@ -245,8 +249,6 @@ protected: virtual void BufferCopy(TSurface& src_surface, TSurface& dst_surface) = 0; void Register(TSurface surface) { - std::lock_guard lock{mutex}; - const GPUVAddr gpu_addr = surface->GetGpuAddr(); const CacheAddr cache_ptr = ToCacheAddr(memory_manager->GetPointer(gpu_addr)); const std::size_t size = surface->GetSizeInBytes(); @@ -266,8 +268,6 @@ protected: } void Unregister(TSurface surface) { - std::lock_guard lock{mutex}; - if (guard_cache && surface->IsProtected()) { return; } |