diff options
| author | 2023-05-03 20:42:33 -0400 | |
|---|---|---|
| committer | 2023-07-21 10:56:07 -0400 | |
| commit | 5cffa342884df531d911555f7b3db9d2f6d1d1f0 (patch) | |
| tree | 7f1d36c9f291a528edf9ccf7e85f34d2d108b332 /src/video_core | |
| parent | Merge pull request #11096 from german77/amiibooo (diff) | |
| download | yuzu-5cffa342884df531d911555f7b3db9d2f6d1d1f0.tar.gz yuzu-5cffa342884df531d911555f7b3db9d2f6d1d1f0.tar.xz yuzu-5cffa342884df531d911555f7b3db9d2f6d1d1f0.zip | |
settings,video_core: Consolidate ASTC decoding options
Just puts them all neatly into one place.
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 8 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 19 |
2 files changed, 17 insertions, 10 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 3b446be07..38ae12d8e 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp | |||
| @@ -232,10 +232,9 @@ void ApplySwizzle(GLuint handle, PixelFormat format, std::array<SwizzleSource, 4 | |||
| 232 | [[nodiscard]] bool CanBeAccelerated(const TextureCacheRuntime& runtime, | 232 | [[nodiscard]] bool CanBeAccelerated(const TextureCacheRuntime& runtime, |
| 233 | const VideoCommon::ImageInfo& info) { | 233 | const VideoCommon::ImageInfo& info) { |
| 234 | if (IsPixelFormatASTC(info.format) && info.size.depth == 1 && !runtime.HasNativeASTC()) { | 234 | if (IsPixelFormatASTC(info.format) && info.size.depth == 1 && !runtime.HasNativeASTC()) { |
| 235 | return Settings::values.accelerate_astc.GetValue() && | 235 | return Settings::values.accelerate_astc.GetValue() == Settings::AstcDecodeMode::GPU && |
| 236 | Settings::values.astc_recompression.GetValue() == | 236 | Settings::values.astc_recompression.GetValue() == |
| 237 | Settings::AstcRecompression::Uncompressed && | 237 | Settings::AstcRecompression::Uncompressed; |
| 238 | !Settings::values.async_astc.GetValue(); | ||
| 239 | } | 238 | } |
| 240 | // Disable other accelerated uploads for now as they don't implement swizzled uploads | 239 | // Disable other accelerated uploads for now as they don't implement swizzled uploads |
| 241 | return false; | 240 | return false; |
| @@ -267,7 +266,8 @@ void ApplySwizzle(GLuint handle, PixelFormat format, std::array<SwizzleSource, 4 | |||
| 267 | [[nodiscard]] bool CanBeDecodedAsync(const TextureCacheRuntime& runtime, | 266 | [[nodiscard]] bool CanBeDecodedAsync(const TextureCacheRuntime& runtime, |
| 268 | const VideoCommon::ImageInfo& info) { | 267 | const VideoCommon::ImageInfo& info) { |
| 269 | if (IsPixelFormatASTC(info.format) && !runtime.HasNativeASTC()) { | 268 | if (IsPixelFormatASTC(info.format) && !runtime.HasNativeASTC()) { |
| 270 | return Settings::values.async_astc.GetValue(); | 269 | return Settings::values.accelerate_astc.GetValue() == |
| 270 | Settings::AstcDecodeMode::CPUAsynchronous; | ||
| 271 | } | 271 | } |
| 272 | return false; | 272 | return false; |
| 273 | } | 273 | } |
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index bf6ad6c79..a060c3934 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp | |||
| @@ -817,7 +817,7 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched | |||
| 817 | : device{device_}, scheduler{scheduler_}, memory_allocator{memory_allocator_}, | 817 | : device{device_}, scheduler{scheduler_}, memory_allocator{memory_allocator_}, |
| 818 | staging_buffer_pool{staging_buffer_pool_}, blit_image_helper{blit_image_helper_}, | 818 | staging_buffer_pool{staging_buffer_pool_}, blit_image_helper{blit_image_helper_}, |
| 819 | render_pass_cache{render_pass_cache_}, resolution{Settings::values.resolution_info} { | 819 | render_pass_cache{render_pass_cache_}, resolution{Settings::values.resolution_info} { |
| 820 | if (Settings::values.accelerate_astc) { | 820 | if (Settings::values.accelerate_astc.GetValue() == Settings::AstcDecodeMode::GPU) { |
| 821 | astc_decoder_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, | 821 | astc_decoder_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, |
| 822 | compute_pass_descriptor_queue, memory_allocator); | 822 | compute_pass_descriptor_queue, memory_allocator); |
| 823 | } | 823 | } |
| @@ -1301,12 +1301,19 @@ Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu | |||
| 1301 | runtime->ViewFormats(info.format))), | 1301 | runtime->ViewFormats(info.format))), |
| 1302 | aspect_mask(ImageAspectMask(info.format)) { | 1302 | aspect_mask(ImageAspectMask(info.format)) { |
| 1303 | if (IsPixelFormatASTC(info.format) && !runtime->device.IsOptimalAstcSupported()) { | 1303 | if (IsPixelFormatASTC(info.format) && !runtime->device.IsOptimalAstcSupported()) { |
| 1304 | if (Settings::values.async_astc.GetValue()) { | 1304 | switch (Settings::values.accelerate_astc.GetValue()) { |
| 1305 | case Settings::AstcDecodeMode::GPU: | ||
| 1306 | if (Settings::values.astc_recompression.GetValue() == | ||
| 1307 | Settings::AstcRecompression::Uncompressed && | ||
| 1308 | info.size.depth == 1) { | ||
| 1309 | flags |= VideoCommon::ImageFlagBits::AcceleratedUpload; | ||
| 1310 | } | ||
| 1311 | break; | ||
| 1312 | case Settings::AstcDecodeMode::CPUAsynchronous: | ||
| 1305 | flags |= VideoCommon::ImageFlagBits::AsynchronousDecode; | 1313 | flags |= VideoCommon::ImageFlagBits::AsynchronousDecode; |
| 1306 | } else if (Settings::values.astc_recompression.GetValue() == | 1314 | break; |
| 1307 | Settings::AstcRecompression::Uncompressed && | 1315 | default: |
| 1308 | Settings::values.accelerate_astc.GetValue() && info.size.depth == 1) { | 1316 | break; |
| 1309 | flags |= VideoCommon::ImageFlagBits::AcceleratedUpload; | ||
| 1310 | } | 1317 | } |
| 1311 | flags |= VideoCommon::ImageFlagBits::Converted; | 1318 | flags |= VideoCommon::ImageFlagBits::Converted; |
| 1312 | flags |= VideoCommon::ImageFlagBits::CostlyLoad; | 1319 | flags |= VideoCommon::ImageFlagBits::CostlyLoad; |