Post

fantastic! thanks for doing thisβ€”I hope it gets y’all a bunch of new players. would love to know more about what the rewrite entailed (presumably complications around TBDR and maybe scheduling?); will keep a hopeful eye out for a blog post.

It was (initially) mostly about efficiently using the API - TG used OpenGL at the start, so our binding model was a huge anti-pattern in Vulkan (and thus Metal). The new backend uses descriptor sets as a first-class feature, deduplicates state changes, and does less bookkeeping of object lifetimes.

We now also precompute 99% of pipelines to avoid shader compilation stalls since compiling shaders via MoltenVK is much slower than on PC. I've also fixed a few validation errors that newer Vulkan SDKs started detecting, and fixed a swapchain misuse when the compositor hands us images out of order.

On the shader side, we've switched from HLSL to Slang. Then when it comes to higher-level stuff, shadows were a major bottleneck on the MacBook Neo, so they now use SDSM and precise culling (using a shadow visibility mask based on screen tile contents; no occlusion culling yet tho)