Shader/GlslWriter: Move function forward declaration before functions using them

Because of some weird ass shit bug in nvidia driver if functions were forward declared before declaration of UBO they were using
This commit is contained in:
Jérôme Leclercq
2021-05-26 22:21:57 +02:00
parent 948f0517ea
commit 58fe411750
2 changed files with 67 additions and 50 deletions

View File

@@ -63,7 +63,7 @@ namespace Nz
void AppendCommentSection(const std::string& section);
void AppendFunctionDeclaration(const ShaderAst::DeclareFunctionStatement& node, bool forward = false);
void AppendField(std::size_t structIndex, const std::size_t* memberIndices, std::size_t remainingMembers);
void AppendHeader(const std::vector<ShaderAst::DeclareFunctionStatement*>& forwardFunctionDeclarations);
void AppendHeader();
void AppendLine(const std::string& txt = {});
template<typename... Args> void AppendLine(Args&&... params);
void AppendStatementList(std::vector<ShaderAst::StatementPtr>& statements);
@@ -74,7 +74,6 @@ namespace Nz
void HandleEntryPoint(ShaderAst::DeclareFunctionStatement& node);
void HandleInOut();
void RegisterFunction(std::size_t funcIndex, std::string funcName);
void RegisterStruct(std::size_t structIndex, ShaderAst::StructDescription desc);
void RegisterVariable(std::size_t varIndex, std::string varName);