Browse Source

TextureTools: don't require more than 8 texture units in distanceField().

ES2 contexts on iOS don't have more than that. It's weird, because ES3
contexts have 16.
pull/191/head
Vladimír Vondruš 8 years ago
parent
commit
2e4beb361c
  1. 6
      doc/changelog.dox
  2. 4
      src/Magnum/TextureTools/DistanceField.cpp
  3. 2
      src/Magnum/TextureTools/DistanceFieldShader.frag

6
doc/changelog.dox

@ -122,6 +122,12 @@ See also:
@ref Shaders::VertexColor::Color4 attribute specifiers for more convenient
distinction between three- and four-component vertex color attribute.
@subsubsection changelog-latest-changes-texturetools TextureTools library
- Fixed @ref TextureTools::distanceField() to not require more than 8 texture
units, which is the limit on all iOS ES2 contexts, independently on the
device (ES3 contexts have 16).
@subsubsection changelog-latest-changes-trade Trade library
- @ref Trade::PhongMaterialData now contains well-defined color values

4
src/Magnum/TextureTools/DistanceField.cpp

@ -75,7 +75,9 @@ class DistanceFieldShader: public GL::AbstractShaderProgram {
}
private:
enum: Int { TextureUnit = 8 };
/* ES2 on iOS (apparently independent on the device) has only 8 texture
units, so be careful to not step over that. ES3 has 16. */
enum: Int { TextureUnit = 7 };
Int radiusUniform{0},
scalingUniform{1},

2
src/Magnum/TextureTools/DistanceFieldShader.frag

@ -46,7 +46,7 @@ uniform mediump vec2 scaling;
#endif
#ifdef EXPLICIT_TEXTURE_LAYER
layout(binding = 8) uniform sampler2D textureData;
layout(binding = 7) uniform sampler2D textureData;
#else
uniform lowp sampler2D textureData;
#endif

Loading…
Cancel
Save