зеркало из https://github.com/AvaloniaUI/angle.git
8c78ce4bd3
In many places in ANGLE we need to traverse a ShaderVariable tree. We do this to store uniform offset and other information, to flatten the tree of uniforms for the front-end, or to produce active variable lists for uniform and shader storage blocks. In each case, we would write separate tree traversal code. This patch introduces a shared visitor pattern for all of the shader variable tree traversal instances. With that get more common code. Also it is easier to write new variable traversals. ProgramD3D and ProgramLinkedResources in particular get nice simplificiations. The visitor object recieves callbacks from the traversal when entering structs, array elements, and new variables. The visitor can treat these differently depending on the use case. A common visitor that constructs full variable names is used as a base class in several places. Also moves the 'isRowMajorLayout' from sh::InterfaceBlockField to sh::ShaderVariable. This allows us to forgo using templates in several call sites. Bug: angleproject:3024 Change-Id: I472d81ec775e2eee92fb3d2eb0ca83860221ba2e Reviewed-on: https://chromium-review.googlesource.com/c/1358722 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> |
||
---|---|---|
.. | ||
ShaderLang.h | ||
ShaderVars.h |