diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-05-28 19:18:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-28 19:18:31 +0200 |
commit | 381caf4c00f5d5a611acdc9165a4929ddeb6c195 (patch) | |
tree | 9960005e3446f6a92dad61f5e43544c495abc95e /src/video_core/renderer_opengl | |
parent | Merge pull request #10280 from danilaml/cmake-bin-dir (diff) | |
parent | gl_texture_cache: Fix ASTC CPU decoding with compression disabled (diff) | |
download | yuzu-381caf4c00f5d5a611acdc9165a4929ddeb6c195.tar yuzu-381caf4c00f5d5a611acdc9165a4929ddeb6c195.tar.gz yuzu-381caf4c00f5d5a611acdc9165a4929ddeb6c195.tar.bz2 yuzu-381caf4c00f5d5a611acdc9165a4929ddeb6c195.tar.lz yuzu-381caf4c00f5d5a611acdc9165a4929ddeb6c195.tar.xz yuzu-381caf4c00f5d5a611acdc9165a4929ddeb6c195.tar.zst yuzu-381caf4c00f5d5a611acdc9165a4929ddeb6c195.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 9 |
1 files changed, 7 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 1e0823836..56d0ff869 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp @@ -439,6 +439,11 @@ OGLTexture MakeImage(const VideoCommon::ImageInfo& info, GLenum gl_internal_form return GL_R32UI; } +[[nodiscard]] bool IsAstcRecompressionEnabled() { + return Settings::values.astc_recompression.GetValue() != + Settings::AstcRecompression::Uncompressed; +} + [[nodiscard]] GLenum SelectAstcFormat(PixelFormat format, bool is_srgb) { switch (Settings::values.astc_recompression.GetValue()) { case Settings::AstcRecompression::Bc1: @@ -760,7 +765,7 @@ Image::Image(TextureCacheRuntime& runtime_, const VideoCommon::ImageInfo& info_, gl_format = GL_RGBA; gl_type = GL_UNSIGNED_INT_8_8_8_8_REV; - if (IsPixelFormatASTC(info.format)) { + if (IsPixelFormatASTC(info.format) && IsAstcRecompressionEnabled()) { gl_internal_format = SelectAstcFormat(info.format, is_srgb); gl_format = GL_NONE; } @@ -1155,7 +1160,7 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI const bool is_srgb = IsPixelFormatSRGB(info.format); internal_format = is_srgb ? GL_SRGB8_ALPHA8 : GL_RGBA8; - if (IsPixelFormatASTC(info.format)) { + if (IsPixelFormatASTC(info.format) && IsAstcRecompressionEnabled()) { internal_format = SelectAstcFormat(info.format, is_srgb); } } else { |