lavapipe: wrong surface dimensions in VkSurfaceCapabilitiesKHR
Thanks to the great work by zmike and airlied, yuzu is now able to boot in Vulkan mode using lavapipe with this PR branch.
However, when booting applications inside the emulator, the lavapipe backend gets the surface dimensions incorrect. I have attached a basic example program that can be booted without console keys: simple_triangle.nro (free software, compiled from here).
In anv and radv, the image renders at the full dimensions of the screen:
However, when changing to use lavapipe (Emulation > Configure... > Graphics > Device), the image renders at a tiny 100x30 resolution:
The swapchain is recreated here; just before, vkGetSurfaceCapabilitiesKHR is returning 100x30 for capabilities.currentExtent when using lavapipe. With radv, it returns 3840x1933 on my 4K monitor. This appears to be due to the swapchain being recreated just before graphical presentation begins; a breakpoint placed here only is hit once with lavapipe but twice with radv.
(With debugging tools, the internal representation before the swapchain images is rendered at full resolution; it's just the presentation step that isn't working.)