Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[WIP] update naga to 0.13.0 #37
[WIP] update naga to 0.13.0 #37
Changes from 1 commit
0152fd0
eeb62e3
e07caee
46e7ded
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
it looks to me like
init
andoverride
can both be specified - init is the default if an override is not provided on the pipeline.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.
Yes, but the
override
doesn't do anything at this time. Maybe we should wait for naga to add functionality for thisoverride
field?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.
i'd just import/copy both the fields over. no reason not to
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.
const_expressions can be more than just constants, they can be compound expressions as long as all the components are const_expressions as well.
i haven't looked in a lot of detail, but i think rather than making a new function here, the easier thing to do is to use the existing
import_expression
fn passingself.const_expressions
andself.shader.const_expressions
in as the new and old arenas (instead of the function-local arenas that are used when import_expression is called in function import).you will probably need to also make a member for the
already_imported
param, that gets reset when the shader is changed. this might mean we end up with duplicate const_expressions if multiple modules define the same constant, but that should be ok.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.
With this approach I'm struggling with the borrow checker 🤕 🤕 🤕 The
import_expression
both borrowsself.const_expressions
andself.shader.const_expressions
exclusively. Please give me some time to fix this.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.
i think it would be pretty reasonable to change the
already_imported
andnew_expressions
params toRefCell
s (as well as theconst_expressions
andconst_expressions_map
members).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.
I changed them to
RefCell
s but there are many runtimeBorrowMut
errors when running tests, still working at it.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.
i don't think you should change everything to refcell, just the const_expression bits (and the params for import_expression). i should have time at the weekend for a proper look if you get stuck.
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.
If I didn't change everything to
RefCell
, I can't change the&mut self
to&self
, which occurs inimport_block
,import_const
and other import functions, then borrow checkings errors happens:self.import_expression(...&self.const_expression_map, &self.const_expressions,...)
🤕Appreciate it! I'm going on a trip tomorrow so maybe I don't have much time at the weekend, but I will try my best to work with you and make this update happen.