mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-27 21:45:16 +01:00
* fix(ci): build and run the shader validator again - gl/glsl_common.h and gl/shader.cpp include utilities/Globals.h and utilities/Logs.h now, so the stand-in headers of the validator move to ci_shadervalidator/utilities/. - gl/ubo.h needs std::span and gl/shader.cpp uses contains(), so the script builds with -std=c++20. The stand-in stdafx.h gives <array>, <algorithm> and <string_view>, which the precompiled header of the simulator gives otherwise. - build.sh runs from any directory and stops on the first error. - glslang defines the GL_ARB_gpu_shader5 macro without the #extension directive, so light_common.glsl took its textureGather() path without the extension enabled and 25 material shaders failed on desktop GL with the shadows on. The validator adds the directive which the simulator gives on the drivers with the extension. - The shader goes to the temporary directory of the system instead of a fixed /tmp, a shader which can't be preprocessed fails instead of ending the run, the shaders go in name order and the failed ones are listed at the end. * fix(ci): write the validated shader to a unique temporary file The shader validator wrote every preprocessed shader to a file with a fixed name in the temporary directory (/tmp/shader on Linux) and opened it with std::ofstream. In a shared /tmp anyone can create that name in advance, as a file or a link to another file, and the validator would then write through it (Sonar rule S5443, publicly writable directories). The shader now goes to a file with a unique name which is created exclusively: mkstemp() on Linux, and on Windows, which has no mkstemp(), a random name opened with fopen_s(..., "wx"), which fails when the file exists. The file is removed after glslangValidator has checked it, and when it cannot be written completely. glslangValidator gets the stage with -S, so the file still needs no extension. * docs(ci): the standalone validator no longer checks the PCF fallback path The comment of has_gl_extension() said the validator compiles the 16-tap PCF fallback of light_common.glsl. Since the validator adds the GL_ARB_gpu_shader5 directive itself, it checks the textureGather() path.