diff options
| author | 2021-06-13 15:38:54 -0400 | |
|---|---|---|
| committer | 2021-06-15 20:19:00 -0400 | |
| commit | b2955479e5188d8149354f0b8fec813690f9ba86 (patch) | |
| tree | d12bd6047e08fdd685a804df8a408587e93daa1f /src/video_core | |
| parent | textures: Reintroduce CPU ASTC decoder (diff) | |
| download | yuzu-b2955479e5188d8149354f0b8fec813690f9ba86.tar.gz yuzu-b2955479e5188d8149354f0b8fec813690f9ba86.tar.xz yuzu-b2955479e5188d8149354f0b8fec813690f9ba86.zip | |
configure_graphics: Add Accelerate ASTC decoding setting
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 7 |
2 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 ffe9edc1b..9b4038615 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp | |||
| @@ -9,6 +9,8 @@ | |||
| 9 | 9 | ||
| 10 | #include <glad/glad.h> | 10 | #include <glad/glad.h> |
| 11 | 11 | ||
| 12 | #include "common/settings.h" | ||
| 13 | |||
| 12 | #include "video_core/renderer_opengl/gl_device.h" | 14 | #include "video_core/renderer_opengl/gl_device.h" |
| 13 | #include "video_core/renderer_opengl/gl_shader_manager.h" | 15 | #include "video_core/renderer_opengl/gl_shader_manager.h" |
| 14 | #include "video_core/renderer_opengl/gl_state_tracker.h" | 16 | #include "video_core/renderer_opengl/gl_state_tracker.h" |
| @@ -307,7 +309,9 @@ void ApplySwizzle(GLuint handle, PixelFormat format, std::array<SwizzleSource, 4 | |||
| 307 | 309 | ||
| 308 | [[nodiscard]] bool CanBeAccelerated(const TextureCacheRuntime& runtime, | 310 | [[nodiscard]] bool CanBeAccelerated(const TextureCacheRuntime& runtime, |
| 309 | const VideoCommon::ImageInfo& info) { | 311 | const VideoCommon::ImageInfo& info) { |
| 310 | return !runtime.HasNativeASTC() && IsPixelFormatASTC(info.format); | 312 | if (IsPixelFormatASTC(info.format)) { |
| 313 | return !runtime.HasNativeASTC() && Settings::values.accelerate_astc.GetValue(); | ||
| 314 | } | ||
| 311 | // Disable other accelerated uploads for now as they don't implement swizzled uploads | 315 | // Disable other accelerated uploads for now as they don't implement swizzled uploads |
| 312 | return false; | 316 | return false; |
| 313 | switch (info.type) { | 317 | switch (info.type) { |
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index bdd0ce8bc..52860b4cf 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <vector> | 8 | #include <vector> |
| 9 | 9 | ||
| 10 | #include "common/bit_cast.h" | 10 | #include "common/bit_cast.h" |
| 11 | #include "common/settings.h" | ||
| 11 | 12 | ||
| 12 | #include "video_core/engines/fermi_2d.h" | 13 | #include "video_core/engines/fermi_2d.h" |
| 13 | #include "video_core/renderer_vulkan/blit_image.h" | 14 | #include "video_core/renderer_vulkan/blit_image.h" |
| @@ -828,7 +829,11 @@ Image::Image(TextureCacheRuntime& runtime, const ImageInfo& info_, GPUVAddr gpu_ | |||
| 828 | commit = runtime.memory_allocator.Commit(buffer, MemoryUsage::DeviceLocal); | 829 | commit = runtime.memory_allocator.Commit(buffer, MemoryUsage::DeviceLocal); |
| 829 | } | 830 | } |
| 830 | if (IsPixelFormatASTC(info.format) && !runtime.device.IsOptimalAstcSupported()) { | 831 | if (IsPixelFormatASTC(info.format) && !runtime.device.IsOptimalAstcSupported()) { |
| 831 | flags |= VideoCommon::ImageFlagBits::AcceleratedUpload; | 832 | if (Settings::values.accelerate_astc.GetValue()) { |
| 833 | flags |= VideoCommon::ImageFlagBits::AcceleratedUpload; | ||
| 834 | } else { | ||
| 835 | flags |= VideoCommon::ImageFlagBits::Converted; | ||
| 836 | } | ||
| 832 | } | 837 | } |
| 833 | if (runtime.device.HasDebuggingToolAttached()) { | 838 | if (runtime.device.HasDebuggingToolAttached()) { |
| 834 | if (image) { | 839 | if (image) { |