Bug 1: Pre-rotation not applied
Rendering is sideways when using Vulkan to render. Turning off Alternate Surface Rendering works around this.
This is yet another bug from the vulkan driver. They should turn on pretransform upon vkGetPhysicalDeviceSurfaceCapabilitiesKHR but they don't.
Planned fix
- Override
VK_ERROR_OUT_OF_DATE_KHR with VK_SUBOPTIMAL_KHR to trigger swapchain reconfiguration within mojang code
- Override
vkCreateSwapchainKHR with a new surface pointer we create and manage (we ignore surface pointers mojang gives us)
- Trigger this mechanism and apply prerotation on device rotation. Android itself will also trigger this mechanism itself
- We cannot create a surface without a valid ANativeWindow, this means we will have to stall the render thread during
vkCreateSwapchainKHR until a valid ANativeWindow appears. This will happen when using SurfaceView/ASR and tabbing out or triggering floating mode for the first time since surface creation in TextureView
Bug 2: Invalid Extensions
This extension has been superseded by VK_KHR_vertex_attribute_divisor in Vulkan 1.4 but Mojang only supports VK_EXT_vertex_attribute_divisor. We will need to emulate this since the functions have been renamed and supportsNonZeroFirstInstance was added.
This is only used in a wireframe debug renderer. Just say we have it. Invert it instead. Minecraft has removed the requirement on later snapshots. We want to support everything so only fake it when necessary.
Bug 1: Pre-rotation not applied
Rendering is sideways when using Vulkan to render. Turning off Alternate Surface Rendering works around this.
This is yet another bug from the vulkan driver. They should turn on pretransform upon
vkGetPhysicalDeviceSurfaceCapabilitiesKHRbut they don't.Planned fix
VK_ERROR_OUT_OF_DATE_KHRwithVK_SUBOPTIMAL_KHRto trigger swapchain reconfiguration within mojang codevkCreateSwapchainKHRwith a new surface pointer we create and manage (we ignore surface pointers mojang gives us)vkCreateSwapchainKHRuntil a valid ANativeWindow appears. This will happen when using SurfaceView/ASR and tabbing out or triggering floating mode for the first time since surface creation in TextureViewBug 2: Invalid Extensions
VK_EXT_vertex_attribute_divisorThis extension has been superseded by VK_KHR_vertex_attribute_divisor in Vulkan 1.4 but Mojang only supports
VK_EXT_vertex_attribute_divisor. We will need to emulate this since the functions have been renamed andsupportsNonZeroFirstInstancewas added.feature: fillModeNonSolid
This is only used in a wireframe debug renderer. Just say we have it.Invert it instead. Minecraft has removed the requirement on later snapshots. We want to support everything so only fake it when necessary.