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

[naga] resolve the size of override-sized arrays in backends #6787

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

teoxoy
Copy link
Member

@teoxoy teoxoy commented Dec 19, 2024

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.

@kentslaney
Copy link
Contributor

I'm confused about the status of this PR. In #6746 you said

I think it turned out well

but in #6788 you say

ultimately my attempt didn't work

Am I misreading or did something change? And where does this leave #6746?

@teoxoy
Copy link
Member Author

teoxoy commented Jan 6, 2025

but in #6788 you say

ultimately my attempt didn't work

In #6788 (comment) I was specifically talking about the issue Jim brought up in #6788; this PR doesn't touch the compactor.

And where does this leave #6746?

This PR obsoletes #6746.

Copy link
Member

@jimblandy jimblandy left a comment

Choose a reason for hiding this comment

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

Still reviewing.

size_expr,
)),
stride,
if old_size_expr != size_expr {
Copy link
Member

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.

@kentslaney
Copy link
Contributor

@cwfitzgerald via Wgpu Users in reply to @junglie85

I assume I can parse a wgsl shaders through naga at build time to generate the module, then load that from disk (or embed bytes) at runtime? Does the module still need to be compiled to a specific backend format when creating the shader module from the naga module?

You can theoretically do it, as you can serialize a Naga module, but yeah we still need to translate it at runtime up hlsl/glsl/spirv/msl

Wouldn't this mean that it's better to resolve the size of override-sized arrays on the front end to minimize runtime overhead?

@cwfitzgerald
Copy link
Member

Eh, way more work than the gain - that's not a very common workflow.

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.

[naga] panic when array override value already in arena
4 participants