From f03fd553996c0e5926986a5e8c5d2329706c28e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 23 Jan 2022 21:56:33 +0100 Subject: [PATCH] Shaders: set texture transform in Flat instanced tests when appropriate. Not when any texture is set, only when texture transformation is enabled. Because otherwise it won't work when other textures get added/tested. --- src/Magnum/Shaders/Test/FlatGLTest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Shaders/Test/FlatGLTest.cpp b/src/Magnum/Shaders/Test/FlatGLTest.cpp index c5b3438dc..cbabf71ba 100644 --- a/src/Magnum/Shaders/Test/FlatGLTest.cpp +++ b/src/Magnum/Shaders/Test/FlatGLTest.cpp @@ -2636,7 +2636,7 @@ template void FlatGLTest::renderInstanced2D() { Matrix3::projection({2.1f, 2.1f})* Matrix3::scaling(Vector2{0.4f})); - if(data.flags & FlatGL3D::Flag::Textured) + if(data.flags & FlatGL3D::Flag::TextureTransformation) shader.setTextureMatrix(Matrix3::scaling( #ifndef MAGNUM_TARGET_GLES2 /* Slices of the texture array have half the height */ @@ -2688,7 +2688,7 @@ template void FlatGLTest::renderInstanced2D() { FlatMaterialUniform{} .setColor(data.flags & FlatGL2D::Flag::Textured ? 0xffffff_rgbf : 0xffff00_rgbf) }}; - if(data.flags & FlatGL3D::Flag::Textured) + if(data.flags & FlatGL3D::Flag::TextureTransformation) shader.bindTextureTransformationBuffer(textureTransformationUniform); shader.bindTransformationProjectionBuffer(transformationProjectionUniform) .bindDrawBuffer(drawUniform) @@ -2904,7 +2904,7 @@ template void FlatGLTest::renderInstanced3D() { Matrix4::translation(Vector3::zAxis(-2.15f))* Matrix4::scaling(Vector3{0.4f})); - if(data.flags & FlatGL3D::Flag::Textured) + if(data.flags & FlatGL3D::Flag::TextureTransformation) shader.setTextureMatrix(Matrix3::scaling( #ifndef MAGNUM_TARGET_GLES2 /* Slices of the texture array have half the height */ @@ -2957,7 +2957,7 @@ template void FlatGLTest::renderInstanced3D() { FlatMaterialUniform{} .setColor(data.flags & FlatGL3D::Flag::Textured ? 0xffffff_rgbf : 0xffff00_rgbf) }}; - if(data.flags & FlatGL3D::Flag::Textured) + if(data.flags & FlatGL3D::Flag::TextureTransformation) shader.bindTextureTransformationBuffer(textureTransformationUniform); shader.bindTransformationProjectionBuffer(transformationProjectionUniform) .bindDrawBuffer(drawUniform)