Skip to content

Commit

Permalink
fix: renderqueue assignment support variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Sway007 committed Nov 5, 2024
1 parent f755ebb commit 2b911ee
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions packages/shader-lab/src/contentParser/ShaderContentParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import {
import { GSErrorName } from "../GSError";
// #if _VERBOSE
import { GSError } from "../GSError";
import { ShaderLabUtils } from "../ShaderLabUtils";
// #endif
import { ShaderLabUtils } from "../ShaderLabUtils";

const EngineType = [
EKeyword.GS_RenderQueueType,
Expand Down Expand Up @@ -329,20 +329,12 @@ export class ShaderContentParser {
const word = scanner.scanToken();
scanner.scanText(";");
const value = ShaderContentParser._engineType.RenderQueueType[word.lexeme];
const key = RenderStateDataKey.RenderQueueType;
if (value == undefined) {
const error = ShaderLabUtils.createGSError(
`Invalid render queue ${word.lexeme}`,
GSErrorName.CompilationError,
scanner.source,
word.location
);
// #if _VERBOSE
this._errors.push(error);
return;
// #endif
ret.renderStates.variableMap[key] = word.lexeme;
} else {
ret.renderStates.constantMap[key] = value;
}
const key = RenderStateDataKey.RenderQueueType;
ret.renderStates.constantMap[key] = value;
}

private static _addGlobalStatement(
Expand Down

0 comments on commit 2b911ee

Please sign in to comment.