There are a few validation phases required for WGSL: - Type checking - Behavior checking (see https://www.w3.org/TR/WGSL/#behaviors) - Uniformity analysis - no recursion - only valid attributes applied - etc... I decided to start by the behavior checking, for the following reasons: - It is fairly simple - But it touches both statements and expressions - And it will be required for uniformity
Created attachment 454430 [details] Patch
Comment on attachment 454430 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=454430&action=review > Source/WTF/ChangeLog:9 > + Added IndexMap::insert, which automatically grows the underlying vector if needed. > + It allows using IndexMap ergonomically even if we don't know the number of keys ahead of time. This probably should be its own patch, with its own TestWTF tests
(In reply to Myles C. Maxfield from comment #2) > Comment on attachment 454430 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=454430&action=review > > > Source/WTF/ChangeLog:9 > > + Added IndexMap::insert, which automatically grows the underlying vector if needed. > > + It allows using IndexMap ergonomically even if we don't know the number of keys ahead of time. > > This probably should be its own patch, with its own TestWTF tests IndexMap currently does not seem to have any test whatsoever. I filed https://bugs.webkit.org/show_bug.cgi?id=237847 about it.
Created attachment 454617 [details] Patch Validator.h was missing.
Comment on attachment 454617 [details] Patch Cancelling the review as trying to implement the uniformity analysis in the same style showed that it is too limited.
<rdar://problem/90458338>
Created attachment 457573 [details] WIP