Open zhongyin-hu opened 5 years ago
I just stumbled on the same issue on Metal in this second.
Using the new version of shaderc solved this issue for me
@thegabman Hi thanks for the info. Which exact version do you use? I tried BGFX_API_VERSION (91) and this issue still persists on my end.
I run into this issue if no specifying --profile
which defaults to essl = 2
.
Try adding --profile 120
to your command if you're not using essl.
@bwrsandman Thank you for providing this solution
Hi, I'm having trouble using SAMPLER2DARRAY and have been stuck for a while. I have tested it in a very simple shader. But it seems that the sampler2DArray is not recognized by bgfx. I also tried SAMPLER2D and SAMPLER3D and those are fine.
my_fragment_shader.sc
include
SAMPLER2DARRAY(u_texture0, 0);
void main() {
gl_FragColor = vec4(1,1,1,1); }
Error msg from compiler: 95: uniform sampler2DArray u_texture0; 24: ^
Error: (95,24): error: syntax error, unexpected NEW_IDENTIFIER, expecting '{'
I look at bgfx_shader.sh and it seems that SAMPLER2DARRAY macro is defined a couple of places depending on the BGFX_SHADERLANGUAGE* I tried both Vulkan and OpenGL for the renderer type of my program, but both have the same compile issue. I also checked BGFX_CAPS_TEXTURE_2D_ARRAY is enabled.
Any thought what may go wrong? Many thanks! I appreciated your attention.