Open MeFisto94 opened 4 years ago
Me: If we had a gradle task to SPIRV, we could even support HLSL for the engine
@riccardobl on Discord: yes but there are several many problems
Me:
@riccardobl i don't have that extension, btw (https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_gl_spirv.txt) Mesa 20.0.0-devel (git-0f60aa4 2019-12-07 bionic-oibaf-ppa) they are the default for amd cards on linux
Me: okay, WebGL doesn't support it either, which is sad http://renderingpipeline.com/webgl-extension-viewer/ potential gains could be:
@riccardobl: it won't, because we have different uniforms and uncompiled shaders are more platform agnostic because every platform will compile with its compiler
See https://eleni.mutantstargoat.com/hikiko/2018/03/04/opengl-spirv/ TLDR is: When using proper (GLSL 450) openGL Shaders, we can cross compile them to SPIRV (and potentially ship it with a game) and the Graphics APIs should all support SPIRV ("compiled shader"), which can directly be evaluated by those. This yields in faster speed as the drivers don't have to manually compile instructions and also maximum platform compatibility.
Projects like https://github.com/KhronosGroup/SPIRV-Cross allow SPIRV to be cross compiled to GLSL, HLSL (Direct X) and Metal (Mac OS X), so that even when SPIRV Extensions aren't available, one can use the native backends for shaders at least.
This is in particular interesting as Vulkan as a Backend also supports SPIRV