4 ms·
The pain of GL shaders, only because they don't embrace modern programming like modules and bytecode delivery. That is how one ends up with shader minification
by pjmlp 2y ago
The pain of GL shaders, only because they don't embrace modern programming like modules and bytecode delivery.
That is how one ends up with shader minification.
And this is still quite actual as pain point, given how shaders work in 3D Web APIs.
- ryao 2y agoRegarding bytecode delivery, have you seen SPIR-V? As for modules, avoiding them is a performance feature since it is easier to optimize code when you compile everything in one unit. Rather than go toward modules, modern graphics has moved away from them by removing dynamic linking from newer shader languages such as SPIR-V. I believe a limited form of dynamic linking was later introduced in the form of graphics pipeline libraries for avoiding performance issues from a combinatoric explosion of partially redundant compilations when translating shaders from Direct3D 11 and earlier, but for anything outside of translating other APIs, you are supposed to avoid using that as far as I know.
- TazeTSchnitzel 2y agoDynamic linking is returning because of ray-tracing also.
- pjmlp 2y agoOf course, but that is only for Vulkan, technically it is possible with OpenGL 4.6, but I doubt anyone is bothering with it. It is also the way on most proprietary APIs. Metal and DirectX have dynamic linking, shader libraries, and one thing slang thankfully has, is exactly being a modern modular language, which has been given to Khronos as GLSL successor, alongside the already major adoption HLSL, GLSL is done.
- deleted 2y ago[deleted]
- manchmalscott 2y agoI mean, in my personal projects I've transpiled GLSL into spir-v bytecode for use with OpenGL 4.5, even. Libshaderc has suppported that for years.
- pjmlp 2y agoMaybe using extensions? "Khronos Releases OpenGL 4.6 with SPIR-V Support" https://www.khronos.org/news/press/khronos-releases-opengl-4.6-with-spir-v-support https://www.khronos.org/news/press/khronos-releases-opengl-4... > OpenGL 4.6 adds support for ingesting SPIR-V shaders to the core specification, guaranteeing that SPIR-V shaders will be widely supported by OpenGL implementations
- BearOso 2y ago> Of course, but that is only for Vulkan, technically it is possible with OpenGL 4.6, but I doubt anyone is bothering with it. https://devblogs.microsoft.com/directx/directx-adopting-spir-v/ https://devblogs.microsoft.com/directx/directx-adopting-spir...
- pjmlp 2y agoYes, and what does that change in the context of GLSL?