diff options
author | bunnei <bunneidev@gmail.com> | 2019-03-16 05:05:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-16 05:05:24 +0100 |
commit | 47b622825ca0ff664044abdf2d64a141452a8d1c (patch) | |
tree | ff18141caee2b1a460e6d5e22283e78c073880b0 /src/video_core/renderer_opengl/gl_global_cache.h | |
parent | Merge pull request #2048 from FearlessTobi/port-3924 (diff) | |
parent | gpu: Use host address for caching instead of guest address. (diff) | |
download | yuzu-47b622825ca0ff664044abdf2d64a141452a8d1c.tar yuzu-47b622825ca0ff664044abdf2d64a141452a8d1c.tar.gz yuzu-47b622825ca0ff664044abdf2d64a141452a8d1c.tar.bz2 yuzu-47b622825ca0ff664044abdf2d64a141452a8d1c.tar.lz yuzu-47b622825ca0ff664044abdf2d64a141452a8d1c.tar.xz yuzu-47b622825ca0ff664044abdf2d64a141452a8d1c.tar.zst yuzu-47b622825ca0ff664044abdf2d64a141452a8d1c.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_global_cache.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/video_core/renderer_opengl/gl_global_cache.h b/src/video_core/renderer_opengl/gl_global_cache.h index ba2bdc60c..e497a0619 100644 --- a/src/video_core/renderer_opengl/gl_global_cache.h +++ b/src/video_core/renderer_opengl/gl_global_cache.h @@ -27,14 +27,12 @@ using GlobalRegion = std::shared_ptr<CachedGlobalRegion>; class CachedGlobalRegion final : public RasterizerCacheObject { public: - explicit CachedGlobalRegion(VAddr addr, u32 size); + explicit CachedGlobalRegion(VAddr cpu_addr, u32 size, u8* host_ptr); - /// Gets the address of the shader in guest memory, required for cache management - VAddr GetAddr() const override { - return addr; + VAddr GetCpuAddr() const override { + return cpu_addr; } - /// Gets the size of the shader in guest memory, required for cache management std::size_t GetSizeInBytes() const override { return size; } @@ -53,9 +51,8 @@ public: } private: - VAddr addr{}; + VAddr cpu_addr{}; u32 size{}; - OGLBuffer buffer; }; @@ -69,7 +66,7 @@ public: private: GlobalRegion TryGetReservedGlobalRegion(VAddr addr, u32 size) const; - GlobalRegion GetUncachedGlobalRegion(VAddr addr, u32 size); + GlobalRegion GetUncachedGlobalRegion(VAddr addr, u32 size, u8* host_ptr); void ReserveGlobalRegion(GlobalRegion region); std::unordered_map<VAddr, GlobalRegion> reserve; |