Closed gameoflord012 closed 4 months ago
The idea is that shaders can define an explicit uniform location via layout(location = N)
, and in that case no uniform name needs to be provided.:
https://www.khronos.org/opengl/wiki/Layout_Qualifier_(GLSL)#Explicit_uniform_location
It's a very obscure feature though that's not actually used in any sample code, not used by the sokol-shdc shader compiler and also requires an extension or recent GL version.
It also only works on desktop GL, not GLES3 (in GLES3 uniform names are required: https://github.com/floooh/sokol/blob/b1221d1f2bfc3cbb22f566cfa8f31b4073c287ae/sokol_gfx.h#L16300-L16302).
TL;DR: it's not exactly a bug, but also not exactly a core feature, don't rely on it.
In _sg_gl_create_shader() function line 8523 in file sokol_gfx.h
Isn't there should be an assertion(false) instead of assign to u_index which is meaningless?