summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2024-01-27 04:27:34 +0100
committerLiam <byteslice@airmail.cc>2024-01-31 17:27:20 +0100
commit453091f61100effba637950dc840da41d95be477 (patch)
tree0e1d46a7c5a354769d04b9bde090b5a9b1f02eb7 /src/video_core/renderer_vulkan
parentvideo_core: simplify accelerated surface fetch and crop handling between APIs (diff)
downloadyuzu-453091f61100effba637950dc840da41d95be477.tar
yuzu-453091f61100effba637950dc840da41d95be477.tar.gz
yuzu-453091f61100effba637950dc840da41d95be477.tar.bz2
yuzu-453091f61100effba637950dc840da41d95be477.tar.lz
yuzu-453091f61100effba637950dc840da41d95be477.tar.xz
yuzu-453091f61100effba637950dc840da41d95be477.tar.zst
yuzu-453091f61100effba637950dc840da41d95be477.zip
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/vk_blit_screen.cpp6
-rw-r--r--src/video_core/renderer_vulkan/vk_blit_screen.h2
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.cpp6
3 files changed, 11 insertions, 3 deletions
diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.cpp b/src/video_core/renderer_vulkan/vk_blit_screen.cpp
index c21a9c8fe..24781860b 100644
--- a/src/video_core/renderer_vulkan/vk_blit_screen.cpp
+++ b/src/video_core/renderer_vulkan/vk_blit_screen.cpp
@@ -152,6 +152,8 @@ void BlitScreen::Draw(RasterizerVulkan& rasterizer, const Tegra::FramebufferConf
framebuffer, framebuffer.address + framebuffer.offset, framebuffer.stride);
const u32 texture_width = texture_info ? texture_info->width : framebuffer.width;
const u32 texture_height = texture_info ? texture_info->height : framebuffer.height;
+ const u32 scaled_width = texture_info ? texture_info->scaled_width : texture_width;
+ const u32 scaled_height = texture_info ? texture_info->scaled_height : texture_height;
const bool use_accelerated = texture_info.has_value();
RefreshResources(framebuffer);
@@ -363,8 +365,8 @@ void BlitScreen::Draw(RasterizerVulkan& rasterizer, const Tegra::FramebufferConf
if (fsr) {
const auto crop_rect = Tegra::NormalizeCrop(framebuffer, texture_width, texture_height);
const VkExtent2D fsr_input_size{
- .width = Settings::values.resolution_info.ScaleUp(texture_width),
- .height = Settings::values.resolution_info.ScaleUp(texture_height),
+ .width = scaled_width,
+ .height = scaled_height,
};
VkImageView fsr_image_view =
fsr->Draw(scheduler, image_index, source_image_view, fsr_input_size, crop_rect);
diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.h b/src/video_core/renderer_vulkan/vk_blit_screen.h
index 40338886a..56ac47f08 100644
--- a/src/video_core/renderer_vulkan/vk_blit_screen.h
+++ b/src/video_core/renderer_vulkan/vk_blit_screen.h
@@ -47,6 +47,8 @@ struct FramebufferTextureInfo {
VkImageView image_view{};
u32 width{};
u32 height{};
+ u32 scaled_width{};
+ u32 scaled_height{};
};
class BlitScreen {
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
index e593d7225..aa0a027bb 100644
--- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp
+++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
@@ -788,18 +788,22 @@ std::optional<FramebufferTextureInfo> RasterizerVulkan::AccelerateDisplay(
return {};
}
std::scoped_lock lock{texture_cache.mutex};
- ImageView* const image_view =
+ const auto [image_view, scaled] =
texture_cache.TryFindFramebufferImageView(config, framebuffer_addr);
if (!image_view) {
return {};
}
query_cache.NotifySegment(false);
+ const auto& resolution = Settings::values.resolution_info;
+
FramebufferTextureInfo info{};
info.image = image_view->ImageHandle();
info.image_view = image_view->Handle(Shader::TextureType::Color2D);
info.width = image_view->size.width;
info.height = image_view->size.height;
+ info.scaled_width = scaled ? resolution.ScaleUp(info.width) : info.width;
+ info.scaled_height = scaled ? resolution.ScaleUp(info.height) : info.height;
return info;
}