-
Notifications
You must be signed in to change notification settings - Fork 194
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] Support anonymous global uniforms #211
Conversation
Partly fixes gfx-rs#210
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you post an example code of what you are trying to support in this PR?
src/front/glsl/variables.rs
Outdated
@@ -92,6 +127,8 @@ impl Program { | |||
Ok(Some(local_var)) | |||
} else if let Some(global_var) = self.context.lookup_global_var_exps.get(name) { | |||
Ok(Some(*global_var)) | |||
} else if let Some(global_member) = self.lookup_global_struct_member(name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible, instead of calling lookup_global_struct_member
here, make sure these fields are present in the lookup_global_var_exps
table. I.e. once we encounter an anonymous global struct, just make sure we add the members to that map, and avoid any wacky lookups later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will take a look 👀
First step was to make it work :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Simpler code - though a bit sad to see all my fancy FP code gone 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Simpler code - a bit sad to see all my fancy FP fun gone though 😁
Partly handles issue in #210
Example shader: