summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-06-13 21:38:54 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-06-16 02:19:00 +0200
commitb2955479e5188d8149354f0b8fec813690f9ba86 (patch)
treed12bd6047e08fdd685a804df8a408587e93daa1f /src/video_core
parenttextures: Reintroduce CPU ASTC decoder (diff)
downloadyuzu-b2955479e5188d8149354f0b8fec813690f9ba86.tar
yuzu-b2955479e5188d8149354f0b8fec813690f9ba86.tar.gz
yuzu-b2955479e5188d8149354f0b8fec813690f9ba86.tar.bz2
yuzu-b2955479e5188d8149354f0b8fec813690f9ba86.tar.lz
yuzu-b2955479e5188d8149354f0b8fec813690f9ba86.tar.xz
yuzu-b2955479e5188d8149354f0b8fec813690f9ba86.tar.zst
yuzu-b2955479e5188d8149354f0b8fec813690f9ba86.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.cpp6
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.cpp7
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 @@
#include <glad/glad.h>
+#include "common/settings.h"
+
#include "video_core/renderer_opengl/gl_device.h"
#include "video_core/renderer_opengl/gl_shader_manager.h"
#include "video_core/renderer_opengl/gl_state_tracker.h"
@@ -307,7 +309,9 @@ void ApplySwizzle(GLuint handle, PixelFormat format, std::array<SwizzleSource, 4
[[nodiscard]] bool CanBeAccelerated(const TextureCacheRuntime& runtime,
const VideoCommon::ImageInfo& info) {
- return !runtime.HasNativeASTC() && IsPixelFormatASTC(info.format);
+ if (IsPixelFormatASTC(info.format)) {
+ return !runtime.HasNativeASTC() && Settings::values.accelerate_astc.GetValue();
+ }
// Disable other accelerated uploads for now as they don't implement swizzled uploads
return false;
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 @@
#include <vector>
#include "common/bit_cast.h"
+#include "common/settings.h"
#include "video_core/engines/fermi_2d.h"
#include "video_core/renderer_vulkan/blit_image.h"
@@ -828,7 +829,11 @@ Image::Image(TextureCacheRuntime& runtime, const ImageInfo& info_, GPUVAddr gpu_
commit = runtime.memory_allocator.Commit(buffer, MemoryUsage::DeviceLocal);
}
if (IsPixelFormatASTC(info.format) && !runtime.device.IsOptimalAstcSupported()) {
- flags |= VideoCommon::ImageFlagBits::AcceleratedUpload;
+ if (Settings::values.accelerate_astc.GetValue()) {
+ flags |= VideoCommon::ImageFlagBits::AcceleratedUpload;
+ } else {
+ flags |= VideoCommon::ImageFlagBits::Converted;
+ }
}
if (runtime.device.HasDebuggingToolAttached()) {
if (image) {