diff options
author | Fernando S <fsahmkow27@gmail.com> | 2022-04-07 16:59:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-07 16:59:41 +0200 |
commit | 4265372099be28590a880859bb0d1af0cb4fef72 (patch) | |
tree | 92fbcf05d6e7b3794679e43c3387d2c25cd3a4d5 /src/video_core/renderer_opengl/gl_texture_cache.cpp | |
parent | Merge pull request #8152 from liamwhite/gl-crop (diff) | |
parent | OpenGL: fix S8D24 to ABGR8 conversions (diff) | |
download | yuzu-4265372099be28590a880859bb0d1af0cb4fef72.tar yuzu-4265372099be28590a880859bb0d1af0cb4fef72.tar.gz yuzu-4265372099be28590a880859bb0d1af0cb4fef72.tar.bz2 yuzu-4265372099be28590a880859bb0d1af0cb4fef72.tar.lz yuzu-4265372099be28590a880859bb0d1af0cb4fef72.tar.xz yuzu-4265372099be28590a880859bb0d1af0cb4fef72.tar.zst yuzu-4265372099be28590a880859bb0d1af0cb4fef72.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_texture_cache.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 8f9a65beb..d12076358 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp @@ -409,8 +409,8 @@ ImageBufferMap::~ImageBufferMap() { TextureCacheRuntime::TextureCacheRuntime(const Device& device_, ProgramManager& program_manager, StateTracker& state_tracker_) - : device{device_}, state_tracker{state_tracker_}, - util_shaders(program_manager), resolution{Settings::values.resolution_info} { + : device{device_}, state_tracker{state_tracker_}, util_shaders(program_manager), + format_conversion_pass{util_shaders}, resolution{Settings::values.resolution_info} { static constexpr std::array TARGETS{GL_TEXTURE_1D_ARRAY, GL_TEXTURE_2D_ARRAY, GL_TEXTURE_3D}; for (size_t i = 0; i < TARGETS.size(); ++i) { const GLenum target = TARGETS[i]; @@ -1325,6 +1325,9 @@ Framebuffer::Framebuffer(TextureCacheRuntime& runtime, std::span<ImageView*, NUM Framebuffer::~Framebuffer() = default; +FormatConversionPass::FormatConversionPass(UtilShaders& util_shaders_) + : util_shaders{util_shaders_} {} + void FormatConversionPass::ConvertImage(Image& dst_image, Image& src_image, std::span<const VideoCommon::ImageCopy> copies) { const GLenum dst_target = ImageTarget(dst_image.info); @@ -1357,6 +1360,12 @@ void FormatConversionPass::ConvertImage(Image& dst_image, Image& src_image, dst_origin.z, region.width, region.height, region.depth, dst_image.GlFormat(), dst_image.GlType(), nullptr); } + + // Swap component order of S8D24 to ABGR8 reinterprets + if (src_image.info.format == PixelFormat::D24_UNORM_S8_UINT && + dst_image.info.format == PixelFormat::A8B8G8R8_UNORM) { + util_shaders.ConvertS8D24(dst_image, copies); + } } } // namespace OpenGL |