Browse Source

Text: GL::textureFormat() actually never returns sized formats on ES2.

So this branch can be just an assert and the never covered setStorage()
call can be removed.
pull/482/merge
Vladimír Vondruš 3 weeks ago
parent
commit
36c521e684
  1. 26
      src/Magnum/Text/GlyphCacheGL.cpp

26
src/Magnum/Text/GlyphCacheGL.cpp

@ -72,19 +72,19 @@ GlyphCacheGL::State::State(const PixelFormat format, const Vector2i& size, const
pixelFormat = GL::PixelFormat::Red; pixelFormat = GL::PixelFormat::Red;
} }
/* And use setImage() instead of setStorage() if the format is unsized, as /* On ES2, GL::textureFormat() always produces an unsized format, so we
EXT_texture_storage doesn't allow those */ have to use setImage() instead of setStorage() as EXT_texture_storage
if(textureFormat == GL::TextureFormat::Red || doesn't allow those */
textureFormat == GL::TextureFormat::Luminance || CORRADE_INTERNAL_ASSERT(
textureFormat == GL::TextureFormat::RG || textureFormat == GL::TextureFormat::Red ||
textureFormat == GL::TextureFormat::LuminanceAlpha || textureFormat == GL::TextureFormat::Luminance ||
textureFormat == GL::TextureFormat::RGB || textureFormat == GL::TextureFormat::RG ||
textureFormat == GL::TextureFormat::SRGB || textureFormat == GL::TextureFormat::LuminanceAlpha ||
textureFormat == GL::TextureFormat::RGBA || textureFormat == GL::TextureFormat::RGB ||
textureFormat == GL::TextureFormat::SRGBAlpha) textureFormat == GL::TextureFormat::SRGB ||
texture.setImage(0, textureFormat, ImageView2D{pixelFormat, GL::PixelType::UnsignedByte, processedSize}); textureFormat == GL::TextureFormat::RGBA ||
else textureFormat == GL::TextureFormat::SRGBAlpha);
texture.setStorage(1, textureFormat, processedSize); texture.setImage(0, textureFormat, ImageView2D{pixelFormat, GL::PixelType::UnsignedByte, processedSize});
#else #else
texture.setStorage(1, GL::textureFormat(processedFormat), processedSize); texture.setStorage(1, GL::textureFormat(processedFormat), processedSize);
#endif #endif

Loading…
Cancel
Save