I can't think of any complex game codebase I worked on that has shaders all in one file. They all need #include support. When I try to compile our GL shaders (really Vulkan), I get the following failures. Can I use this offline compiler on real .vert and .frag files? I'm trying to figure out why Mali driver puts out VK_DEVICE_LOST on our terrain shaders, and thought seeing the shader analysis might help.
malioc -c Mali-G76 --vulkan --vertex DebugMesh.vert
ERROR: 0X0000: SPIR-V require version 310 or higher. <- fixed below
ERROR: 0:4: X0000: '#include' : required extension not requested: GL_GOOGLE_include_directive
ERROR: 0:4: X0000: '#include' : must be followed by a header name
ERROR: 0ssing entry point: X0000: Each stage requires one entry point <- printing problem
After putting #version 310 es at the top of the file. We don't typically do this, since we need to compile the shaders using spriv-opt for many different versions. There also doesn't seem to be a compile option for this.
ERROR: 0ssing entry point: X0000: Each stage requires one entry point. <- how to specify this ?
Here are the reported extensions, but include support isn't in there.
Vulkan SPIR-V Extensions
Okay so I added the following to the top of our .vert file. Typically shaderc adds these, so it would be nice if malioc did the same for the Vulkan case.
malioc -c Mali-G76 --vulkan --name main DebugMesh.vert
#version 310 es <- had to add
#extension GL_GOOGLE_include_directive: require <- had to add
But now I just get the following. Shader.h is in the same folder as the shader I'm compiling.
ERROR: 0:4: X0000: '#include' : Could not process include directive for header name: Shader.h. <- why ?
ERROR: 0ssing entry point: X0000: Each stage requires one entry point. <- I've got --name above, it's just stock GLSL void main()