From 2c578cb4dfd956b666b904b9a085e6fd019e46e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 24 May 2021 23:11:05 +0200 Subject: [PATCH] Shaders: ah so this wasn't a Mesa bug, it was my stupidity. I just put this aside when I discovered the error, thinking it was a Mesa bug. Now that ARM Mali yelled about the same, I realized it wasn't just Mesa. Note to self: Mesa has no bugs. Can you just finally accept that?! --- doc/changelog.dox | 3 +++ src/Magnum/Shaders/MeshVisualizerGL.cpp | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index 549229cff..99db5d87e 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -403,6 +403,9 @@ See also: - For meshes with multiple sets of vertex attributes (such as texture coordinates), @ref MeshTools::compile() should be using only the first set but it wasn't. +- @ref Shaders::MeshVisualizerGL3D "Shaders::MeshVisualizerGL*D" shader + compilation failed with missing @glsl gl_PrimitiveID @ce due to GLSL 3.20 + not being properly used for the @glsl #version @ce directive - @ref Shaders::PhongGL was normalizing light direction in vertex shader, causing the fragment-interpolated direction being incorrect with visible artifacts on long polygons under low light angle diff --git a/src/Magnum/Shaders/MeshVisualizerGL.cpp b/src/Magnum/Shaders/MeshVisualizerGL.cpp index 6d920a597..6bd1b7200 100644 --- a/src/Magnum/Shaders/MeshVisualizerGL.cpp +++ b/src/Magnum/Shaders/MeshVisualizerGL.cpp @@ -137,7 +137,8 @@ GL::Version MeshVisualizerGLBase::setupShaders(GL::Shader& vert, GL::Shader& fra /* Extended in MeshVisualizerGL3D for TBN visualization */ CORRADE_INTERNAL_ASSERT(!(_flags & FlagBase::Wireframe) || _flags & FlagBase::NoGeometryShader || version >= GL::Version::GL320); #elif !defined(MAGNUM_TARGET_WEBGL) - const GL::Version version = context.supportedVersion({GL::Version::GLES310, GL::Version::GLES300, GL::Version::GLES200}); + /* ES 3.2 needed for gl_PrimitiveID */ + const GL::Version version = context.supportedVersion({GL::Version::GLES320, GL::Version::GLES310, GL::Version::GLES300, GL::Version::GLES200}); /* Extended in MeshVisualizerGL3D for TBN visualization */ CORRADE_INTERNAL_ASSERT(!(_flags & FlagBase::Wireframe) || _flags & FlagBase::NoGeometryShader || version >= GL::Version::GLES310); #else