Skip to content

Releases: pema99/UnityShaderParser

0.10.0

29 Apr 00:09

Choose a tag to compare

  • Removed trailing trivia concept from Token, leaving only leading trivia, as suggested in #13. This is a breaking change for users of 0.9.0.
  • Fixed a bug where tokens in embedded HLSL blocks in ShaderLab shaders would have incorrect Position when using PreProcessorMode.DoNothing.

0.9.0

26 Apr 05:53

Choose a tag to compare

  • Preserve comments in the syntax tree by adding a "trivia" concept inspired by Roslyn. Comments will be attached to nearby tokens, and accessibly via Token.LeadingTrivia and Token.TrailingTrivia.
  • Added some helpers to HLSLSyntaxFacts for querying info about texture types.
  • Fix bug in parsing of samplerCUBE declarations.

0.8.0

21 Feb 17:04

Choose a tag to compare

  • Added a flag that can be used to prevent automatically attempting to include 'UnityCG.cginc' before CGPROGRAM blocks. This flag is called ShaderLabParserConfig.IncludeProgramBlockPreamble
  • Made the preprocessor more configurable, by converting PreProcessorMode to a bitflag. You can use this to enable and disable various parts of the preprocessor logic. This is a minor breaking change.

0.7.0

11 Feb 18:55

Choose a tag to compare

  • Changed the arguments to AttributeNode to be of type ExpressionNode rather than LiteralExpressionNode. This allows the parser to handle attributes like [numthreads(1+1, 2, 3)]. This is a minor breaking change.
  • Added [DebuggerStepThrough] to most methods in HLSLSyntaxVisitor and ShaderLabSyntaxVisitor. This should make stepping through visitor implementations with a debugger less painful.
  • Fixed a bug where compound declarations like int a = 3, b = 4; were parsed incorrectly. (#11)
  • Fixed a bug where scientific float literals were being incorrect parsed as integers.
  • Added support for char variable declarations.
  • Fixed a null reference exception when passing no tokens to the constructor for HLSLSyntaxNode.

0.6.2

19 Dec 18:17

Choose a tag to compare

Bugfix: ParseStatements wasn't working due to an inverted loop condition.

0.6.1

01 May 20:41

Choose a tag to compare

Full Changelog: 0.6.0...0.6.1

0.6.0

01 May 01:04

Choose a tag to compare

This release contains breaking changes

Full changeset: 0.5.4...0.6.0

Changes:

  • Feature: Added ShaderLabPrinter, which can be used to pretty-print ShaderLab syntax trees. There is also a new helper function ShaderLabSyntaxNode.GetPrettyPrintedCode that invokes it.
  • Feature: Added support for the stringizing (#) operator in the embedded HLSL preprocessor.
  • Breaking: Allowed for disambiguating CG, HLSL and GLSL program blocks. TokenKind.ProgramBlock and TokenKind.IncludeBlock have been removed in favor of specialized variants like TokenKind.HlslProgramBlock. HLSLProgramBlock and HLSLIncludeBlock have a new field Kind which describes which kind of code the block represents.
  • Breaking: Marked ShaderPassNode, ShaderLabCommandNode and ShaderLabBasicToggleCommandNode as abstract, and remove their associated methods from ShaderLabSyntaxVisitor. These AST nodes don't provide additional info, and having them as concrete classes was confusing.
  • Add some more helper functions to ShaderLabSyntaxFacts.
  • Fixed a bug where ShaderLabParser would occasionally get stuck in an infinite loop.
  • Added newlines between function attributes when using HLSLPrinter.
  • Added a type-erased version of PrintingUtil.GetEnumName, called PrintingUtil.GetEnumNameTypeErased.

0.5.4

28 Apr 20:35

Choose a tag to compare

  • Fix bug where character and string literals aren't printed correctly #6
  • Fix expansion of recursively defined/delayed function-like macros #7

Thanks @pashanhenlei

0.5.3

05 Apr 18:07
95b6d19

Choose a tag to compare

Fix a bug where mul-assign (*=) was parsed as a single asterisk (*). Thanks to @pashanhenlei for spotting.

0.5.2

06 Dec 18:23
6292699

Choose a tag to compare

Fix bug where floating point literals using scientific notation with positive exponent were not parsed correctly.

Full Changelog: 0.5.1...0.5.2