summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-07-21 08:07:18 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2021-11-16 22:11:27 +0100
commitd464b122d5385105a6f4b0bc34bc1695c706417c (patch)
treeccaaa8ef85f026eb18b5cb8354279b4680822a27 /src
parentFix blits (diff)
downloadyuzu-d464b122d5385105a6f4b0bc34bc1695c706417c.tar
yuzu-d464b122d5385105a6f4b0bc34bc1695c706417c.tar.gz
yuzu-d464b122d5385105a6f4b0bc34bc1695c706417c.tar.bz2
yuzu-d464b122d5385105a6f4b0bc34bc1695c706417c.tar.lz
yuzu-d464b122d5385105a6f4b0bc34bc1695c706417c.tar.xz
yuzu-d464b122d5385105a6f4b0bc34bc1695c706417c.tar.zst
yuzu-d464b122d5385105a6f4b0bc34bc1695c706417c.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
index b061ea08b..4e05058c9 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
@@ -1128,8 +1128,8 @@ bool Image::ScaleUp(bool save_as_backup) {
.z = 0,
},
{
- .x = s32(info.size.width),
- .y = s32(info.size.height),
+ .x = static_cast<s32>(info.size.width),
+ .y = static_cast<s32>(info.size.height),
.z = 1,
},
},
@@ -1146,8 +1146,10 @@ bool Image::ScaleUp(bool save_as_backup) {
.z = 0,
},
{
- .x = s32(scale_up(info.size.width)),
- .y = is_2d ? s32(scale_up(info.size.height)) : s32(info.size.height),
+ .x = std::max(1, static_cast<s32>(scale_up(info.size.width)) >> level),
+ .y = std::max(1, static_cast<s32>(is_2d ? scale_up(info.size.height)
+ : info.size.height) >>
+ level),
.z = 1,
},
},
@@ -1199,9 +1201,9 @@ bool Image::ScaleDown(bool save_as_backup) {
regions.push_back({
.srcSubresource{
.aspectMask = aspect_mask,
- .mipLevel = u32(level),
+ .mipLevel = static_cast<u32>(level),
.baseArrayLayer = 0,
- .layerCount = u32(info.resources.layers),
+ .layerCount = static_cast<u32>(info.resources.layers),
},
.srcOffsets{
{
@@ -1210,16 +1212,18 @@ bool Image::ScaleDown(bool save_as_backup) {
.z = 0,
},
{
- .x = s32(scale_up(info.size.width)),
- .y = is_2d ? s32(scale_up(info.size.height)) : s32(info.size.height),
+ .x = std::max(1, static_cast<s32>(scale_up(info.size.width)) >> level),
+ .y = std::max(1, static_cast<s32>(is_2d ? scale_up(info.size.height)
+ : info.size.height) >>
+ level),
.z = 1,
},
},
.dstSubresource{
.aspectMask = aspect_mask,
- .mipLevel = u32(level),
+ .mipLevel = static_cast<u32>(level),
.baseArrayLayer = 0,
- .layerCount = u32(info.resources.layers),
+ .layerCount = static_cast<u32>(info.resources.layers),
},
.dstOffsets{
{
@@ -1228,8 +1232,8 @@ bool Image::ScaleDown(bool save_as_backup) {
.z = 0,
},
{
- .x = s32(info.size.width),
- .y = s32(info.size.height),
+ .x = std::max(1, static_cast<s32>(info.size.width) >> level),
+ .y = std::max(1, static_cast<s32>(info.size.height) >> level),
.z = 1,
},
},