floooh / sokol

minimal cross-platform standalone C headers
https://floooh.github.io/sokol-html5
zlib License
6.63k stars 472 forks source link

GL Backend: trying to render into mipmap level other than 0 results in incomplete framebuffer. #923

Closed floooh closed 9 months ago

floooh commented 9 months ago

Just putting part of https://github.com/floooh/sokol/issues/912 into a new ticket:

When creating a GL render target texture with mipmaps, GL_TEXTURE_MAX_LEVEL must be initialized, otherwise trying to render into mipmap levels other then 0 results in an incomplete framebuffer.

(apparently calling glTexImage2D() with a null data ptr doesn't actually reserve storage for that mip level)