Shader: Fix some errors

This commit is contained in:
SirLynix
2022-03-29 08:42:08 +02:00
committed by Jérôme Leclercq
parent 1afc599e3d
commit 35f6240786
5 changed files with 62 additions and 55 deletions

View File

@@ -85,6 +85,10 @@ namespace Nz::ShaderLang
std::string ParseModuleName();
ShaderAst::ExpressionPtr ParseType();
template<typename T> void HandleUniqueAttribute(ShaderAst::ExpressionValue<T>& targetAttribute, Attribute&& attribute);
template<typename T> void HandleUniqueAttribute(ShaderAst::ExpressionValue<T>& targetAttribute, Attribute&& attribute, T defaultValue);
template<typename T> void HandleUniqueStringAttribute(ShaderAst::ExpressionValue<T>& targetAttribute, Attribute&& attribute, const std::unordered_map<std::string, T>& map, std::optional<T> defaultValue = {});
static int GetTokenPrecedence(TokenType token);
struct Context

View File

@@ -58,7 +58,7 @@ namespace Nz::ShaderLang
assert(rightLocation.endLine >= startLine);
endLine = rightLocation.endLine;
assert(rightLocation.endLine > startLine || rightLocation.endColumn >= startColumn);
endColumn = endColumn;
endColumn = rightLocation.endColumn;
}
inline SourceLocation SourceLocation::BuildFromTo(const SourceLocation& leftSource, const SourceLocation& rightSource)