Graphics: Update material shaders

This commit is contained in:
SirLynix
2023-11-16 09:00:21 +01:00
parent 3b61face6f
commit b7aca4b22a
6 changed files with 267 additions and 279 deletions

View File

@@ -170,9 +170,11 @@ namespace Nz
m_states = states;
m_states.sanitized = true; //< Shader is always sanitized (because of keywords)
#ifdef NAZARA_PLATFORM_WEB
m_states.optimize = true; //< Always remove unused code with emscripten (prevents errors on draw calls when no buffer is bound on a unused binding)
#endif
/*
Always remove dead code with OpenGL (prevents errors on draw calls when no buffer is bound on a unused binding),
also prevents compilation failure because of functions using discard in a vertex shader
*/
m_states.optimize = true;
nzsl::Ast::SanitizeVisitor::Options options = nzsl::GlslWriter::GetSanitizeOptions();
options.optionValues = states.optionValues;