Add an alternative queue, used on macOS to work around SPIRV-Cross stack overflows

- Increase stack size to 2MB
This commit is contained in:
gdkchan
2026-09-13 21:39:52 -05:00
committed by KeatonTheBot
parent a0ad6f2246
commit 551f29517d
4 changed files with 218 additions and 6 deletions
@@ -55,6 +55,7 @@ namespace Ryujinx.Graphics.Vulkan
internal CommandBufferPool CommandBufferPool { get; private set; }
internal PipelineLayoutCache PipelineLayoutCache { get; private set; }
internal BackgroundResources BackgroundResources { get; private set; }
internal ShaderCompilationQueue ShaderCompilationQueue { get; private set; }
internal Action<Action> InterruptAction { get; private set; }
internal SyncManager SyncManager { get; private set; }
@@ -127,6 +128,12 @@ namespace Ryujinx.Graphics.Vulkan
// Any device running on MacOS is using MoltenVK, even Intel and AMD vendors.
IsMoltenVk = true;
// The default thread stack size on MacOS is low, and can cause stack overflow
// on SPIR-V Cross during shader compilation.
// As a workaround, we use this custom queue which allows us to specify the stack
// size of the threads used for compilation.
ShaderCompilationQueue = new ShaderCompilationQueue();
}
SupportsMTL31 = OperatingSystem.IsMacOSVersionAtLeast(14);
@@ -1112,6 +1119,8 @@ namespace Ryujinx.Graphics.Vulkan
SurfaceApi.DestroySurface(_instance.Instance, _surface, null);
ShaderCompilationQueue?.Dispose();
Api.DestroyDevice(_device, null);
_debugMessenger.Dispose();