The bgfx shader compiler, 14 years of not being a compiler

Introduction bgfx renders through many backends, and each of them wants shaders in its own language: HLSL for Direct3D, Metal Shading Language on Apple platforms, GLSL for OpenGL and ESSL for OpenGL ES, SPIR-V for Vulkan, WGSL for WebGPU, etc. Nobody wants to write and maintain one shader per API. So bgfx has a shader compiler, shaderc, that takes a single source written in bgfx’s GLSL-flavoured dialect and produces a binary blob for whichever backend you ask for.

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论