Set all viewports and scissors when the viewport transform is disabled (#372)

Only viewport 0 and scissor 0 were set in this case. The pipeline uses every supported viewport, so the others kept old values. Fill them all with the surface clip.
This commit is contained in:
Bruno 2026-10-07 14:00:28 +02:00 committed by GitHub
parent 098eaa20d3
commit e400c39ac6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 2 deletions

View File

@ -1059,7 +1059,13 @@ void RasterizerVulkan::UpdateViewportsState(Tegra::Engines::Maxwell3D::Regs& reg
.minDepth = 0.0f,
.maxDepth = 1.0f,
};
scheduler.Record([viewport](vk::CommandBuffer cmdbuf) { cmdbuf.SetViewport(0, viewport); });
scheduler.Record([this, viewport](vk::CommandBuffer cmdbuf) {
const u32 num_viewports = std::min<u32>(device.GetMaxViewports(), Maxwell::NumViewports);
std::array<VkViewport, Maxwell::NumViewports> viewport_list{};
viewport_list.fill(viewport);
const vk::Span<VkViewport> viewports(viewport_list.data(), num_viewports);
cmdbuf.SetViewport(0, viewports);
});
return;
}
const bool is_rescaling{texture_cache.IsRescaling()};
@ -1095,7 +1101,13 @@ void RasterizerVulkan::UpdateScissorsState(Tegra::Engines::Maxwell3D::Regs& regs
scissor.offset.y = static_cast<u32>(y);
scissor.extent.width = static_cast<u32>(width != 0.0f ? width : 1.0f);
scissor.extent.height = static_cast<u32>(height != 0.0f ? height : 1.0f);
scheduler.Record([scissor](vk::CommandBuffer cmdbuf) { cmdbuf.SetScissor(0, scissor); });
scheduler.Record([this, scissor](vk::CommandBuffer cmdbuf) {
const u32 num_scissors = std::min<u32>(device.GetMaxViewports(), Maxwell::NumViewports);
std::array<VkRect2D, Maxwell::NumViewports> scissor_list{};
scissor_list.fill(scissor);
const vk::Span<VkRect2D> scissors(scissor_list.data(), num_scissors);
cmdbuf.SetScissor(0, scissors);
});
return;
}
u32 up_scale = 1;