From 3e878a878fcdabd3272631d0af53fa68a42eed42 Mon Sep 17 00:00:00 2001 From: kuba Date: Sat, 26 Sep 2026 20:50:16 +0200 Subject: [PATCH] [Vk] Bind descriptor sets instead of push descriptors on MoltenVK MoltenVK returns zero from OpArrayLength for storage buffers bound through push descriptors, so every bounds-checked buffer load read zero and every store was dropped. In Poppy Playtime this left UE's motion blur indirect dispatch arguments unwritten; the GPU then ran a 4294967295x1612x1490 dispatch and hung, and the game aborted on the render thread timeout. --- .../VideoOut/VulkanVideoPresenter.Device.Setup.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SharpEmu.Libs/VideoOut/VulkanVideoPresenter.Device.Setup.cs b/src/SharpEmu.Libs/VideoOut/VulkanVideoPresenter.Device.Setup.cs index f638a4f..f5c9524 100644 --- a/src/SharpEmu.Libs/VideoOut/VulkanVideoPresenter.Device.Setup.cs +++ b/src/SharpEmu.Libs/VideoOut/VulkanVideoPresenter.Device.Setup.cs @@ -592,7 +592,9 @@ internal static unsafe partial class VulkanVideoPresenter }; _vk.GetPhysicalDeviceProperties2(_physicalDevice, &properties2); SetNativeSubgroupCapabilities(subgroup.SubgroupSize, subgroup.SupportedStages); - _maxPushDescriptors = pushDescriptorProperties.MaxPushDescriptors; + // MoltenVK reports a zero OpArrayLength for storage buffers bound through push + // descriptors, which turns every bounds-checked load into zero and drops every store. + _maxPushDescriptors = IsDeviceExtensionAvailable(PortabilitySubsetExtensionName) ? 0 : pushDescriptorProperties.MaxPushDescriptors; _noAttachmentSampleCounts = properties.Limits.FramebufferNoAttachmentsSampleCounts; _maxComputeWorkGroupCountX = properties.Limits.MaxComputeWorkGroupCount[0]; _maxComputeWorkGroupCountY = properties.Limits.MaxComputeWorkGroupCount[1];