-
Notifications
You must be signed in to change notification settings - Fork 968
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
[naga] resolve the size of override-sized arrays in backends #6787
base: trunk
Are you sure you want to change the base?
Conversation
d4f5aa3
to
998667d
Compare
In #6788 (comment) I was specifically talking about the issue Jim brought up in #6788; this PR doesn't touch the compactor.
This PR obsoletes #6746. |
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.
Still reviewing.
naga/src/compact/mod.rs
Outdated
size_expr, | ||
)), | ||
stride, | ||
if old_size_expr != size_expr { |
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.
This could almost be a bug fix in its own right.
@cwfitzgerald via Wgpu Users in reply to @junglie85
Wouldn't this mean that it's better to resolve the size of override-sized arrays on the front end to minimize runtime overhead? |
Eh, way more work than the gain - that's not a very common workflow. |
998667d
to
bd02114
Compare
Is this an accurate description of the new /// Replace all overrides in `module` with fully-evaluated constant expressions.
///
/// Given `pipeline_constants`, providing values for all overrides in
/// `module`:
///
/// - Replace all [`Override`] expressions with fully-evaluated
/// constant expressions.
///
/// - Replace all [`Override`][paso] array sizes with [`Expression`]
/// array sizes, referring to fully-evaluated constant expressions.
///
/// - Empty out the `module.overrides` arena.
///
/// Although the above is described in terms of changes to `module`'s
/// contents, this function only actually has shared access to
/// `module`. When changes are needed, this function clones `module`
/// and returns a [`Cow::Owned`] value. If no changes are needed, this
/// function returns a [`Cow::Borrowed`] value that just passes along
/// the original reference.
///
/// [`Override`]: Expression::Override
/// [paso]: crate::PendingArraySize::Override
/// [`Expression`]: crate::PendingArraySize::Expression
|
That does sound more accurate than the current doc. Do you want to push the commit? Or else I can fixup the first commit. |
bd02114
to
b70b3e1
Compare
b70b3e1
to
ed3cb16
Compare
Connections
Fixes #6722
Closes #6746
Description
Implements Jim's suggestion of resolving the size of override-sized arrays in backends so that we don't have to rebuild the types arena when processing overrides.
Testing
The new and existing tests passed.