diff options
| author | 2022-04-15 13:43:27 +0200 | |
|---|---|---|
| committer | 2022-10-06 21:00:53 +0200 | |
| commit | 8fd1d769fe1c079d3a3f1ddc531233eabf0dd7ba (patch) | |
| tree | 3565744222ebe3565a65179ae8797c234519a7be /src/video_core/texture_cache | |
| parent | General: Fix compilation for GCC (diff) | |
| download | yuzu-8fd1d769fe1c079d3a3f1ddc531233eabf0dd7ba.tar.gz yuzu-8fd1d769fe1c079d3a3f1ddc531233eabf0dd7ba.tar.xz yuzu-8fd1d769fe1c079d3a3f1ddc531233eabf0dd7ba.zip | |
ImageBase: Basic fixes.
Diffstat (limited to 'src/video_core/texture_cache')
| -rw-r--r-- | src/video_core/texture_cache/image_base.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/video_core/texture_cache/image_base.cpp b/src/video_core/texture_cache/image_base.cpp index f61e09ac7..91512022f 100644 --- a/src/video_core/texture_cache/image_base.cpp +++ b/src/video_core/texture_cache/image_base.cpp | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <vector> | 7 | #include <vector> |
| 8 | 8 | ||
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | #include "common/div_ceil.h" | ||
| 10 | #include "video_core/surface.h" | 11 | #include "video_core/surface.h" |
| 11 | #include "video_core/texture_cache/formatter.h" | 12 | #include "video_core/texture_cache/formatter.h" |
| 12 | #include "video_core/texture_cache/image_base.h" | 13 | #include "video_core/texture_cache/image_base.h" |
| @@ -182,10 +183,6 @@ void AddImageAlias(ImageBase& lhs, ImageBase& rhs, ImageId lhs_id, ImageId rhs_i | |||
| 182 | }; | 183 | }; |
| 183 | const bool is_lhs_compressed = lhs_block.width > 1 || lhs_block.height > 1; | 184 | const bool is_lhs_compressed = lhs_block.width > 1 || lhs_block.height > 1; |
| 184 | const bool is_rhs_compressed = rhs_block.width > 1 || rhs_block.height > 1; | 185 | const bool is_rhs_compressed = rhs_block.width > 1 || rhs_block.height > 1; |
| 185 | if (is_lhs_compressed && is_rhs_compressed) { | ||
| 186 | LOG_ERROR(HW_GPU, "Compressed to compressed image aliasing is not implemented"); | ||
| 187 | return; | ||
| 188 | } | ||
| 189 | const s32 lhs_mips = lhs.info.resources.levels; | 186 | const s32 lhs_mips = lhs.info.resources.levels; |
| 190 | const s32 rhs_mips = rhs.info.resources.levels; | 187 | const s32 rhs_mips = rhs.info.resources.levels; |
| 191 | const s32 num_mips = std::min(lhs_mips - base->level, rhs_mips); | 188 | const s32 num_mips = std::min(lhs_mips - base->level, rhs_mips); |
| @@ -199,12 +196,12 @@ void AddImageAlias(ImageBase& lhs, ImageBase& rhs, ImageId lhs_id, ImageId rhs_i | |||
| 199 | Extent3D lhs_size = MipSize(lhs.info.size, base->level + mip_level); | 196 | Extent3D lhs_size = MipSize(lhs.info.size, base->level + mip_level); |
| 200 | Extent3D rhs_size = MipSize(rhs.info.size, mip_level); | 197 | Extent3D rhs_size = MipSize(rhs.info.size, mip_level); |
| 201 | if (is_lhs_compressed) { | 198 | if (is_lhs_compressed) { |
| 202 | lhs_size.width /= lhs_block.width; | 199 | lhs_size.width = Common::DivCeil(lhs_size.width, lhs_block.width); |
| 203 | lhs_size.height /= lhs_block.height; | 200 | lhs_size.height = Common::DivCeil(lhs_size.height, lhs_block.height); |
| 204 | } | 201 | } |
| 205 | if (is_rhs_compressed) { | 202 | if (is_rhs_compressed) { |
| 206 | rhs_size.width /= rhs_block.width; | 203 | rhs_size.width = Common::DivCeil(rhs_size.width, rhs_block.width); |
| 207 | rhs_size.height /= rhs_block.height; | 204 | rhs_size.height = Common::DivCeil(rhs_size.height, rhs_block.height); |
| 208 | } | 205 | } |
| 209 | const Extent3D copy_size{ | 206 | const Extent3D copy_size{ |
| 210 | .width = std::min(lhs_size.width, rhs_size.width), | 207 | .width = std::min(lhs_size.width, rhs_size.width), |