Refactored shader system to support both graphics and compute shaders. - Updated ANTLR grammars and parser logic for explicit shader model and compute shader entry points. - Split shader models and descriptors for graphics and compute. - Refactored pipeline key generation and D3D12 pipeline library for compute support. - Updated push constant layouts and HLSL includes for both shader types. - Improved error handling and test coverage with new example files. BREAKING CHANGE: Shader model, descriptor, and pipeline APIs have changed. Existing shader and pipeline code must be updated to use the new types and conventions.
39 lines
668 B
ANTLR
39 lines
668 B
ANTLR
lexer grammar GhostShaderLexer;
|
|
|
|
// Keywords
|
|
SHADER: 'shader';
|
|
COMPUTE: 'compute';
|
|
PIPELINE: 'pipeline';
|
|
PASS: 'pass';
|
|
DEFINES: 'defines';
|
|
KEYWORDS: 'keywords';
|
|
INCLUDES: 'includes';
|
|
GLOBAL: 'global';
|
|
LOCAL: 'local';
|
|
HLSL: 'hlsl';
|
|
SM: 'sm';
|
|
|
|
// Punctuation
|
|
LBRACE: '{';
|
|
RBRACE: '}';
|
|
LPAREN: '(';
|
|
RPAREN: ')';
|
|
LBRACK: '[';
|
|
RBRACK: ']';
|
|
SEMICOLON: ';';
|
|
COMMA: ',';
|
|
EQUALS: '=';
|
|
COLON: ':';
|
|
|
|
// Literals
|
|
STRING_LITERAL: '"' (~["\r\n] | '\\' .)* '"';
|
|
NUMBER: [0-9]+ ('.' [0-9]+)? | '.' [0-9]+;
|
|
IDENTIFIER: [a-zA-Z_][a-zA-Z0-9_]*;
|
|
|
|
// Whitespace and Comments
|
|
WS: [ \t\r\n]+ -> skip;
|
|
LINE_COMMENT: '//' ~[\r\n]* -> skip;
|
|
BLOCK_COMMENT: '/*' .*? '*/' -> skip;
|
|
|
|
|
|
ANY_CHAR: . ; |