Browse Source

Shaders: bind an attribute even if not (dynamically) used on WebGL.

Just alias it to some other attribute. Fixes another WebGL error.
pull/601/head
Vladimír Vondruš 3 years ago
parent
commit
fa98ea3211
  1. 6
      src/Magnum/Shaders/Test/FlatGLTest.cpp
  2. 6
      src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp
  3. 6
      src/Magnum/Shaders/Test/PhongGLTest.cpp

6
src/Magnum/Shaders/Test/FlatGLTest.cpp

@ -586,6 +586,12 @@ const struct {
}}, false, true, false,
"skinning.tga"},
{"only secondary set, dynamic", 5, 4, 4, 0, 3, FlatGL2D::Flag::DynamicPerVertexJointCount, {InPlaceInit, {
#ifdef MAGNUM_TARGET_WEBGL
/* On WebGL the primary joint vertex attribute has to be bound to
something even if not (dynamically) used in the end, otherwise
it causes an error. So just alias it with the secondary one. */
{0, FlatGL2D::JointIds{FlatGL2D::JointIds::Components::Three}},
#endif
{0, FlatGL2D::SecondaryJointIds{FlatGL2D::SecondaryJointIds::Components::Three}},
{3*4, FlatGL2D::SecondaryWeights{FlatGL2D::SecondaryWeights::Components::Three}},
}}, true, true, false,

6
src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp

@ -991,6 +991,12 @@ const struct {
{"only secondary set, dynamic", 5, 4, 4, 0, 3,
MeshVisualizerGL2D::Flag::DynamicPerVertexJointCount,
MeshVisualizerGL3D::Flag::DynamicPerVertexJointCount, {InPlaceInit, {
#ifdef MAGNUM_TARGET_WEBGL
/* On WebGL the primary joint vertex attribute has to be bound to
something even if not (dynamically) used in the end, otherwise
it causes an error. So just alias it with the secondary one. */
{0, MeshVisualizerGL2D::JointIds{MeshVisualizerGL2D::JointIds::Components::Three}},
#endif
{0, MeshVisualizerGL2D::SecondaryJointIds{MeshVisualizerGL2D::SecondaryJointIds::Components::Three}},
{3*4, MeshVisualizerGL2D::SecondaryWeights{MeshVisualizerGL2D::SecondaryWeights::Components::Three}},
}}, true, true, false,

6
src/Magnum/Shaders/Test/PhongGLTest.cpp

@ -901,6 +901,12 @@ const struct {
}}, false, true, false,
"skinning.tga"},
{"only secondary set, dynamic", 5, 4, 4, 0, 3, PhongGL::Flag::DynamicPerVertexJointCount, {InPlaceInit, {
#ifdef MAGNUM_TARGET_WEBGL
/* On WebGL the primary joint vertex attribute has to be bound to
something even if not (dynamically) used in the end, otherwise
it causes an error. So just alias it with the secondary one. */
{0, PhongGL::JointIds{PhongGL::JointIds::Components::Three}},
#endif
{0, PhongGL::SecondaryJointIds{PhongGL::SecondaryJointIds::Components::Three}},
{3*4, PhongGL::SecondaryWeights{PhongGL::SecondaryWeights::Components::Three}},
}}, true, true, false,

Loading…
Cancel
Save