Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reserved keywords and replace GLSLPreParser with regex #683

Merged
merged 4 commits into from
Oct 28, 2024

Conversation

Cleptomania
Copy link
Member

Handles reserved keywords like sample and texture in GLSL by renaming with a simple string match. This is done prior to AST transformation by glsl-transformation-lib.

It also removes GLSLPreParser from glsl-transformation-lib, which was only used to parse out the version/profile from each shader. Instead it has been replaced with a regex based version. The GLSLPreParser has a bug which when it uses the same lexer as the rest of the parsing, causes the first node in the parsetree to be removed/missed.

This can probably be fixed in glsl-transformation-lib, but it's overkill probably for parsing out the version string anyways. Iris was using regex for this prior to switching to glsl-transformation-lib anyways.

@mitchej123 mitchej123 merged commit 8c90f79 into master Oct 28, 2024
1 check passed
@mitchej123 mitchej123 deleted the iris-shader-regex branch October 28, 2024 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants