Compare commits

..

1 Commits

Author SHA1 Message Date
wildcard 589ea324e6 [vulkan] Fix TOTK dark squares
Qualcomm and Turnip use different subpixel rounding for Vulkan texture
gather coordinates than the Switch's Maxwell GPU. This can select the
wrong texels near texture boundaries, producing large black squares in TOTK
2026-10-21 18:26:37 +02:00
2 changed files with 4 additions and 7 deletions
@@ -447,7 +447,9 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_,
driver_id == VK_DRIVER_ID_AMD_OPEN_SOURCE ||
driver_id == VK_DRIVER_ID_MESA_RADV ||
driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS ||
driver_id == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA,
driver_id == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA ||
driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY ||
driver_id == VK_DRIVER_ID_MESA_TURNIP,
.has_broken_spirv_clamp = driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS,
.has_broken_spirv_position_input = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY,
@@ -82,12 +82,7 @@ VkViewport GetViewportState(const Device& device, const Maxwell& regs, size_t in
if (lower_left) {
// Flip by surface clip height
const float clip_height = conv(static_cast<f32>(regs.surface_clip.height));
if (src.scale_y < 0.0f && y >= clip_height) {
y = clip_height - y;
} else {
y += clip_height;
}
y += conv(static_cast<f32>(regs.surface_clip.height));
height = -height;
}