From ddc529e335d1559ae9d1598d4d2024ae1fc280c2 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 9 Nov 2026 20:36:11 +0100 Subject: [PATCH] OpenGL 4.6: the settings from the values the game gives, also where the driver defines GL_SPIRV Some drivers (AMD's) define GL_SPIRV also when they compile the GLSL source, so settings.glsl took the specialization constants, which a source can't have, and no shader compiled ("constant_id: only allowed when generating SPIR-V"). The game always puts the values of the settings before a source it compiles, so those decide. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD --- shaders/ogl46/settings.glsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shaders/ogl46/settings.glsl b/shaders/ogl46/settings.glsl index 65c441991..cda2ecf39 100644 --- a/shaders/ogl46/settings.glsl +++ b/shaders/ogl46/settings.glsl @@ -4,7 +4,8 @@ #ifndef SETTINGS_GLSL #define SETTINGS_GLSL -#ifdef GL_SPIRV +// (some drivers, AMD's among them, define GL_SPIRV also when they compile the source: the game always puts the values before it) +#if defined(GL_SPIRV) && !defined(SHADOWMAP_ENABLED_VALUE) layout(constant_id = 0) const bool SHADOWMAP_ENABLED = true; layout(constant_id = 1) const bool ENVMAP_ENABLED = true; layout(constant_id = 2) const bool MOTIONBLUR_ENABLED = true;