diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-04-15 21:17:27 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-06-21 02:36:11 +0200 |
commit | 0cefb7bcb481dc32d6362bba1976cadf25f9c95a (patch) | |
tree | dad54e28e8995e3eb4b1788225f2e26f64882570 /src/video_core/renderer_opengl/gl_texture_cache.h | |
parent | gl_texture_cache: Attach surface textures instead of views (diff) | |
download | yuzu-0cefb7bcb481dc32d6362bba1976cadf25f9c95a.tar yuzu-0cefb7bcb481dc32d6362bba1976cadf25f9c95a.tar.gz yuzu-0cefb7bcb481dc32d6362bba1976cadf25f9c95a.tar.bz2 yuzu-0cefb7bcb481dc32d6362bba1976cadf25f9c95a.tar.lz yuzu-0cefb7bcb481dc32d6362bba1976cadf25f9c95a.tar.xz yuzu-0cefb7bcb481dc32d6362bba1976cadf25f9c95a.tar.zst yuzu-0cefb7bcb481dc32d6362bba1976cadf25f9c95a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.h | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.h b/src/video_core/renderer_opengl/gl_texture_cache.h index 80733ac36..86ad91dab 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.h +++ b/src/video_core/renderer_opengl/gl_texture_cache.h @@ -90,6 +90,34 @@ public: return params; } + u32 GetWidth() const { + return params.GetMipWidth(GetBaseLevel()); + } + + u32 GetHeight() const { + return params.GetMipHeight(GetBaseLevel()); + } + + u32 GetDepth() const { + return params.GetMipDepth(GetBaseLevel()); + } + + u32 GetBaseLayer() const { + return key.base_layer; + } + + u32 GetNumLayers() const { + return key.num_layers; + } + + u32 GetBaseLevel() const { + return key.base_level; + } + + u32 GetNumLevels() const { + return key.num_levels; + } + private: struct TextureView { OGLTexture texture; @@ -128,7 +156,8 @@ public: protected: CachedSurfaceView* TryFastGetSurfaceView(VAddr cpu_addr, u8* host_ptr, - const SurfaceParams& params, bool preserve_contents, + const SurfaceParams& new_params, + bool preserve_contents, const std::vector<CachedSurface*>& overlaps); std::unique_ptr<CachedSurface> CreateSurface(const SurfaceParams& params); @@ -136,6 +165,9 @@ protected: private: CachedSurfaceView* SurfaceCopy(VAddr cpu_addr, u8* host_ptr, const SurfaceParams& new_params, CachedSurface* old_surface, const SurfaceParams& old_params); + + CachedSurfaceView* TryCopyAsViews(VAddr cpu_addr, u8* host_ptr, const SurfaceParams& new_params, + const std::vector<CachedSurface*>& overlaps); }; } // namespace OpenGL |