From 0cefb7bcb481dc32d6362bba1976cadf25f9c95a Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Mon, 15 Apr 2019 16:17:27 -0300 Subject: gl_texture_cache: Add copy from multiple overlaps into a single surface --- src/video_core/renderer_opengl/gl_texture_cache.h | 34 ++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'src/video_core/renderer_opengl/gl_texture_cache.h') 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& overlaps); std::unique_ptr 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& overlaps); }; } // namespace OpenGL -- cgit v1.2.3