diff options
| author | 2023-05-09 09:47:22 -0400 | |
|---|---|---|
| committer | 2023-05-09 09:47:22 -0400 | |
| commit | 1f14b58315f807f62aeb31d0c23b859b501324b7 (patch) | |
| tree | e5625e146ea3127cd3daf99d6abe3386af1de300 /src | |
| parent | Merge pull request #10208 from german77/amiibo_joycon (diff) | |
| parent | Texture Cache: Fix ASTC textures (diff) | |
| download | yuzu-1f14b58315f807f62aeb31d0c23b859b501324b7.tar.gz yuzu-1f14b58315f807f62aeb31d0c23b859b501324b7.tar.xz yuzu-1f14b58315f807f62aeb31d0c23b859b501324b7.zip | |
Merge pull request #10206 from FernandoS27/astc-3d
Texture Cache: Fix 3D ASTC textures
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/texture_cache/util.cpp | 10 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 052456f61..31118886f 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp | |||
| @@ -231,7 +231,7 @@ void ApplySwizzle(GLuint handle, PixelFormat format, std::array<SwizzleSource, 4 | |||
| 231 | 231 | ||
| 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) && !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() && |
| 236 | !Settings::values.async_astc.GetValue(); | 236 | !Settings::values.async_astc.GetValue(); |
| 237 | } | 237 | } |
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 99dd1260a..9ca7751c5 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp | |||
| @@ -1268,7 +1268,7 @@ Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu | |||
| 1268 | if (IsPixelFormatASTC(info.format) && !runtime->device.IsOptimalAstcSupported()) { | 1268 | if (IsPixelFormatASTC(info.format) && !runtime->device.IsOptimalAstcSupported()) { |
| 1269 | if (Settings::values.async_astc.GetValue()) { | 1269 | if (Settings::values.async_astc.GetValue()) { |
| 1270 | flags |= VideoCommon::ImageFlagBits::AsynchronousDecode; | 1270 | flags |= VideoCommon::ImageFlagBits::AsynchronousDecode; |
| 1271 | } else if (Settings::values.accelerate_astc.GetValue()) { | 1271 | } else if (Settings::values.accelerate_astc.GetValue() && info.size.depth == 1) { |
| 1272 | flags |= VideoCommon::ImageFlagBits::AcceleratedUpload; | 1272 | flags |= VideoCommon::ImageFlagBits::AcceleratedUpload; |
| 1273 | } | 1273 | } |
| 1274 | flags |= VideoCommon::ImageFlagBits::Converted; | 1274 | flags |= VideoCommon::ImageFlagBits::Converted; |
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp index de37db684..f1071aa23 100644 --- a/src/video_core/texture_cache/util.cpp +++ b/src/video_core/texture_cache/util.cpp | |||
| @@ -896,11 +896,11 @@ void ConvertImage(std::span<const u8> input, const ImageInfo& info, std::span<u8 | |||
| 896 | ASSERT(copy.buffer_row_length == Common::AlignUp(mip_size.width, tile_size.width)); | 896 | ASSERT(copy.buffer_row_length == Common::AlignUp(mip_size.width, tile_size.width)); |
| 897 | ASSERT(copy.buffer_image_height == Common::AlignUp(mip_size.height, tile_size.height)); | 897 | ASSERT(copy.buffer_image_height == Common::AlignUp(mip_size.height, tile_size.height)); |
| 898 | if (IsPixelFormatASTC(info.format)) { | 898 | if (IsPixelFormatASTC(info.format)) { |
| 899 | ASSERT(copy.image_extent.depth == 1); | 899 | Tegra::Texture::ASTC::Decompress( |
| 900 | Tegra::Texture::ASTC::Decompress(input.subspan(copy.buffer_offset), | 900 | input.subspan(copy.buffer_offset), copy.image_extent.width, |
| 901 | copy.image_extent.width, copy.image_extent.height, | 901 | copy.image_extent.height, |
| 902 | copy.image_subresource.num_layers, tile_size.width, | 902 | copy.image_subresource.num_layers * copy.image_extent.depth, tile_size.width, |
| 903 | tile_size.height, output.subspan(output_offset)); | 903 | tile_size.height, output.subspan(output_offset)); |
| 904 | } else { | 904 | } else { |
| 905 | DecompressBC4(input.subspan(copy.buffer_offset), copy.image_extent, | 905 | DecompressBC4(input.subspan(copy.buffer_offset), copy.image_extent, |
| 906 | output.subspan(output_offset)); | 906 | output.subspan(output_offset)); |