sokol_gfx.h: missing validation check in for number of mipmaps when creating image
I've found out some difference with generating MIP maps in OpenGL and Direct3D backends of Sokol. In OpenGl backend all MIP maps to 1 pixel resolution are needed otherwise black texture is appeared. In Direct3D backend it works fine with any number of MIP maps. Is this trait of OpenGL or Sokol? May be doing some assert or warning about this trait in OpenGL backend is good idea....
Hmm, true, looks like this is a missing validation check in sokol-gfx. The intent is that you either provide no mipmaps (only the highest level surface), so sg_image_desc.num_mipmaps =1, or the full mipmap chain down to 1x1, with num_mipmaps = log2((w > h) ? w : h) + 1;.
I'll need to look around in the GL, D3D11 and Metal docs what's the behaviour when the user restricts access to mipmaps (via sg_image_desc.min_lod and max_lod), but this is not allowed in GLES2/WebGL anyway, so I think it's best to use the rule "either no mipmaps, or all".
I'll rename the ticket and keep it open, and thanks for writing the bug report :)
This has been fixed in the meantime by dropping the GLES2 backend, and generally setting GL_TEXTURE_MAX_LEVEL when creating GL textures.