Releases: pema99/UnityShaderParser
Releases · pema99/UnityShaderParser
0.8.0
- 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
PreProcessorModeto 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
- Changed the arguments to
AttributeNodeto be of typeExpressionNoderather thanLiteralExpressionNode. 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
HLSLSyntaxVisitorandShaderLabSyntaxVisitor. 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
charvariable declarations. - Fixed a null reference exception when passing no tokens to the constructor for
HLSLSyntaxNode.
0.6.2
0.6.1
Full Changelog: 0.6.0...0.6.1
- Added support for
PackageRequirementsblocks in ShaderLab code (https://docs.unity3d.com/Manual/SL-PackageRequirements.html) - Fixed a small bug in the printing of ColorMask in ShaderLabPrinter.
- Add newlines after program blocks in ShaderLabPrinter.
0.6.0
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 functionShaderLabSyntaxNode.GetPrettyPrintedCodethat 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.ProgramBlockandTokenKind.IncludeBlockhave been removed in favor of specialized variants likeTokenKind.HlslProgramBlock.HLSLProgramBlockandHLSLIncludeBlockhave a new fieldKindwhich describes which kind of code the block represents. - Breaking: Marked
ShaderPassNode,ShaderLabCommandNodeandShaderLabBasicToggleCommandNodeasabstract, and remove their associated methods fromShaderLabSyntaxVisitor. 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, calledPrintingUtil.GetEnumNameTypeErased.
0.5.4
0.5.3
Fix a bug where mul-assign (*=) was parsed as a single asterisk (*). Thanks to @pashanhenlei for spotting.
0.5.2
Fix bug where floating point literals using scientific notation with positive exponent were not parsed correctly.
Full Changelog: 0.5.1...0.5.2
0.5.1
0.5.0
This is a (slight) breaking change
- Made most of the members in HLSLPrinter protected instead of private, allowing for customization of pretty printing.
- Introduced a new
IdentifierNodetype and use it in place of raw strings wherever the syntax tree stores identifiers.IdentifierNodecan be implicitly converted to string, so most code should keep working, but this is technically a breaking change. If this breaks your code, the fix is usually simple, like changingdecl.Nametodecl.Name.Identifierordecl.Name.ToString().
Full Changelog: 0.4.1...0.5.0