Commit 9091de43bb43287062c0ccfc241779f4389552af

Shahbaz Youssefi 2020-10-17T00:33:57

Vulkan: Support vertex attribute aliasing for non-matrix types Initial implementation that supports float and vecN types. In this case, every attribute occupies a single location. When two attributes alias, they are either the same size, or one is bigger than the other. Take the following example: attribute vec3 a; // location 0 attribute vec3 b; // location 0 attribute vec4 c; // location 1 attribute vec2 d; // location 1 The shader may access either a or b (but not both). Similarly, it can access either c or d (but not both). The shader can be modified such that: - f(b) is replaced with f(a). - g(d) is replaced with g(c.xy). - b and d are removed As a result, there are no longer any aliasing attributes. In other words, when attributes alias, the larger attribute can be retained and the other attributes can be replaced by selecting the appropriate number of components from the retained attribute. Bug: angleproject:4249 Change-Id: I7c5461f777d659c92977e2572091a8ce5e422704 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2482286 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Charlie Lao <cclao@google.com>