video_core: consistently account for resolution scaling when rendering
This commit is contained in:
parent
80de01a5b4
commit
453091f611
10 changed files with 40 additions and 31 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ struct FramebufferTextureInfo {
|
|||
VkImageView image_view{};
|
||||
u32 width{};
|
||||
u32 height{};
|
||||
u32 scaled_width{};
|
||||
u32 scaled_height{};
|
||||
};
|
||||
|
||||
class BlitScreen {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in a new issue