glsl/linker: handle array/struct members for DisableXfbPacking
authorLouis-Francis Ratté-Boulianne <lfrb@collabora.com>
Sat, 12 Oct 2019 04:19:50 +0000 (00:19 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 3 Mar 2020 12:28:23 +0000 (12:28 +0000)
commit4a329bea44fca8607a3e4538b18fd93864d99c18
tree82be86dbb008351df4048382d5bb253ab189681c
parent00746fa2dab0b55b113e3543420b79f01f91e5c1
glsl/linker: handle array/struct members for DisableXfbPacking

When varying packing is disabled for transform feedback and a xfb
declaration points to an array element or structure member, the
element/member should be aligned to the start of a slot as well.
If that's not the case, a new varying is created and the
element/member value is copied.

There might a way to further optimize the number of slots allocated
or the number of copies necessary if the performance cost is
problematic. For example, in cases where simply padding the top
level variable might correctly align all the captured values.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2433>
src/compiler/Makefile.sources
src/compiler/glsl/ir_optimization.h
src/compiler/glsl/link_varyings.cpp
src/compiler/glsl/link_varyings.h
src/compiler/glsl/lower_xfb_varying.cpp [new file with mode: 0644]
src/compiler/glsl/meson.build