diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2023-02-22 06:48:12 +0100 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2023-02-23 00:21:09 +0100 |
commit | b5bcd8c71b2d5fd0528191990b4e11bc916b5d7a (patch) | |
tree | a01027160958974738f322a491b22f009379d19b /src/video_core/renderer_opengl/gl_texture_cache.cpp | |
parent | texture_cache: Add async texture decoding (diff) | |
download | yuzu-b5bcd8c71b2d5fd0528191990b4e11bc916b5d7a.tar yuzu-b5bcd8c71b2d5fd0528191990b4e11bc916b5d7a.tar.gz yuzu-b5bcd8c71b2d5fd0528191990b4e11bc916b5d7a.tar.bz2 yuzu-b5bcd8c71b2d5fd0528191990b4e11bc916b5d7a.tar.lz yuzu-b5bcd8c71b2d5fd0528191990b4e11bc916b5d7a.tar.xz yuzu-b5bcd8c71b2d5fd0528191990b4e11bc916b5d7a.tar.zst yuzu-b5bcd8c71b2d5fd0528191990b4e11bc916b5d7a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index eb6e43a08..b047e7b3d 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp @@ -228,8 +228,9 @@ void ApplySwizzle(GLuint handle, PixelFormat format, std::array<SwizzleSource, 4 [[nodiscard]] bool CanBeAccelerated(const TextureCacheRuntime& runtime, const VideoCommon::ImageInfo& info) { - if (IsPixelFormatASTC(info.format)) { - return !runtime.HasNativeASTC() && Settings::values.accelerate_astc.GetValue(); + if (IsPixelFormatASTC(info.format) && !runtime.HasNativeASTC()) { + return Settings::values.accelerate_astc.GetValue() && + !Settings::values.async_astc.GetValue(); } // Disable other accelerated uploads for now as they don't implement swizzled uploads return false; @@ -258,6 +259,14 @@ void ApplySwizzle(GLuint handle, PixelFormat format, std::array<SwizzleSource, 4 return format_info.compatibility_class == store_class; } +[[nodiscard]] bool CanBeDecodedAsync(const TextureCacheRuntime& runtime, + const VideoCommon::ImageInfo& info) { + if (IsPixelFormatASTC(info.format) && !runtime.HasNativeASTC()) { + return Settings::values.async_astc.GetValue(); + } + return false; +} + [[nodiscard]] CopyOrigin MakeCopyOrigin(VideoCommon::Offset3D offset, VideoCommon::SubresourceLayers subresource, GLenum target) { switch (target) { @@ -721,7 +730,9 @@ std::optional<size_t> TextureCacheRuntime::StagingBuffers::FindBuffer(size_t req Image::Image(TextureCacheRuntime& runtime_, const VideoCommon::ImageInfo& info_, GPUVAddr gpu_addr_, VAddr cpu_addr_) : VideoCommon::ImageBase(info_, gpu_addr_, cpu_addr_), runtime{&runtime_} { - if (CanBeAccelerated(*runtime, info)) { + if (CanBeDecodedAsync(*runtime, info)) { + flags |= ImageFlagBits::AsynchronousDecode; + } else if (CanBeAccelerated(*runtime, info)) { flags |= ImageFlagBits::AcceleratedUpload; } if (IsConverted(runtime->device, info.format, info.type)) { |