From 315e31476ad06c6584553f90417a8dc901264522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 24 Mar 2021 18:10:17 +0100 Subject: [PATCH] GL: fix out of bounds accesses in Shader limit queries. Sigh, it really took quite a while (half a decade??) to discover and fix this. --- doc/changelog.dox | 3 +++ src/Magnum/GL/Implementation/ShaderState.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index 5fa71864d..e90a5b477 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -337,6 +337,9 @@ See also: accident and it was also not really moving everything properly, especially when delayed creation was done on the moved-to object - @ref GL::Renderer::MemoryBarrier::ShaderStorage had an incorrect value +- @ref GL::Shader limit queries for a particular shader stage on desktop were + out-of-bounds array accesses, causing wrong or random values being returned + for most shader-related limits - Fixed assertions related to OpenGL driver workarounds when the proprietary AMDGPU PRO drivers are used on Linux - @ref Platform::EmscriptenApplication randomly created antialiased contexts diff --git a/src/Magnum/GL/Implementation/ShaderState.h b/src/Magnum/GL/Implementation/ShaderState.h index 1cd83ef77..867d6bc2b 100644 --- a/src/Magnum/GL/Implementation/ShaderState.h +++ b/src/Magnum/GL/Implementation/ShaderState.h @@ -45,7 +45,7 @@ struct ShaderState { enum: std::size_t { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - StageCount = 4 + StageCount = 6 #else StageCount = 2 #endif