diff options
author | bunnei <bunneidev@gmail.com> | 2021-11-18 20:30:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-18 20:30:47 +0100 |
commit | 0bc46fedd617f6a42c53716680ed99d8f42bf99a (patch) | |
tree | aec333a588d638492cca77d7814cdc5379d2b6c0 /src/video_core/renderer_opengl/gl_texture_cache.h | |
parent | Merge pull request #7353 from v1993/no-more-epilepsy (diff) | |
parent | gl_texture_cache: Round format conversion PBO to next power of 2 (diff) | |
download | yuzu-0bc46fedd617f6a42c53716680ed99d8f42bf99a.tar yuzu-0bc46fedd617f6a42c53716680ed99d8f42bf99a.tar.gz yuzu-0bc46fedd617f6a42c53716680ed99d8f42bf99a.tar.bz2 yuzu-0bc46fedd617f6a42c53716680ed99d8f42bf99a.tar.lz yuzu-0bc46fedd617f6a42c53716680ed99d8f42bf99a.tar.xz yuzu-0bc46fedd617f6a42c53716680ed99d8f42bf99a.tar.zst yuzu-0bc46fedd617f6a42c53716680ed99d8f42bf99a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.h b/src/video_core/renderer_opengl/gl_texture_cache.h index 1bb762568..578f8d523 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.h +++ b/src/video_core/renderer_opengl/gl_texture_cache.h @@ -52,17 +52,17 @@ struct FormatProperties { bool is_compressed; }; -class BGRCopyPass { +class FormatConversionPass { public: - BGRCopyPass() = default; - ~BGRCopyPass() = default; + FormatConversionPass() = default; + ~FormatConversionPass() = default; - void CopyBGR(Image& dst_image, Image& src_image, - std::span<const VideoCommon::ImageCopy> copies); + void ConvertImage(Image& dst_image, Image& src_image, + std::span<const VideoCommon::ImageCopy> copies); private: - OGLBuffer bgr_pbo; - size_t bgr_pbo_size{}; + OGLBuffer intermediate_pbo; + size_t pbo_size{}; }; class TextureCacheRuntime { @@ -86,6 +86,8 @@ public: void CopyImage(Image& dst, Image& src, std::span<const VideoCommon::ImageCopy> copies); + void ConvertImage(Image& dst, Image& src, std::span<const VideoCommon::ImageCopy> copies); + void ConvertImage(Framebuffer* dst, ImageView& dst_view, ImageView& src_view, bool rescaled) { UNIMPLEMENTED(); } @@ -144,7 +146,7 @@ private: const Device& device; StateTracker& state_tracker; UtilShaders util_shaders; - BGRCopyPass bgr_copy_pass; + FormatConversionPass format_conversion_pass; std::array<std::unordered_map<GLenum, FormatProperties>, 3> format_properties; bool has_broken_texture_view_formats = false; @@ -336,6 +338,7 @@ struct TextureCacheParams { static constexpr bool FRAMEBUFFER_BLITS = true; static constexpr bool HAS_EMULATED_COPIES = true; static constexpr bool HAS_DEVICE_MEMORY_INFO = true; + static constexpr bool HAS_PIXEL_FORMAT_CONVERSIONS = true; using Runtime = OpenGL::TextureCacheRuntime; using Image = OpenGL::Image; |