(comments)
原始链接: https://news.ycombinator.com/item?id=44026170
This Hacker News thread discusses the complexities of shader compilation, sparked by an article on the topic. Users highlight challenges such as the lossy nature of SPIRV-cross, varying API support (especially Metal's), and the messy binding model. The discussion touches on the proprietary nature of console shader systems (PlayStation's LibGNM/GNMX and Switch's NVN) and the difficulty of publicly discussing them.
BGFX's GLSL-like approach with macro expansions is mentioned as an alternative. The thread praises the WebGPU API for its cross-platform collaboration but notes its limited support outside ChromeOS. Slang is suggested as a promising cross-platform shading language, prompting a discussion on funding a Rust implementation to improve developer experience.
The conversation also delves into the frustration of long shader compilation times in games like Call of Duty, questioning why this can't be done in the background when the computer is idle. Solutions like on-demand compilation (causing micro-stutters) and reducing the number of shader variants are proposed. Steam's shader sharing for Vulkan is mentioned as a partial solution.
But the main problem is not the shader language itself, but the binding model. It's a pretty big mess, and things change as you go in the direction of bindless (descriptor indexing). There are a few approaches to this, certainly reinventing WebGPU is one. Another intriguing approach is blade[1] by Dzmitry Malyshau.
I wish the authors well, but this is a hard road, especially if the goal is to enable more advanced features including compute.
[1]: https://github.com/kvark/blade
reply