Browse Source

Shaders: MeshVisualizer color map binding was done in a wrong branch.

It probably didn't matter as much as the only platform without
ARB_explicit_uniform_location is Mac, which doesn't have
ARB_shading_language_420pack either.
pull/518/head
Vladimír Vondruš 5 years ago
parent
commit
37c8cfd384
  1. 24
      src/Magnum/Shaders/MeshVisualizerGL.cpp

24
src/Magnum/Shaders/MeshVisualizerGL.cpp

@ -293,11 +293,21 @@ MeshVisualizerGL2D::MeshVisualizerGL2D(const Flags flags): Implementation::MeshV
#ifndef MAGNUM_TARGET_GLES2
if(flags & (Flag::InstancedObjectId|Flag::VertexId|Flag::PrimitiveIdFromVertexId)) {
_colorMapOffsetScaleUniform = uniformLocation("colorMapOffsetScale");
setUniform(uniformLocation("colorMapTexture"), ColorMapTextureUnit);
}
#endif
}
#ifndef MAGNUM_TARGET_GLES2
#ifndef MAGNUM_TARGET_GLES
if(flags && !context.isExtensionSupported<GL::Extensions::ARB::shading_language_420pack>(version))
#endif
{
if(flags & (Flag::InstancedObjectId|Flag::VertexId|Flag::PrimitiveIdFromVertexId)) {
setUniform(uniformLocation("colorMapTexture"), ColorMapTextureUnit);
}
}
#endif
/* Set defaults in OpenGL ES (for desktop they are set in shader code itself) */
#ifdef MAGNUM_TARGET_GLES
setTransformationProjectionMatrix(Matrix3{Math::IdentityInit});
@ -509,7 +519,6 @@ MeshVisualizerGL3D::MeshVisualizerGL3D(const Flags flags): Implementation::MeshV
#ifndef MAGNUM_TARGET_GLES2
if(flags & (Flag::InstancedObjectId|Flag::VertexId|Flag::PrimitiveIdFromVertexId)) {
_colorMapOffsetScaleUniform = uniformLocation("colorMapOffsetScale");
setUniform(uniformLocation("colorMapTexture"), ColorMapTextureUnit);
}
#endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
@ -521,6 +530,17 @@ MeshVisualizerGL3D::MeshVisualizerGL3D(const Flags flags): Implementation::MeshV
#endif
}
#ifndef MAGNUM_TARGET_GLES2
#ifndef MAGNUM_TARGET_GLES
if(flags && !context.isExtensionSupported<GL::Extensions::ARB::shading_language_420pack>(version))
#endif
{
if(flags & (Flag::InstancedObjectId|Flag::VertexId|Flag::PrimitiveIdFromVertexId)) {
setUniform(uniformLocation("colorMapTexture"), ColorMapTextureUnit);
}
}
#endif
/* Set defaults in OpenGL ES (for desktop they are set in shader code itself) */
#ifdef MAGNUM_TARGET_GLES
setTransformationMatrix(Matrix4{Math::IdentityInit});

Loading…
Cancel
Save