@galacean/engine-shader-compiler 2.0.0-alpha.52 → 2.0.0-alpha.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -4
- package/bundler/cli.js +199 -104
- package/bundler/precompile.cjs.js +117 -47
- package/bundler/precompile.js +117 -47
- package/bundler/rollup.cjs.js +115 -45
- package/bundler/rollup.js +115 -45
- package/dist/browser.js +13421 -6555
- package/dist/browser.js.map +1 -1
- package/dist/browser.min.js +1 -1
- package/dist/browser.min.js.map +1 -1
- package/dist/main.js +1758 -8450
- package/dist/main.js.map +1 -1
- package/dist/module.js +1730 -8427
- package/dist/module.js.map +1 -1
- package/dist/precompile.main.js +2280 -0
- package/dist/precompile.main.js.map +1 -0
- package/dist/precompile.module.js +2276 -0
- package/dist/precompile.module.js.map +1 -0
- package/package.json +24 -13
- package/types/GLESBackend.d.ts +22 -0
- package/types/ShaderBackend.d.ts +15 -0
- package/types/ShaderCompilation.d.ts +40 -0
- package/types/ShaderCompiler.d.ts +42 -14
- package/types/ShaderInstructionEncoder.d.ts +46 -14
- package/types/ShaderPrecompiler.d.ts +31 -0
- package/types/bundler/precompile.d.ts +26 -3
- package/types/bundler/rollup.d.ts +23 -2
- package/types/codeGen/CodeGenVisitor.d.ts +11 -6
- package/types/codeGen/GLES100.d.ts +3 -5
- package/types/codeGen/GLES300.d.ts +14 -7
- package/types/codeGen/GLESVisitor.d.ts +55 -9
- package/types/codeGen/VisitorContext.d.ts +88 -29
- package/types/codeGen/types.d.ts +1 -1
- package/types/index.d.ts +4 -1
- package/types/precompile.d.ts +1 -0
- package/dist/browser.verbose.js +0 -9601
- package/dist/browser.verbose.js.map +0 -1
- package/dist/browser.verbose.min.js +0 -2
- package/dist/browser.verbose.min.js.map +0 -1
- package/dist/main.verbose.js +0 -9598
- package/dist/main.verbose.js.map +0 -1
- package/dist/module.verbose.js +0 -9591
- package/dist/module.verbose.js.map +0 -1
- package/types/GSError.d.ts +0 -16
- package/types/ParserUtils.d.ts +0 -43
- package/types/Preprocessor.d.ts +0 -30
- package/types/ShaderCompilerUtils.d.ts +0 -10
- package/types/common/BaseLexer.d.ts +0 -51
- package/types/common/BaseToken.d.ts +0 -35
- package/types/common/IBaseSymbol.d.ts +0 -5
- package/types/common/ShaderPosition.d.ts +0 -8
- package/types/common/ShaderRange.d.ts +0 -8
- package/types/common/SymbolTable.d.ts +0 -13
- package/types/common/SymbolTableStack.d.ts +0 -17
- package/types/common/enums/Keyword.d.ts +0 -124
- package/types/common/enums/ShaderStage.d.ts +0 -5
- package/types/common/index.d.ts +0 -5
- package/types/common/types.d.ts +0 -101
- package/types/lalr/CFG.d.ts +0 -5
- package/types/lalr/LALR1.d.ts +0 -27
- package/types/lalr/Production.d.ts +0 -9
- package/types/lalr/State.d.ts +0 -20
- package/types/lalr/StateItem.d.ts +0 -20
- package/types/lalr/Utils.d.ts +0 -22
- package/types/lalr/index.d.ts +0 -2
- package/types/lalr/types.d.ts +0 -14
- package/types/lexer/Lexer.d.ts +0 -143
- package/types/lexer/index.d.ts +0 -1
- package/types/parser/AST.d.ts +0 -502
- package/types/parser/Grammar.d.ts +0 -11
- package/types/parser/GrammarSymbol.d.ts +0 -128
- package/types/parser/SemanticAnalyzer.d.ts +0 -42
- package/types/parser/ShaderInfo.d.ts +0 -10
- package/types/parser/ShaderTargetParser.d.ts +0 -26
- package/types/parser/builtin/functions.d.ts +0 -34
- package/types/parser/builtin/index.d.ts +0 -2
- package/types/parser/builtin/variables.d.ts +0 -11
- package/types/parser/index.d.ts +0 -2
- package/types/parser/symbolTable/FnSymbol.d.ts +0 -6
- package/types/parser/symbolTable/StructSymbol.d.ts +0 -6
- package/types/parser/symbolTable/SymbolDataType.d.ts +0 -8
- package/types/parser/symbolTable/SymbolInfo.d.ts +0 -22
- package/types/parser/symbolTable/VarSymbol.d.ts +0 -8
- package/types/parser/symbolTable/index.d.ts +0 -6
- package/types/parser/types.d.ts +0 -24
- package/types/sourceParser/ShaderSourceFactory.d.ts +0 -8
- package/types/sourceParser/ShaderSourceParser.d.ts +0 -30
- package/types/sourceParser/ShaderSourceSymbol.d.ts +0 -10
- package/types/sourceParser/SourceLexer.d.ts +0 -19
- package/types/sourceParser/index.d.ts +0 -1
- package/verbose/package.json +0 -10
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { TokenType } from "../common";
|
|
2
|
-
export type Terminal = TokenType;
|
|
3
|
-
export declare enum NoneTerminal {
|
|
4
|
-
START = 2000,
|
|
5
|
-
gs_shader_program = 2001,
|
|
6
|
-
global_declaration = 2002,
|
|
7
|
-
variable_declaration = 2003,
|
|
8
|
-
variable_declaration_list = 2004,
|
|
9
|
-
variable_declaration_statement = 2005,
|
|
10
|
-
array_specifier_list = 2006,
|
|
11
|
-
array_specifier = 2007,
|
|
12
|
-
ext_builtin_type_specifier_nonarray = 2008,
|
|
13
|
-
precision_specifier = 2009,
|
|
14
|
-
variable_identifier = 2010,
|
|
15
|
-
variable_identifier_node = 2011,
|
|
16
|
-
primary_expression = 2012,
|
|
17
|
-
postfix_expression = 2013,
|
|
18
|
-
integer_expression = 2014,
|
|
19
|
-
function_call = 2015,
|
|
20
|
-
function_call_generic = 2016,
|
|
21
|
-
function_call_header_no_parameters = 2017,
|
|
22
|
-
function_call_header_with_parameters = 2018,
|
|
23
|
-
function_call_parameter_list = 2019,
|
|
24
|
-
function_call_header = 2020,
|
|
25
|
-
function_identifier = 2021,
|
|
26
|
-
constructor_identifier = 2022,
|
|
27
|
-
unary_expression = 2023,
|
|
28
|
-
unary_operator = 2024,
|
|
29
|
-
multiplicative_expression = 2025,
|
|
30
|
-
additive_expression = 2026,
|
|
31
|
-
shift_expression = 2027,
|
|
32
|
-
relational_expression = 2028,
|
|
33
|
-
equality_expression = 2029,
|
|
34
|
-
and_expression = 2030,
|
|
35
|
-
inclusive_or_expression = 2031,
|
|
36
|
-
exclusive_or_expression = 2032,
|
|
37
|
-
logical_and_expression = 2033,
|
|
38
|
-
logical_xor_expression = 2034,
|
|
39
|
-
logical_or_expression = 2035,
|
|
40
|
-
conditional_expression = 2036,
|
|
41
|
-
assignment_expression = 2037,
|
|
42
|
-
assignment_operator = 2038,
|
|
43
|
-
expression = 2039,
|
|
44
|
-
integer_constant_expression = 2040,
|
|
45
|
-
integer_constant_expression_operator = 2041,
|
|
46
|
-
declaration = 2042,
|
|
47
|
-
function_prototype = 2043,
|
|
48
|
-
function_declarator = 2044,
|
|
49
|
-
function_header_with_parameters = 2045,
|
|
50
|
-
function_header = 2046,
|
|
51
|
-
function_parameter_list = 2047,
|
|
52
|
-
parameter_declarator = 2048,
|
|
53
|
-
parameter_declaration = 2049,
|
|
54
|
-
parameter_qualifier = 2050,
|
|
55
|
-
parameter_type_specifier = 2051,
|
|
56
|
-
init_declarator_list = 2052,
|
|
57
|
-
single_declaration = 2053,
|
|
58
|
-
fully_specified_type = 2054,
|
|
59
|
-
type_qualifier = 2055,
|
|
60
|
-
single_type_qualifier = 2056,
|
|
61
|
-
storage_qualifier = 2057,
|
|
62
|
-
precision_qualifier = 2058,
|
|
63
|
-
interpolation_qualifier = 2059,
|
|
64
|
-
invariant_qualifier = 2060,
|
|
65
|
-
type_specifier = 2061,
|
|
66
|
-
type_specifier_nonarray = 2062,
|
|
67
|
-
type_specifier_no_prec = 2063,
|
|
68
|
-
basic_type = 2064,
|
|
69
|
-
struct_specifier = 2065,
|
|
70
|
-
struct_declaration_list = 2066,
|
|
71
|
-
struct_declaration = 2067,
|
|
72
|
-
layout_qualifier = 2068,
|
|
73
|
-
struct_declarator_list = 2069,
|
|
74
|
-
struct_declarator = 2070,
|
|
75
|
-
identifier_list = 2071,
|
|
76
|
-
decl_identifier = 2072,
|
|
77
|
-
initializer = 2073,
|
|
78
|
-
initializer_list = 2074,
|
|
79
|
-
declaration_statement = 2075,
|
|
80
|
-
simple_statement = 2076,
|
|
81
|
-
compound_statement_no_scope = 2077,
|
|
82
|
-
statement_with_scope = 2078,
|
|
83
|
-
compound_statement = 2079,
|
|
84
|
-
statement = 2080,
|
|
85
|
-
statement_list = 2081,
|
|
86
|
-
iteration_statement_no_new_scope = 2082,
|
|
87
|
-
expression_statement = 2083,
|
|
88
|
-
selection_statement = 2084,
|
|
89
|
-
selection_rest_statement = 2085,
|
|
90
|
-
condition = 2086,
|
|
91
|
-
conditionopt = 2087,
|
|
92
|
-
iteration_statement = 2088,
|
|
93
|
-
for_init_statement = 2089,
|
|
94
|
-
for_rest_statement = 2090,
|
|
95
|
-
jump_statement = 2091,
|
|
96
|
-
external_declaration = 2092,
|
|
97
|
-
function_definition = 2093,
|
|
98
|
-
field_selection = 2094,
|
|
99
|
-
bool_constant = 2095,
|
|
100
|
-
function_identifier_node = 2096,
|
|
101
|
-
typename_identifier_node = 2097,
|
|
102
|
-
scope_brace = 2098,
|
|
103
|
-
scope_end_brace = 2099,
|
|
104
|
-
macro_undef = 2100,
|
|
105
|
-
macro_push_context = 2101,
|
|
106
|
-
macro_pop_context = 2102,
|
|
107
|
-
macro_elif_expression = 2103,
|
|
108
|
-
macro_else_expression = 2104,
|
|
109
|
-
global_macro_if_statement = 2105,
|
|
110
|
-
global_macro_declaration = 2106,
|
|
111
|
-
global_macro_branch = 2107,
|
|
112
|
-
macro_struct_declaration = 2108,
|
|
113
|
-
macro_struct_branch = 2109,
|
|
114
|
-
macro_if_statement = 2110,
|
|
115
|
-
macro_branch = 2111,
|
|
116
|
-
macro_param_case_list = 2112,
|
|
117
|
-
macro_param_block = 2113,
|
|
118
|
-
macro_parameter_branch = 2114,
|
|
119
|
-
macro_call_arg_case_list = 2115,
|
|
120
|
-
macro_call_arg_block = 2116,
|
|
121
|
-
macro_call_arg_branch = 2117,
|
|
122
|
-
macro_call_symbol = 2118,
|
|
123
|
-
macro_call_function = 2119,
|
|
124
|
-
macro_define = 2120,
|
|
125
|
-
_ignore = 2121
|
|
126
|
-
}
|
|
127
|
-
export type GrammarSymbol = Terminal | NoneTerminal;
|
|
128
|
-
export type Derivation = GrammarSymbol[];
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ShaderRange } from "../common";
|
|
2
|
-
import { SymbolTable } from "../common/SymbolTable";
|
|
3
|
-
import { SymbolTableStack } from "../common/SymbolTableStack";
|
|
4
|
-
import { SymbolInfo } from "../parser/symbolTable";
|
|
5
|
-
import { ASTNode, TreeNode } from "./AST";
|
|
6
|
-
import { ShaderData } from "./ShaderInfo";
|
|
7
|
-
import { NodeChild } from "./types";
|
|
8
|
-
import { MacroDefineList } from "../Preprocessor";
|
|
9
|
-
export type TranslationRule<T = any> = (sa: SemanticAnalyzer, ...tokens: NodeChild[]) => T;
|
|
10
|
-
/**
|
|
11
|
-
* @internal
|
|
12
|
-
* The semantic analyzer of `ShaderCompiler` compiler.
|
|
13
|
-
* - Build symbol table
|
|
14
|
-
* - Static analysis
|
|
15
|
-
*/
|
|
16
|
-
export default class SemanticAnalyzer {
|
|
17
|
-
/**
|
|
18
|
-
* @internal
|
|
19
|
-
*/
|
|
20
|
-
static _lookupSymbol: SymbolInfo;
|
|
21
|
-
semanticStack: TreeNode[];
|
|
22
|
-
acceptRule?: TranslationRule | undefined;
|
|
23
|
-
symbolTableStack: SymbolTableStack<SymbolInfo, SymbolTable<SymbolInfo>>;
|
|
24
|
-
curFunctionInfo: {
|
|
25
|
-
header?: ASTNode.FunctionDeclarator;
|
|
26
|
-
returnStatement?: ASTNode.JumpStatement | null;
|
|
27
|
-
};
|
|
28
|
-
private _shaderData;
|
|
29
|
-
private _translationRuleTable;
|
|
30
|
-
private _macroDefineList;
|
|
31
|
-
readonly errors: Error[];
|
|
32
|
-
get shaderData(): ShaderData;
|
|
33
|
-
get macroDefineList(): MacroDefineList;
|
|
34
|
-
constructor();
|
|
35
|
-
reset(macroDefineList: MacroDefineList): void;
|
|
36
|
-
pushScope(): void;
|
|
37
|
-
popScope(): SymbolTable<SymbolInfo> | undefined;
|
|
38
|
-
addTranslationRule(pid: number, rule: TranslationRule): void;
|
|
39
|
-
getTranslationRule(pid: number): TranslationRule<any> | undefined;
|
|
40
|
-
reportError(loc: ShaderRange, message: string): void;
|
|
41
|
-
reportWarning(loc: ShaderRange, message: string): void;
|
|
42
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SymbolInfo, SymbolTable } from "../parser/symbolTable";
|
|
2
|
-
import { ASTNode } from "./AST";
|
|
3
|
-
export declare class ShaderData {
|
|
4
|
-
symbolTable: SymbolTable<SymbolInfo>;
|
|
5
|
-
vertexMain: ASTNode.FunctionDefinition;
|
|
6
|
-
fragmentMain: ASTNode.FunctionDefinition;
|
|
7
|
-
globalPrecisions: ASTNode.PrecisionSpecifier[];
|
|
8
|
-
globalMacroDeclarations: ASTNode.GlobalDeclaration[];
|
|
9
|
-
getOuterGlobalMacroDeclarations(): ASTNode.GlobalDeclaration[];
|
|
10
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { BaseToken } from "../common/BaseToken";
|
|
2
|
-
import { StateActionTable, StateGotoTable } from "../lalr/types";
|
|
3
|
-
import { MacroDefineList } from "../Preprocessor";
|
|
4
|
-
import { ASTNode } from "./AST";
|
|
5
|
-
import { Grammar } from "./Grammar";
|
|
6
|
-
import SematicAnalyzer from "./SemanticAnalyzer";
|
|
7
|
-
/**
|
|
8
|
-
* The syntax parser and sematic analyzer of `ShaderCompiler` compiler
|
|
9
|
-
*/
|
|
10
|
-
export declare class ShaderTargetParser {
|
|
11
|
-
readonly actionTable: StateActionTable;
|
|
12
|
-
readonly gotoTable: StateGotoTable;
|
|
13
|
-
readonly grammar: Grammar;
|
|
14
|
-
readonly sematicAnalyzer: SematicAnalyzer;
|
|
15
|
-
private _traceBackStack;
|
|
16
|
-
private get curState();
|
|
17
|
-
private get stateActionTable();
|
|
18
|
-
private get stateGotoTable();
|
|
19
|
-
/** @internal */
|
|
20
|
-
get errors(): Error[];
|
|
21
|
-
static _singleton: ShaderTargetParser;
|
|
22
|
-
static create(): ShaderTargetParser;
|
|
23
|
-
private constructor();
|
|
24
|
-
parse(tokens: Generator<BaseToken, BaseToken>, macroDefineList: MacroDefineList): ASTNode.GLShaderProgram | null;
|
|
25
|
-
private _printStack;
|
|
26
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { GalaceanDataType } from "../../common";
|
|
2
|
-
import { EShaderStage } from "../../common/enums/ShaderStage";
|
|
3
|
-
export declare enum GenericType {
|
|
4
|
-
GenType = 200,
|
|
5
|
-
GenIntType = 201,
|
|
6
|
-
GenUintType = 202,
|
|
7
|
-
GenBoolType = 203,
|
|
8
|
-
Mat = 204,
|
|
9
|
-
BoolVec = 205,
|
|
10
|
-
IntVec = 206,
|
|
11
|
-
UintVec = 207,
|
|
12
|
-
Vec = 208,
|
|
13
|
-
GVec4 = 209,
|
|
14
|
-
GSampler2D = 210,
|
|
15
|
-
GSampler3D = 211,
|
|
16
|
-
GSamplerCube = 212,
|
|
17
|
-
GSampler2DArray = 213
|
|
18
|
-
}
|
|
19
|
-
export type NonGenericGalaceanType = Exclude<GalaceanDataType, string>;
|
|
20
|
-
type BuiltinType = NonGenericGalaceanType | GenericType;
|
|
21
|
-
export declare class BuiltinFunction {
|
|
22
|
-
ident: string;
|
|
23
|
-
readonly args: BuiltinType[];
|
|
24
|
-
readonly scope: EShaderStage;
|
|
25
|
-
private _returnType;
|
|
26
|
-
private _realReturnType;
|
|
27
|
-
get realReturnType(): NonGenericGalaceanType;
|
|
28
|
-
private constructor();
|
|
29
|
-
static _create(ident: string, returnType: BuiltinType, ...args: BuiltinType[]): void;
|
|
30
|
-
static _createWithScope(ident: string, returnType: BuiltinType, scope: EShaderStage, ...args: BuiltinType[]): void;
|
|
31
|
-
static resolveOverload(funcName: string, callArgTypes: NonGenericGalaceanType[] | undefined): BuiltinFunction | undefined;
|
|
32
|
-
static isExist(ident: string): boolean;
|
|
33
|
-
}
|
|
34
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { GalaceanDataType } from "../../common";
|
|
2
|
-
import { EShaderStage } from "../../common/enums/ShaderStage";
|
|
3
|
-
export declare const BuiltinVariableTable: Map<string, BuiltinVariable>;
|
|
4
|
-
export declare class BuiltinVariable {
|
|
5
|
-
type: GalaceanDataType;
|
|
6
|
-
lexeme: string;
|
|
7
|
-
scope: EShaderStage;
|
|
8
|
-
private constructor();
|
|
9
|
-
static createVariable(lexeme: string, type: GalaceanDataType, scope?: EShaderStage): void;
|
|
10
|
-
static getVar(ident: string): BuiltinVariable | undefined;
|
|
11
|
-
}
|
package/types/parser/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { GalaceanDataType } from "../../common";
|
|
2
|
-
import { ASTNode } from "../AST";
|
|
3
|
-
export declare class SymbolDataType {
|
|
4
|
-
type: GalaceanDataType;
|
|
5
|
-
typeLexeme: string;
|
|
6
|
-
arraySpecifier?: ASTNode.ArraySpecifier | undefined;
|
|
7
|
-
constructor(type: GalaceanDataType, typeLexeme: string, arraySpecifier?: ASTNode.ArraySpecifier | undefined);
|
|
8
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { IBaseSymbol } from "../../common/IBaseSymbol";
|
|
2
|
-
import { GalaceanDataType } from "../../common/types";
|
|
3
|
-
import { ASTNode } from "../AST";
|
|
4
|
-
import { SymbolDataType } from "./SymbolDataType";
|
|
5
|
-
export declare enum ESymbolType {
|
|
6
|
-
VAR = 0,
|
|
7
|
-
FN = 1,
|
|
8
|
-
STRUCT = 2,
|
|
9
|
-
Any = 3
|
|
10
|
-
}
|
|
11
|
-
export type SymbolAstNode = ASTNode.Initializer | ASTNode.StructSpecifier | ASTNode.FunctionDefinition | ASTNode.ParameterDeclarator | ASTNode.InitDeclaratorList | ASTNode.VariableDeclaration;
|
|
12
|
-
export declare class SymbolInfo implements IBaseSymbol {
|
|
13
|
-
ident: string;
|
|
14
|
-
type: ESymbolType | null;
|
|
15
|
-
astNode?: SymbolAstNode | undefined;
|
|
16
|
-
dataType?: SymbolDataType | undefined;
|
|
17
|
-
paramSignature?: GalaceanDataType[] | undefined;
|
|
18
|
-
isInMacroBranch: boolean;
|
|
19
|
-
constructor(ident: string, type: ESymbolType | null, astNode?: SymbolAstNode | undefined, dataType?: SymbolDataType | undefined, paramSignature?: GalaceanDataType[] | undefined, isInMacroBranch?: boolean);
|
|
20
|
-
set(ident: string, symbolType: ESymbolType, astNode?: SymbolAstNode, dataType?: SymbolDataType, paramSignature?: GalaceanDataType[]): void;
|
|
21
|
-
equal(symbol: SymbolInfo): boolean;
|
|
22
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ASTNode } from "../AST";
|
|
2
|
-
import { SymbolDataType } from "./SymbolDataType";
|
|
3
|
-
import { SymbolInfo } from "./SymbolInfo";
|
|
4
|
-
export declare class VarSymbol extends SymbolInfo {
|
|
5
|
-
astNode: ASTNode.Initializer | ASTNode.ParameterDeclarator | ASTNode.InitDeclaratorList | ASTNode.VariableDeclaration;
|
|
6
|
-
readonly isGlobalVariable: boolean;
|
|
7
|
-
constructor(ident: string, dataType: SymbolDataType, isGlobalVariable: boolean, initAst: ASTNode.Initializer | ASTNode.ParameterDeclarator | ASTNode.InitDeclaratorList | ASTNode.VariableDeclaration);
|
|
8
|
-
}
|
package/types/parser/types.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { GalaceanDataType } from "../common";
|
|
2
|
-
import { BaseToken } from "../common/BaseToken";
|
|
3
|
-
import { ASTNode, TreeNode } from "./AST";
|
|
4
|
-
import { NoneTerminal } from "./GrammarSymbol";
|
|
5
|
-
export type TraceStackItem = NoneTerminal | BaseToken;
|
|
6
|
-
export declare class SymbolType {
|
|
7
|
-
type: GalaceanDataType;
|
|
8
|
-
typeLexeme: string;
|
|
9
|
-
arraySpecifier?: ASTNode.ArraySpecifier | undefined;
|
|
10
|
-
constructor(type: GalaceanDataType, typeLexeme: string, arraySpecifier?: ASTNode.ArraySpecifier | undefined);
|
|
11
|
-
}
|
|
12
|
-
export declare class StructProp implements IParamInfo {
|
|
13
|
-
typeInfo: SymbolType;
|
|
14
|
-
ident: BaseToken;
|
|
15
|
-
mrtIndex?: number | undefined;
|
|
16
|
-
isInMacroBranch: boolean;
|
|
17
|
-
constructor(typeInfo: SymbolType, ident: BaseToken, mrtIndex?: number | undefined, isInMacroBranch?: boolean);
|
|
18
|
-
}
|
|
19
|
-
export type NodeChild = TreeNode | BaseToken;
|
|
20
|
-
export type IParamInfo = {
|
|
21
|
-
ident?: BaseToken;
|
|
22
|
-
typeInfo?: SymbolType;
|
|
23
|
-
astNode?: ASTNode.ParameterDeclaration | ASTNode.MacroParamBlock;
|
|
24
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { IRenderStates, IShaderPassSource, IShaderSource, ISubShaderSource } from "@galacean/engine-design";
|
|
2
|
-
export declare class ShaderSourceFactory {
|
|
3
|
-
static createRenderStates(): IRenderStates;
|
|
4
|
-
static createShaderSource(name: string): IShaderSource;
|
|
5
|
-
static createSubShaderSource(name: string): ISubShaderSource;
|
|
6
|
-
static createShaderPassSource(name: string): IShaderPassSource;
|
|
7
|
-
static createUsePass(name: string): IShaderPassSource;
|
|
8
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { IShaderSource } from "@galacean/engine-design";
|
|
2
|
-
import { GSError } from "../GSError";
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export declare class ShaderSourceParser {
|
|
7
|
-
static readonly errors: GSError[];
|
|
8
|
-
private static _renderStateConstMap;
|
|
9
|
-
private static _symbolTableStack;
|
|
10
|
-
private static _lexer;
|
|
11
|
-
private static _lookupSymbol;
|
|
12
|
-
static parse(sourceCode: string): IShaderSource;
|
|
13
|
-
private static _parseShader;
|
|
14
|
-
private static _parseRenderStateDeclarationOrAssignment;
|
|
15
|
-
private static _mergeRenderStates;
|
|
16
|
-
private static _parseVariableDeclaration;
|
|
17
|
-
private static _pushScope;
|
|
18
|
-
private static _popScope;
|
|
19
|
-
private static _parseRenderStateProperties;
|
|
20
|
-
private static _createCompileError;
|
|
21
|
-
private static _scanEnumConstValue;
|
|
22
|
-
private static _parseRenderStateProperty;
|
|
23
|
-
private static _parseRenderQueueDeclarationOrAssignment;
|
|
24
|
-
private static _addPendingContents;
|
|
25
|
-
private static _parseSubShader;
|
|
26
|
-
private static _parseTags;
|
|
27
|
-
private static _parsePass;
|
|
28
|
-
private static _parseRenderStateAndTags;
|
|
29
|
-
private static _parseRenderState;
|
|
30
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IBaseSymbol } from "../common/IBaseSymbol";
|
|
2
|
-
export declare class ShaderSourceSymbol implements IBaseSymbol {
|
|
3
|
-
ident: string;
|
|
4
|
-
type: number | null;
|
|
5
|
-
value?: any;
|
|
6
|
-
isInMacroBranch: boolean;
|
|
7
|
-
constructor(ident: string, type: number | null, value?: any);
|
|
8
|
-
set(ident: string, type: number, value?: any): void;
|
|
9
|
-
equal(other: ShaderSourceSymbol): boolean;
|
|
10
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Color } from "@galacean/engine-math";
|
|
2
|
-
import { ShaderPosition, ShaderRange } from "../common";
|
|
3
|
-
import { BaseLexer } from "../common/BaseLexer";
|
|
4
|
-
import { BaseToken } from "../common/BaseToken";
|
|
5
|
-
export default class SourceLexer extends BaseLexer {
|
|
6
|
-
hasPendingContent: boolean;
|
|
7
|
-
private static _keywordLexemeTable;
|
|
8
|
-
private static _symbolLexemeTable;
|
|
9
|
-
private static _isWordSeparatorChar;
|
|
10
|
-
private static _scanDigits;
|
|
11
|
-
scanNumber(): number;
|
|
12
|
-
scanColor(): Color;
|
|
13
|
-
scanToken(): BaseToken | undefined;
|
|
14
|
-
scanToCharacter(char: string): void;
|
|
15
|
-
createCompileError(message: string, location?: ShaderPosition | ShaderRange): Error;
|
|
16
|
-
private _scanWord;
|
|
17
|
-
private _validateWordBoundaries;
|
|
18
|
-
private _isValidWordBoundary;
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ShaderSourceParser } from "./ShaderSourceParser";
|