Browse Source

TextureTools: fix distance field converter on 3.0 <= GL < 3.2.

The shader code took the image size from uniform if the GL was older
than version 3.2 (GLSL 1.50). But the shader class was setting that
uniform only if the GL was older than version 3.0. Thus the distance
field converter worked only on GL 2.1 and GL >= 3.2.

This was discovered only by accident, thanks to the quite recent
attempts to create core contexts by default. Because apparently setting
explicit version requirements (core GL 3.1) on AMDwill make
wglCreateContext() stay on that version and not choosing any later
compatible version, similarly to how NVidia behaves. That's another bug
for later.

Before the application was just creating the context the old way, thus
all cards compatible with GL3 were at least on GL 3.2 and thus the
missing uniform setting did not affect anybody, thus the bug was
effectively hidden.
pull/118/head
Vladimír Vondruš 11 years ago
parent
commit
5170aa4978
  1. 4
      src/Magnum/TextureTools/DistanceField.cpp

4
src/Magnum/TextureTools/DistanceField.cpp

@ -127,7 +127,7 @@ DistanceFieldShader::DistanceFieldShader(): radiusUniform(0), scalingUniform(1)
scalingUniform = uniformLocation("scaling");
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isVersionSupported(Version::GL300))
if(!Context::current()->isVersionSupported(Version::GL320))
#else
if(!Context::current()->isVersionSupported(Version::GLES300))
#endif
@ -179,7 +179,7 @@ void distanceField(Texture2D& input, Texture2D& output, const Range2Di& rectangl
.setTexture(input);
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isVersionSupported(Version::GL300))
if(!Context::current()->isVersionSupported(Version::GL320))
#else
if(!Context::current()->isVersionSupported(Version::GLES300))
#endif

Loading…
Cancel
Save