mirror of https://github.com/mosra/magnum.git
Browse Source
Originally GL::hasTextureFormat() returned false on ES2 for PixelFormat::R8Unorm, RG8Unorm, RGB8Unorm and RGBA8Unorm because glTexStorage() didn't work with the matching Luminance, LuminanceAlpha, RGB and RGBA formats. But since the only ES2 platform is nowadays basically just WebGL 1, which has neither EXT_texture_rg nor EXT_texture_storage, this implicit failure made no sense and just made the textureFormat() (and the new genericPixelFormat() API) useless there. Now it maps to them, and it's up to the caller to make sure glTexStorage() doesn't get called with those, only glTexImage does. Furthermore, if formats from EXT_texture_rg are used, the genericPixelFormat() now also provides inverse mapping of them back to the generic PixelFormat. Before it was basically *no* ES2 TextureFormat that'd work with either of these, now it's all that have a (vaguely) corresponding PixelFormat.pull/168/head
4 changed files with 107 additions and 18 deletions
Loading…
Reference in new issue