diff options
| author | 2021-11-20 16:51:13 -0800 | |
|---|---|---|
| committer | 2021-11-20 16:51:13 -0800 | |
| commit | ea6fa044f3e55de3b542c6c1b7ca581cbf76d77e (patch) | |
| tree | 3eb75c6d43296f2a4cbb41099b4f4e787918b1a1 /src/video_core/renderer_opengl | |
| parent | Merge pull request #7294 from vonchenplus/fix_image_update_error_when_width_t... (diff) | |
| parent | TextureCache: Refactor and fix linux compiling. (diff) | |
| download | yuzu-ea6fa044f3e55de3b542c6c1b7ca581cbf76d77e.tar.gz yuzu-ea6fa044f3e55de3b542c6c1b7ca581cbf76d77e.tar.xz yuzu-ea6fa044f3e55de3b542c6c1b7ca581cbf76d77e.zip | |
Merge pull request #7368 from FernandoS27/vulkan-conv
Fix ART Blit detection regression and add D24S8 <-> RGBA8 conv to Vulkan
Diffstat (limited to 'src/video_core/renderer_opengl')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 10 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.h | 7 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 3dbdcc2c4..14e6522f2 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | #include <glad/glad.h> | 10 | #include <glad/glad.h> |
| 11 | 11 | ||
| 12 | #include "common/bit_util.h" | ||
| 12 | #include "common/literals.h" | 13 | #include "common/literals.h" |
| 13 | #include "common/settings.h" | 14 | #include "common/settings.h" |
| 14 | #include "video_core/renderer_opengl/gl_device.h" | 15 | #include "video_core/renderer_opengl/gl_device.h" |
| @@ -398,9 +399,6 @@ OGLTexture MakeImage(const VideoCommon::ImageInfo& info, GLenum gl_internal_form | |||
| 398 | return GL_R32UI; | 399 | return GL_R32UI; |
| 399 | } | 400 | } |
| 400 | 401 | ||
| 401 | [[nodiscard]] u32 NextPow2(u32 value) { | ||
| 402 | return 1U << (32U - std::countl_zero(value - 1U)); | ||
| 403 | } | ||
| 404 | } // Anonymous namespace | 402 | } // Anonymous namespace |
| 405 | 403 | ||
| 406 | ImageBufferMap::~ImageBufferMap() { | 404 | ImageBufferMap::~ImageBufferMap() { |
| @@ -527,8 +525,8 @@ void TextureCacheRuntime::CopyImage(Image& dst_image, Image& src_image, | |||
| 527 | } | 525 | } |
| 528 | } | 526 | } |
| 529 | 527 | ||
| 530 | void TextureCacheRuntime::ConvertImage(Image& dst, Image& src, | 528 | void TextureCacheRuntime::ReinterpretImage(Image& dst, Image& src, |
| 531 | std::span<const VideoCommon::ImageCopy> copies) { | 529 | std::span<const VideoCommon::ImageCopy> copies) { |
| 532 | LOG_DEBUG(Render_OpenGL, "Converting {} to {}", src.info.format, dst.info.format); | 530 | LOG_DEBUG(Render_OpenGL, "Converting {} to {}", src.info.format, dst.info.format); |
| 533 | format_conversion_pass.ConvertImage(dst, src, copies); | 531 | format_conversion_pass.ConvertImage(dst, src, copies); |
| 534 | } | 532 | } |
| @@ -1333,7 +1331,7 @@ void FormatConversionPass::ConvertImage(Image& dst_image, Image& src_image, | |||
| 1333 | const u32 copy_size = region.width * region.height * region.depth * img_bpp; | 1331 | const u32 copy_size = region.width * region.height * region.depth * img_bpp; |
| 1334 | if (pbo_size < copy_size) { | 1332 | if (pbo_size < copy_size) { |
| 1335 | intermediate_pbo.Create(); | 1333 | intermediate_pbo.Create(); |
| 1336 | pbo_size = NextPow2(copy_size); | 1334 | pbo_size = Common::NextPow2(copy_size); |
| 1337 | glNamedBufferData(intermediate_pbo.handle, pbo_size, nullptr, GL_STREAM_COPY); | 1335 | glNamedBufferData(intermediate_pbo.handle, pbo_size, nullptr, GL_STREAM_COPY); |
| 1338 | } | 1336 | } |
| 1339 | // Copy from source to PBO | 1337 | // Copy from source to PBO |
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.h b/src/video_core/renderer_opengl/gl_texture_cache.h index c0534b1f1..37d5e6a6b 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.h +++ b/src/video_core/renderer_opengl/gl_texture_cache.h | |||
| @@ -84,9 +84,13 @@ public: | |||
| 84 | 84 | ||
| 85 | u64 GetDeviceLocalMemory() const; | 85 | u64 GetDeviceLocalMemory() const; |
| 86 | 86 | ||
| 87 | bool ShouldReinterpret([[maybe_unused]] Image& dst, [[maybe_unused]] Image& src) { | ||
| 88 | return true; | ||
| 89 | } | ||
| 90 | |||
| 87 | void CopyImage(Image& dst, Image& src, std::span<const VideoCommon::ImageCopy> copies); | 91 | void CopyImage(Image& dst, Image& src, std::span<const VideoCommon::ImageCopy> copies); |
| 88 | 92 | ||
| 89 | void ConvertImage(Image& dst, Image& src, std::span<const VideoCommon::ImageCopy> copies); | 93 | void ReinterpretImage(Image& dst, Image& src, std::span<const VideoCommon::ImageCopy> copies); |
| 90 | 94 | ||
| 91 | void ConvertImage(Framebuffer* dst, ImageView& dst_view, ImageView& src_view, bool rescaled) { | 95 | void ConvertImage(Framebuffer* dst, ImageView& dst_view, ImageView& src_view, bool rescaled) { |
| 92 | UNIMPLEMENTED(); | 96 | UNIMPLEMENTED(); |
| @@ -339,7 +343,6 @@ struct TextureCacheParams { | |||
| 339 | static constexpr bool FRAMEBUFFER_BLITS = true; | 343 | static constexpr bool FRAMEBUFFER_BLITS = true; |
| 340 | static constexpr bool HAS_EMULATED_COPIES = true; | 344 | static constexpr bool HAS_EMULATED_COPIES = true; |
| 341 | static constexpr bool HAS_DEVICE_MEMORY_INFO = true; | 345 | static constexpr bool HAS_DEVICE_MEMORY_INFO = true; |
| 342 | static constexpr bool HAS_PIXEL_FORMAT_CONVERSIONS = true; | ||
| 343 | 346 | ||
| 344 | using Runtime = OpenGL::TextureCacheRuntime; | 347 | using Runtime = OpenGL::TextureCacheRuntime; |
| 345 | using Image = OpenGL::Image; | 348 | using Image = OpenGL::Image; |