18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-02 10:46:45 +01:00

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
This commit is contained in:
Claude
2026-11-09 20:36:11 +01:00
parent ed64187604
commit ddc529e335
+2 -1
View File
@@ -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;