diff --git a/src/Magnum/Shaders/Test/FlatGLTest.cpp b/src/Magnum/Shaders/Test/FlatGLTest.cpp index 37a45ca46..c5b3438dc 100644 --- a/src/Magnum/Shaders/Test/FlatGLTest.cpp +++ b/src/Magnum/Shaders/Test/FlatGLTest.cpp @@ -2615,8 +2615,6 @@ template void FlatGLTest::renderInstanced2D() { .setSubImage(0, {image->size().x()/2, 0, 3}, second) .setSubImage(0, {0, 0, 4}, third); shader.bindTexture(textureArray); - if(flag != FlatGL2D::Flag::UniformBuffers) - shader.setTextureLayer(2); /* base offset */ } else #endif @@ -2647,6 +2645,11 @@ template void FlatGLTest::renderInstanced2D() { Vector2{0.5f} )); + #ifndef MAGNUM_TARGET_GLES2 + if(data.flags & FlatGL2D::Flag::TextureArrays) + shader.setTextureLayer(2); /* base offset */ + #endif + #ifndef MAGNUM_TARGET_GLES2 if(data.flags & FlatGL2D::Flag::ObjectId) { /* Gets added to the per-instance ID, if that's enabled as well */ @@ -2879,8 +2882,6 @@ template void FlatGLTest::renderInstanced3D() { .setSubImage(0, {image->size().x()/2, 0, 3}, second) .setSubImage(0, {0, 0, 4}, third); shader.bindTexture(textureArray); - if(flag != FlatGL2D::Flag::UniformBuffers) - shader.setTextureLayer(2); /* base offset */ } else #endif @@ -2912,6 +2913,11 @@ template void FlatGLTest::renderInstanced3D() { Vector2{0.5f} )); + #ifndef MAGNUM_TARGET_GLES2 + if(data.flags & FlatGL3D::Flag::TextureArrays) + shader.setTextureLayer(2); /* base offset */ + #endif + #ifndef MAGNUM_TARGET_GLES2 if(data.flags & FlatGL3D::Flag::ObjectId) { /* Gets added to the per-instance ID, if that's enabled as well */ diff --git a/src/Magnum/Shaders/Test/PhongGLTest.cpp b/src/Magnum/Shaders/Test/PhongGLTest.cpp index 849272de9..1fc7e5fc5 100644 --- a/src/Magnum/Shaders/Test/PhongGLTest.cpp +++ b/src/Magnum/Shaders/Test/PhongGLTest.cpp @@ -3518,8 +3518,6 @@ template void PhongGLTest::renderInstanced() { .setSubImage(0, {image->size().x()/2, 0, 3}, second) .setSubImage(0, {0, 0, 4}, third); shader.bindDiffuseTexture(diffuseArray); - if(flag != PhongGL::Flag::UniformBuffers) - shader.setTextureLayer(2); /* base offset */ } else #endif @@ -3616,7 +3614,7 @@ template void PhongGLTest::renderInstanced() { Vector2{0.5f} )); #ifndef MAGNUM_TARGET_GLES2 - if((data.flags & PhongGL::Flag::TextureArrays) && flag != PhongGL::Flag::UniformBuffers) + if(data.flags & PhongGL::Flag::TextureArrays) shader.setTextureLayer(2); /* base offset */ #endif