Skip to content

Android Vulkan: fix null vkCmdPushDescriptorSetKHR crash + silence spurious SetFormat notification - #291

Merged
winnerspiros merged 2 commits into
masterfrom
copilot/fix-vulkan-black-screen-again
May 2, 2026
Merged

Android Vulkan: fix null vkCmdPushDescriptorSetKHR crash + silence spurious SetFormat notification#291
winnerspiros merged 2 commits into
masterfrom
copilot/fix-vulkan-black-screen-again

Conversation

Copilot AI commented May 2, 2026

Copy link
Copy Markdown

Vulkan crashed on every frame on Android (SIGSEGV PC=0 on Draw thread) due to vkCmdPushDescriptorSetKHR being a null pointer. A second unrelated annoyance: an Important-level log was popping a HUD notification on every OpenGL/Auto launch.

Vulkan null function pointer (veldrid + framework bump)

On Android, libvulkan.so does not export device-level extension functions via dlsym. ppy.Vk's VulkanNative loads all function pointers at startup via dlsym, so vkCmdPushDescriptorSetKHR_ptr = IntPtr.Zero. Veldrid saw VK_KHR_push_descriptor in the extension list, set HasPushDescriptors = true, and routed every resource set through pushDescriptorSet() → call through null ptr → crash.

Fix in winnerspiros/veldrid: load vkCmdPushDescriptorSetKHR via getDeviceProcAddr (same pattern as CmdBeginRendering, CmdSetFragmentShadingRate, etc.) and gate HasPushDescriptors on the pointer being non-null:

// Before (null on Android — dlsym doesn't resolve device extension functions):
vkCmdPushDescriptorSetKHR(CommandBuffer, bindPoint, layout, set, count, writes);

// After (correct — loaded via vkGetDeviceProcAddr):
CmdPushDescriptorSet = getDeviceProcAddr<VkCmdPushDescriptorSetKHRT>("vkCmdPushDescriptorSetKHR"u8);
HasPushDescriptors = CmdPushDescriptorSet != null && MaxPushDescriptors > 0;
// ...
gd.CmdPushDescriptorSet(CommandBuffer, bindPoint, layout, set, count, writes);

Bumps ppy.osu.Framework / .Android / .iOS 2026.502.32026.502.4 which ships this fix.

Spurious HUD notification

OsuGameActivity logged "SurfaceHolder.SetFormat skipped (OpenGL/Auto renderer — SDL3 handles format)" at LogLevel.Important on every OpenGL/Auto launch. This is the normal, expected code path — demoted to LogLevel.Debug so it stays in the log file only.

Copilot AI and others added 2 commits May 2, 2026 20:10
@gitar-bot

gitar-bot Bot commented May 2, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

@winnerspiros
winnerspiros marked this pull request as ready for review May 2, 2026 21:12
Copilot AI review requested due to automatic review settings May 2, 2026 21:12
@winnerspiros
winnerspiros merged commit b9a9283 into master May 2, 2026
13 of 15 checks passed
Copilot AI removed the request for review from Copilot May 2, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants