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

glsl-in: Type qualifiers rework #1713

Merged
merged 1 commit into from
Feb 4, 2022

Conversation

JCapucho
Copy link
Collaborator

@JCapucho JCapucho commented Feb 3, 2022

The previous implementation had many issues, most importantly it didn't
allow to implement (at least in a sane way) some future features like
default qualifiers and format qualifiers.

This implementations centralizes the qualifiers into a struct with a
hashmap for layout qualifiers, error reporting is also centralized which
means that add_global_var and add_local_var no longer need to
duplicate effort and the ugly loop + match combo is gone.

Finally some minor fixes are also done as part of this rework, like
a default location being provided for input/outputs variables, layout
qualifiers being allowed to be repeated (overwriting the previous one)
like the spec defines, more syntax validation is added to qualifiers and
more errors are made to not stop parsing when encountered.

src/front/glsl/ast.rs Outdated Show resolved Hide resolved
src/front/glsl/ast.rs Show resolved Hide resolved
The previous implementation had many issues, most importantly it didn't
allow to implement (at least in a sane way) some future features like
default qualifiers and format qualifiers.

This implementations centralizes the qualifiers into a struct with a
hashmap for layout qualifiers, error reporting is also centralized which
means that `add_global_var` and `add_local_var` no longer need to
duplicate effort and the ugly loop + match combo is gone.

Finally some minor fixes are also done as part of this rework, like
a default location being provided for input/outputs variables and layout
qualifiers being allowed to be repeated (overwriting the previous one)
like the spec defines.
@JCapucho JCapucho force-pushed the glsl-qualifiers-rework branch from e746b5c to c9224b0 Compare February 4, 2022 19:42
@JCapucho JCapucho requested a review from kvark February 4, 2022 19:43
Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@kvark kvark merged commit e621acc into gfx-rs:master Feb 4, 2022
@JCapucho JCapucho deleted the glsl-qualifiers-rework branch February 19, 2022 15:11
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