summaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorGravatar ameerj2023-02-22 00:48:12 -0500
committerGravatar ameerj2023-02-22 18:21:09 -0500
commitb5bcd8c71b2d5fd0528191990b4e11bc916b5d7a (patch)
treea01027160958974738f322a491b22f009379d19b /src/video_core/renderer_opengl
parenttexture_cache: Add async texture decoding (diff)
downloadyuzu-b5bcd8c71b2d5fd0528191990b4e11bc916b5d7a.tar.gz
yuzu-b5bcd8c71b2d5fd0528191990b4e11bc916b5d7a.tar.xz
yuzu-b5bcd8c71b2d5fd0528191990b4e11bc916b5d7a.zip
configuration: Add async ASTC decode setting
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.cpp17
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
228 228
229[[nodiscard]] bool CanBeAccelerated(const TextureCacheRuntime& runtime, 229[[nodiscard]] bool CanBeAccelerated(const TextureCacheRuntime& runtime,
230 const VideoCommon::ImageInfo& info) { 230 const VideoCommon::ImageInfo& info) {
231 if (IsPixelFormatASTC(info.format)) { 231 if (IsPixelFormatASTC(info.format) && !runtime.HasNativeASTC()) {
232 return !runtime.HasNativeASTC() && Settings::values.accelerate_astc.GetValue(); 232 return Settings::values.accelerate_astc.GetValue() &&
233 !Settings::values.async_astc.GetValue();
233 } 234 }
234 // Disable other accelerated uploads for now as they don't implement swizzled uploads 235 // Disable other accelerated uploads for now as they don't implement swizzled uploads
235 return false; 236 return false;
@@ -258,6 +259,14 @@ void ApplySwizzle(GLuint handle, PixelFormat format, std::array<SwizzleSource, 4
258 return format_info.compatibility_class == store_class; 259 return format_info.compatibility_class == store_class;
259} 260}
260 261
262[[nodiscard]] bool CanBeDecodedAsync(const TextureCacheRuntime& runtime,
263 const VideoCommon::ImageInfo& info) {
264 if (IsPixelFormatASTC(info.format) && !runtime.HasNativeASTC()) {
265 return Settings::values.async_astc.GetValue();
266 }
267 return false;
268}
269
261[[nodiscard]] CopyOrigin MakeCopyOrigin(VideoCommon::Offset3D offset, 270[[nodiscard]] CopyOrigin MakeCopyOrigin(VideoCommon::Offset3D offset,
262 VideoCommon::SubresourceLayers subresource, GLenum target) { 271 VideoCommon::SubresourceLayers subresource, GLenum target) {
263 switch (target) { 272 switch (target) {
@@ -721,7 +730,9 @@ std::optional<size_t> TextureCacheRuntime::StagingBuffers::FindBuffer(size_t req
721Image::Image(TextureCacheRuntime& runtime_, const VideoCommon::ImageInfo& info_, GPUVAddr gpu_addr_, 730Image::Image(TextureCacheRuntime& runtime_, const VideoCommon::ImageInfo& info_, GPUVAddr gpu_addr_,
722 VAddr cpu_addr_) 731 VAddr cpu_addr_)
723 : VideoCommon::ImageBase(info_, gpu_addr_, cpu_addr_), runtime{&runtime_} { 732 : VideoCommon::ImageBase(info_, gpu_addr_, cpu_addr_), runtime{&runtime_} {
724 if (CanBeAccelerated(*runtime, info)) { 733 if (CanBeDecodedAsync(*runtime, info)) {
734 flags |= ImageFlagBits::AsynchronousDecode;
735 } else if (CanBeAccelerated(*runtime, info)) {
725 flags |= ImageFlagBits::AcceleratedUpload; 736 flags |= ImageFlagBits::AcceleratedUpload;
726 } 737 }
727 if (IsConverted(runtime->device, info.format, info.type)) { 738 if (IsConverted(runtime->device, info.format, info.type)) {