|
|
@ -1572,10 +1572,16 @@ void RasterizerVulkan::UpdateViewportsState(Tegra::Engines::Maxwell3D::Regs& reg |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if (!regs.viewport_scale_offset_enabled) { |
|
|
if (!regs.viewport_scale_offset_enabled) { |
|
|
|
|
|
const bool is_rescaling{texture_cache.IsRescaling()}; |
|
|
|
|
|
const float scale = is_rescaling ? Settings::values.resolution_info.up_factor : 1.0f; |
|
|
float x = static_cast<float>(regs.surface_clip.x); |
|
|
float x = static_cast<float>(regs.surface_clip.x); |
|
|
float y = static_cast<float>(regs.surface_clip.y); |
|
|
float y = static_cast<float>(regs.surface_clip.y); |
|
|
float width = (std::max)(1.0f, static_cast<float>(regs.surface_clip.width)); |
|
|
float width = (std::max)(1.0f, static_cast<float>(regs.surface_clip.width)); |
|
|
float height = (std::max)(1.0f, static_cast<float>(regs.surface_clip.height)); |
|
|
float height = (std::max)(1.0f, static_cast<float>(regs.surface_clip.height)); |
|
|
|
|
|
x *= scale; |
|
|
|
|
|
y *= scale; |
|
|
|
|
|
width *= scale; |
|
|
|
|
|
height *= scale; |
|
|
if (regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft) { |
|
|
if (regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft) { |
|
|
y += height; |
|
|
y += height; |
|
|
height = -height; |
|
|
height = -height; |
|
|
@ -1639,6 +1645,13 @@ void RasterizerVulkan::UpdateScissorsState(Tegra::Engines::Maxwell3D::Regs& regs |
|
|
if (regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft) { |
|
|
if (regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft) { |
|
|
y = regs.surface_clip.height - (y + height); |
|
|
y = regs.surface_clip.height - (y + height); |
|
|
} |
|
|
} |
|
|
|
|
|
if (texture_cache.IsRescaling()) { |
|
|
|
|
|
const auto& resolution = Settings::values.resolution_info; |
|
|
|
|
|
x = resolution.ScaleUp(x); |
|
|
|
|
|
y = resolution.ScaleUp(y); |
|
|
|
|
|
width = resolution.ScaleUp(width); |
|
|
|
|
|
height = resolution.ScaleUp(height); |
|
|
|
|
|
} |
|
|
VkRect2D scissor{}; |
|
|
VkRect2D scissor{}; |
|
|
scissor.offset.x = static_cast<int32_t>(x); |
|
|
scissor.offset.x = static_cast<int32_t>(x); |
|
|
scissor.offset.y = static_cast<int32_t>(y); |
|
|
scissor.offset.y = static_cast<int32_t>(y); |
|
|
|