Add FLAXENGINE_VERSION_MAJOR/FLAXENGINE_VERSION_MINOR macros to shaders compilation

This commit is contained in:
2026-06-25 08:56:21 +02:00
parent 2f3ce50cef
commit 16c4304ab4
2 changed files with 6 additions and 0 deletions
@@ -253,6 +253,11 @@ bool ShaderCompiler::OnCompileBegin()
_globalMacros.Add({ "REVERSE_Z", "1"});
#endif
// Setup version macros
_macroVersionMinor = StringAnsi::Format("{}", FLAXENGINE_VERSION_MINOR);
_globalMacros.Add({ "FLAXENGINE_VERSION_MAJOR", Numbers[FLAXENGINE_VERSION_MAJOR] });
_globalMacros.Add({ "FLAXENGINE_VERSION_MINOR", _macroVersionMinor.Get() });
return false;
}
@@ -26,6 +26,7 @@ private:
ShaderProfile _profile;
PlatformType _platform;
Array<char> _funcNameDefineBuffer;
StringAnsi _macroVersionMinor;
protected:
ShaderCompilationContext* _context = nullptr;