@galacean/engine-shader-analyzer 0.0.0-stage → 2.0.0-alpha.53
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/LICENSE +21 -0
- package/README.md +88 -2
- package/dist/cli.js +2722 -0
- package/dist/main.js +2610 -0
- package/dist/main.js.map +1 -0
- package/dist/module.js +2601 -0
- package/dist/module.js.map +1 -0
- package/package.json +36 -3
- package/types/Diagnostic.d.ts +39 -0
- package/types/DiagnosticCategory.d.ts +13 -0
- package/types/DiagnosticType.d.ts +63 -0
- package/types/ShaderAnalysisInfo.d.ts +1 -0
- package/types/ShaderAnalyzer.d.ts +49 -0
- package/types/ShaderConditionDiagram.d.ts +1 -0
- package/types/ShaderIOValidator.d.ts +1 -0
- package/types/ShaderValidator.d.ts +132 -0
- package/types/cli.d.ts +1 -0
- package/types/convert.d.ts +7 -0
- package/types/index.d.ts +6 -0
- package/types/sourcePosition.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-shader-analyzer",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
|
|
3
|
+
"version": "2.0.0-alpha.53",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public",
|
|
6
|
+
"registry": "https://registry.npmjs.org"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/galacean/engine.git"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"main": "dist/main.js",
|
|
13
|
+
"module": "dist/module.js",
|
|
14
|
+
"debug": "src/index.ts",
|
|
15
|
+
"types": "types/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./types/index.d.ts",
|
|
19
|
+
"import": "./dist/module.js",
|
|
20
|
+
"require": "./dist/main.js"
|
|
21
|
+
},
|
|
22
|
+
"./package.json": "./package.json"
|
|
23
|
+
},
|
|
24
|
+
"bin": {
|
|
25
|
+
"galacean-shader-analyzer": "./dist/cli.js"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"README.md",
|
|
29
|
+
"dist/**/*",
|
|
30
|
+
"types/**/*"
|
|
31
|
+
],
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@galacean/engine-design": "2.0.0-alpha.53",
|
|
34
|
+
"@galacean/engine-shader-parser": "2.0.0-alpha.53"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"b:types": "tsc"
|
|
38
|
+
}
|
|
6
39
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DiagnosticType } from "./DiagnosticType";
|
|
2
|
+
/** Severity assigned to a shader diagnostic. */
|
|
3
|
+
export declare enum DiagnosticSeverity {
|
|
4
|
+
Error = "error",
|
|
5
|
+
Warning = "warning"
|
|
6
|
+
}
|
|
7
|
+
/** Structured diagnostic produced while analyzing a shader. */
|
|
8
|
+
export interface Diagnostic {
|
|
9
|
+
/** Severity of the diagnostic. */
|
|
10
|
+
severity: DiagnosticSeverity;
|
|
11
|
+
/** Semantic rule reported by the diagnostic. */
|
|
12
|
+
code: DiagnosticType;
|
|
13
|
+
/** Human-readable explanation of the reported rule violation. */
|
|
14
|
+
message: string;
|
|
15
|
+
/** Canonical Shader or ShaderChunk source path that owns the range. */
|
|
16
|
+
sourceFile?: string;
|
|
17
|
+
/** Source range containing the reported issue. Lines and columns are 1-based; offsets are 0-based. */
|
|
18
|
+
range: {
|
|
19
|
+
start: {
|
|
20
|
+
line: number;
|
|
21
|
+
column: number;
|
|
22
|
+
offset: number;
|
|
23
|
+
};
|
|
24
|
+
end: {
|
|
25
|
+
line: number;
|
|
26
|
+
column: number;
|
|
27
|
+
offset: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
/** Source text containing the reported issue. */
|
|
31
|
+
relatedSource?: string;
|
|
32
|
+
}
|
|
33
|
+
export { DiagnosticType };
|
|
34
|
+
/**
|
|
35
|
+
* Formats a diagnostic with a source excerpt and caret markers.
|
|
36
|
+
* @param diagnostic - Diagnostic to format.
|
|
37
|
+
* @returns Formatted diagnostic text.
|
|
38
|
+
*/
|
|
39
|
+
export declare function formatDiagnostic(diagnostic: Diagnostic): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DiagnosticType } from "./DiagnosticType";
|
|
2
|
+
/** High-level category assigned to a diagnostic type. */
|
|
3
|
+
export declare enum DiagnosticCategory {
|
|
4
|
+
Syntax = "syntax",
|
|
5
|
+
Symbol = "symbol",
|
|
6
|
+
Type = "type",
|
|
7
|
+
Constant = "constant",
|
|
8
|
+
ControlFlow = "controlFlow",
|
|
9
|
+
PipelineIO = "pipelineIO",
|
|
10
|
+
RenderState = "renderState"
|
|
11
|
+
}
|
|
12
|
+
/** Maps every diagnostic type to its high-level category. */
|
|
13
|
+
export declare const DIAGNOSTIC_CATEGORY: Record<DiagnosticType, DiagnosticCategory>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Semantic classification of a shader diagnostic.
|
|
3
|
+
*
|
|
4
|
+
* Severity is reported separately.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum DiagnosticType {
|
|
7
|
+
SyntaxError = "SyntaxError",
|
|
8
|
+
PreprocessorError = "PreprocessorError",
|
|
9
|
+
NoMatchingOverload = "NoMatchingOverload",
|
|
10
|
+
Redefinition = "Redefinition",
|
|
11
|
+
UseBeforeDeclaration = "UseBeforeDeclaration",
|
|
12
|
+
LocalFunctionPrototype = "LocalFunctionPrototype",
|
|
13
|
+
AmbiguousMacroBranchResolution = "AmbiguousMacroBranchResolution",
|
|
14
|
+
InvalidSwizzle = "InvalidSwizzle",
|
|
15
|
+
UndeclaredStructMember = "UndeclaredStructMember",
|
|
16
|
+
AssignTypeMismatch = "AssignTypeMismatch",
|
|
17
|
+
InvalidAssignmentTarget = "InvalidAssignmentTarget",
|
|
18
|
+
ConstDivideByZero = "ConstDivideByZero",
|
|
19
|
+
ShiftOutOfRange = "ShiftOutOfRange",
|
|
20
|
+
IndexOutOfBounds = "IndexOutOfBounds",
|
|
21
|
+
NonIntegerIndex = "NonIntegerIndex",
|
|
22
|
+
NonIndexableType = "NonIndexableType",
|
|
23
|
+
ExpectedSampler = "ExpectedSampler",
|
|
24
|
+
InvalidUnaryOperand = "InvalidUnaryOperand",
|
|
25
|
+
InvalidBinaryOperands = "InvalidBinaryOperands",
|
|
26
|
+
ConstructorArgType = "ConstructorArgType",
|
|
27
|
+
ConstructorArgCount = "ConstructorArgCount",
|
|
28
|
+
NonConstInitializer = "NonConstInitializer",
|
|
29
|
+
NonConstArraySize = "NonConstArraySize",
|
|
30
|
+
EmptyStruct = "EmptyStruct",
|
|
31
|
+
InvalidArraySize = "InvalidArraySize",
|
|
32
|
+
InvalidVoidVariable = "InvalidVoidVariable",
|
|
33
|
+
NonFloatDerivativeArg = "NonFloatDerivativeArg",
|
|
34
|
+
InvalidReturnType = "InvalidReturnType",
|
|
35
|
+
MissingReturn = "MissingReturn",
|
|
36
|
+
NonBoolCondition = "NonBoolCondition",
|
|
37
|
+
RecursiveFunction = "RecursiveFunction",
|
|
38
|
+
NonConstructibleReturnType = "NonConstructibleReturnType",
|
|
39
|
+
MisplacedControlFlow = "MisplacedControlFlow",
|
|
40
|
+
DerivativeInVertexShader = "DerivativeInVertexShader",
|
|
41
|
+
InvalidBuiltinStage = "InvalidBuiltinStage",
|
|
42
|
+
InvalidIOStruct = "InvalidIOStruct",
|
|
43
|
+
InvalidEntryReturnType = "InvalidEntryReturnType",
|
|
44
|
+
StructRoleConflict = "StructRoleConflict",
|
|
45
|
+
DuplicateEntryAssignment = "DuplicateEntryAssignment",
|
|
46
|
+
MissingEntry = "MissingEntry",
|
|
47
|
+
EntryNotFound = "EntryNotFound",
|
|
48
|
+
AmbiguousEntryPoint = "AmbiguousEntryPoint",
|
|
49
|
+
GlFragColorWithMrt = "GlFragColorWithMrt",
|
|
50
|
+
LegacyFragmentOutputConflict = "LegacyFragmentOutputConflict",
|
|
51
|
+
InvalidMrtOutput = "InvalidMrtOutput",
|
|
52
|
+
BareGlFragData = "BareGlFragData",
|
|
53
|
+
NonConstFragmentOutputIndex = "NonConstFragmentOutputIndex",
|
|
54
|
+
NestedIOStruct = "NestedIOStruct",
|
|
55
|
+
MissingVertexPosition = "MissingVertexPosition",
|
|
56
|
+
NonFlatIntegerVarying = "NonFlatIntegerVarying",
|
|
57
|
+
InvalidRenderStateProperty = "InvalidRenderStateProperty",
|
|
58
|
+
InvalidEnumValue = "InvalidEnumValue",
|
|
59
|
+
BitwiseOrOnNonBitmask = "BitwiseOrOnNonBitmask",
|
|
60
|
+
MixedEnumTypes = "MixedEnumTypes",
|
|
61
|
+
InvalidRenderStateVariable = "InvalidRenderStateVariable",
|
|
62
|
+
InvalidRenderQueueVariable = "InvalidRenderQueueVariable"
|
|
63
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ParsedShaderPass } from "@galacean/engine-shader-parser/shared";
|
|
2
|
+
import type { Diagnostic } from "./Diagnostic";
|
|
3
|
+
/**
|
|
4
|
+
* Maps canonical shader include paths to source chunks.
|
|
5
|
+
*
|
|
6
|
+
* Keys are project-root paths for normal includes. Relative includes from an absolute `sourceFile`
|
|
7
|
+
* use their resolved absolute URLs. An undefined value represents a known path whose source is unavailable.
|
|
8
|
+
*/
|
|
9
|
+
export type ShaderIncludeMap = Readonly<Record<string, string | undefined>>;
|
|
10
|
+
/**
|
|
11
|
+
* Controls include resolution and source attribution for one analysis request.
|
|
12
|
+
*/
|
|
13
|
+
export interface AnalyzerOptions {
|
|
14
|
+
/** `#include` lookup table using canonical project paths or resolved absolute URLs. */
|
|
15
|
+
includeMap?: ShaderIncludeMap;
|
|
16
|
+
/** Optional project path or absolute URL used as the relative-include base and for diagnostic attribution. */
|
|
17
|
+
sourceFile?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Contains every structured diagnostic produced for one ShaderLab document.
|
|
21
|
+
*/
|
|
22
|
+
export interface AnalysisResult {
|
|
23
|
+
/** Structured diagnostics from shader-source structure parsing and per-pass GLSL analysis. */
|
|
24
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
25
|
+
/**
|
|
26
|
+
* Opaque parsed non-UsePass entries in document order, reusable by `ShaderCompiler.generate()`.
|
|
27
|
+
* Empty when the ShaderLab document has structural parse errors.
|
|
28
|
+
*/
|
|
29
|
+
readonly passes: readonly ParsedShaderPass[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Analyzes ShaderLab source and GLSL semantics without generating backend source.
|
|
33
|
+
*
|
|
34
|
+
* Parser-owned definite failures remain attached to reusable pass handles so backend admission reaches the same
|
|
35
|
+
* conclusion. Analyzer-only validation stays independent from GLES code generation.
|
|
36
|
+
*/
|
|
37
|
+
export declare class ShaderAnalyzer {
|
|
38
|
+
private constructor();
|
|
39
|
+
/**
|
|
40
|
+
* Analyzes shader source.
|
|
41
|
+
* @param source - ShaderLab source to analyze.
|
|
42
|
+
* @param options - Analysis options.
|
|
43
|
+
* @returns Structured diagnostics and reusable parsed-pass handles.
|
|
44
|
+
* @throws Error when include keys collide after normalization or `sourceFile` is not a valid absolute URL.
|
|
45
|
+
*/
|
|
46
|
+
static analyze(source: string, options?: AnalyzerOptions): AnalysisResult;
|
|
47
|
+
private static _analyzeSource;
|
|
48
|
+
private static _analyzePass;
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { GSError } from "@galacean/engine-shader-parser/internal/analyzer";
|
|
2
|
+
import { type ShaderAnalysisInfo } from "./ShaderAnalysisInfo";
|
|
3
|
+
/**
|
|
4
|
+
* Post-parse validation pass. Walks the already-typed AST (the parser built the symbol table and
|
|
5
|
+
* inferred `.type` inline; only validation moved here) and collects diagnostics. The parsed pass
|
|
6
|
+
* source is retained by the neutral IR and attached to diagnostics emitted by this pass.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ShaderValidator {
|
|
9
|
+
private readonly _analysis;
|
|
10
|
+
/**
|
|
11
|
+
* Validate an already-parsed program and return collected diagnostics.
|
|
12
|
+
* @param analysis neutral IR plus analyzer-only graph information
|
|
13
|
+
* @returns diagnostics as `GSError[]`
|
|
14
|
+
*/
|
|
15
|
+
static validate(analysis: ShaderAnalysisInfo): GSError[];
|
|
16
|
+
private readonly _typeLookup;
|
|
17
|
+
private _errors;
|
|
18
|
+
/**
|
|
19
|
+
* Start indices of `gl_FragData` reference locations that appear as the base of a
|
|
20
|
+
* `PostfixExpression[base [ index ]]` — the legal `gl_FragData[i]` shape. Collected by
|
|
21
|
+
* `_checkPostfix` during the walk, then used by `_reportBareGlFragData` to strike these off the
|
|
22
|
+
* `ShaderAnalysisInfo.glFragDataReferences` list; the residue is bare use.
|
|
23
|
+
*/
|
|
24
|
+
private _indexedGlFragDataStarts;
|
|
25
|
+
/** Sites are attributed to exact function identities, then checked against each entry's macro paths. */
|
|
26
|
+
private readonly _stageRestrictedSites;
|
|
27
|
+
private readonly _source;
|
|
28
|
+
private readonly _shaderData;
|
|
29
|
+
private constructor();
|
|
30
|
+
private _walk;
|
|
31
|
+
/**
|
|
32
|
+
* `gl_FragData` is a fragment-output *array* — legal only when indexed (`gl_FragData[i] = ...`).
|
|
33
|
+
* A bare reference (r-value, l-value, swizzle, function arg) is invalid GLSL. `ShaderAnalysisInfo`
|
|
34
|
+
* collects every `gl_FragData` location; `_checkPostfix`
|
|
35
|
+
* records the base of every `gl_FragData[i]` shape in `_indexedGlFragDataStarts`. Anything left
|
|
36
|
+
* over — first occurrence only — is reported here.
|
|
37
|
+
*/
|
|
38
|
+
private _reportBareGlFragData;
|
|
39
|
+
private _push;
|
|
40
|
+
private _checkCustomTypeReference;
|
|
41
|
+
private _checkVariableDeclarator;
|
|
42
|
+
private _checkArraySpecifier;
|
|
43
|
+
/**
|
|
44
|
+
* Unary operand-type rules: `!` needs bool, `~` needs integer, `-`/`+` need numeric. The operand
|
|
45
|
+
* type is read directly (not the deduced result), so this fires for known operands and skips
|
|
46
|
+
* TypeAny (continue-with-unknown); `++`/`--` reduce with a raw token child and are not handled here.
|
|
47
|
+
*/
|
|
48
|
+
private _checkUnaryOperand;
|
|
49
|
+
/** Validate and infer arithmetic from the same TypeSystem operation result used by the parser. */
|
|
50
|
+
private _checkArithmeticOperation;
|
|
51
|
+
/**
|
|
52
|
+
* GLSL ES §6.1: function declarations (prototypes) may only appear at global scope. The grammar
|
|
53
|
+
* accepts `int g();` inside a function body, so without this check the parser cascades into a
|
|
54
|
+
* misleading `EntryNotFound`. A `FunctionProtoType` wrapped in a `FunctionDefinition` is the
|
|
55
|
+
* body path — that's a legal definition, not a prototype declaration.
|
|
56
|
+
*/
|
|
57
|
+
private _checkLocalFunctionPrototype;
|
|
58
|
+
/**
|
|
59
|
+
* `<<` `>>` `&` `|` `^` all take integer scalar-or-vector operands per §5.9.
|
|
60
|
+
*/
|
|
61
|
+
private _checkIntegerBinaryOperands;
|
|
62
|
+
/**
|
|
63
|
+
* `&&` `||` `^^` — each operand must be `bool` scalar per §5.9. GLSL ES rejects `bvecN` operands
|
|
64
|
+
* (desktop-GL 4.x does allow it; ES 3.00 does not).
|
|
65
|
+
*/
|
|
66
|
+
private _checkScalarBoolBinaryOperands;
|
|
67
|
+
/** First operand whose direct type is neither integer nor `TypeAny`. */
|
|
68
|
+
private _firstNonIntegerOperand;
|
|
69
|
+
/** First operand whose direct type is neither `bool` nor `TypeAny`. */
|
|
70
|
+
private _firstNonScalarBoolOperand;
|
|
71
|
+
/**
|
|
72
|
+
* Integer division/modulo by a compile-time constant zero is an error; float `1.0/0.0` yields Inf
|
|
73
|
+
* (unspecified, not an error). `%` is integer-only in GLSL ES; `/` qualifies only when the result
|
|
74
|
+
* type deduced to an integer (int/int) — FLOAT or TypeAny don't flag. Only reached with clean
|
|
75
|
+
* operands (the arithmetic-operand check already suppressed bad ones), so it scans operands once.
|
|
76
|
+
*/
|
|
77
|
+
private _checkConstDivideByZero;
|
|
78
|
+
/** A shift by a constant amount outside [0, 32) is out of range — GLSL ES int/uint are 32-bit. */
|
|
79
|
+
private _checkShiftRange;
|
|
80
|
+
/**
|
|
81
|
+
* Stateless postfix checks: an invalid swizzle on a known vector (`InvalidSwizzle`), and the
|
|
82
|
+
* `base[index]` family — `gl_FragData[i]` (`GlFragData`), a scalar non-array base (`NonIndexableType`),
|
|
83
|
+
* a non-integer index (`NonIntegerIndex`), and a constant index past a known vector/array size
|
|
84
|
+
* (`IndexOutOfBounds`). The struct-field (`else if`) path stays inline in the parser since it reads the
|
|
85
|
+
* symbol table; preserve the original control flow here (early returns, gl_FragData-vs-index branching).
|
|
86
|
+
*/
|
|
87
|
+
private _checkPostfix;
|
|
88
|
+
/** Diagnose only a proven fallthrough; unresolved macro conditions remain inconclusive. */
|
|
89
|
+
private _checkFunctionReturn;
|
|
90
|
+
/**
|
|
91
|
+
* Jump-statement checks needing walk-local context: `InvalidReturnType` fires per-jump — a value
|
|
92
|
+
* return in a `void` function, or a `return value;` whose value isn't assignable to the declared
|
|
93
|
+
* non-void return type. A `break`/`continue` at loop depth 0 (outside any loop) is
|
|
94
|
+
* `MisplacedControlFlow`. A discard site is checked against stage reachability after the walk.
|
|
95
|
+
*/
|
|
96
|
+
private _checkJump;
|
|
97
|
+
/**
|
|
98
|
+
* GLSL forbids recursion: a call whose callee name AND parameter signature match the enclosing
|
|
99
|
+
* function (the same overload) is `RecursiveFunction`. The parser short-circuits this same case
|
|
100
|
+
* during overload resolution (so it isn't mis-reported as Undefined/NoMatchingOverload); the
|
|
101
|
+
* exact-signature match avoids flagging a call to a different overload of the same name.
|
|
102
|
+
*/
|
|
103
|
+
private _checkRecursiveCall;
|
|
104
|
+
/**
|
|
105
|
+
* Reports one mutual-recursion witness per canonical participant. Direct self-recursion is
|
|
106
|
+
* already reported at the call site by `_checkRecursiveCall`.
|
|
107
|
+
*/
|
|
108
|
+
private _reportMutualRecursion;
|
|
109
|
+
/**
|
|
110
|
+
* Resolves stage restrictions through the shared branch-aware call graph, including entry bodies.
|
|
111
|
+
* Uncalled helpers and incompatible macro paths do not establish a stage violation.
|
|
112
|
+
*/
|
|
113
|
+
private _reportStageRestrictions;
|
|
114
|
+
private _recordStageRestriction;
|
|
115
|
+
private _collectStageRestrictions;
|
|
116
|
+
/**
|
|
117
|
+
* Fragment-only derivative builtins (`dFdx`/`dFdy`/`fwidth`) — illegal in the vertex shader
|
|
118
|
+
* (`DerivativeInVertexShader`) and require a float/floatN argument (`NonFloatDerivativeArg`).
|
|
119
|
+
* Only user-callable functions reach here (isBuiltin=false, since the identifier is a string name,
|
|
120
|
+
* not a type keyword); constructors like `vec3(...)` never match a derivative name.
|
|
121
|
+
*/
|
|
122
|
+
private _checkDerivativeCall;
|
|
123
|
+
/**
|
|
124
|
+
* `struct Foo { ... }` — flags an empty body (`EmptyStruct`). An empty body is unreachable via
|
|
125
|
+
* the plain grammar (`struct_declaration_list` requires ≥1 declaration → SyntaxError first), but a
|
|
126
|
+
* fully-macro-guarded body can reduce to zero collected props; the check catches that shape rather
|
|
127
|
+
* than the surface form.
|
|
128
|
+
*/
|
|
129
|
+
private _checkStructSpecifier;
|
|
130
|
+
/** float / vec2 / vec3 / vec4 — the `genType` family derivative builtins accept. */
|
|
131
|
+
private static _isFloatOrFloatVector;
|
|
132
|
+
}
|
package/types/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Diagnostic } from "./Diagnostic";
|
|
2
|
+
/**
|
|
3
|
+
* Converts a parser error to a structured diagnostic.
|
|
4
|
+
* @param error - Error reported while parsing or analyzing shader source.
|
|
5
|
+
* @returns Structured diagnostic for the error.
|
|
6
|
+
*/
|
|
7
|
+
export declare function gseErrorToDiagnostic(error: Error): Diagnostic;
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ShaderAnalyzer } from "./ShaderAnalyzer";
|
|
2
|
+
export type { AnalyzerOptions, AnalysisResult, ShaderIncludeMap } from "./ShaderAnalyzer";
|
|
3
|
+
export type { ParsedShaderPass } from "@galacean/engine-shader-parser/shared";
|
|
4
|
+
export type { Diagnostic } from "./Diagnostic";
|
|
5
|
+
export { DiagnosticType, DiagnosticSeverity, formatDiagnostic } from "./Diagnostic";
|
|
6
|
+
export { DiagnosticCategory, DIAGNOSTIC_CATEGORY } from "./DiagnosticCategory";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|