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 wgsl-in] Unify statement nesting limits with other recursion limits #6970

Open
jimblandy opened this issue Jan 21, 2025 · 0 comments
Open
Labels
area: naga front-end kind: refactor Making existing function faster or nicer lang: WGSL WebGPU Shading Language naga Shader Translator type: enhancement New feature or request

Comments

@jimblandy
Copy link
Member

The facilities that #6885 adds to prevent stack exhaustion in the WGSL parser should be unified with the limits on statement nesting depth implemented by front::wgsl::parse::Parser::increase_brace_nesting added in #5447.

The fix probably won't quite as nice as we might hope: although the WGSL specification places a limit on statement brace nesting, it does not specify any limit on expression or type nesting, meaning that Naga must treat the latter as an uncategorized error. If we want to retain the accuracy of the current statement nesting depth checks, there would probably need to be two separate depth counters.

But I think it's still valuable to have these two things handled by mechanisms that are similar, even if not identical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: naga front-end kind: refactor Making existing function faster or nicer lang: WGSL WebGPU Shading Language naga Shader Translator type: enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

2 participants