[naga wgsl-in] Unify statement nesting limits with other recursion limits #6970
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
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.
The text was updated successfully, but these errors were encountered: