If global variables are present in shaders and exist before uniform declarations (like SAMPLER2D()) shaderc will (sometimes?) not include the uniform information in the compiled bin files.
For example:
#include "common.sh" //if this include contains any global variables (which are not optimised away by dce) the uniform below will not be assignable from bgfx
SAMPLER2D(u_albedo, 0);
This isn't mentioned in the docs and likely to cause headaches for others (as it did me).
Occurs when using default shaderc settings (shaderc -f fs_shader.sh -o fs_shader.bin --type f)
If global variables are present in shaders and exist before uniform declarations (like
SAMPLER2D()
) shaderc will (sometimes?) not include the uniform information in the compiled bin files.For example:
This isn't mentioned in the docs and likely to cause headaches for others (as it did me).
Occurs when using default shaderc settings (
shaderc -f fs_shader.sh -o fs_shader.bin --type f
)