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>
This commit is contained in:
Louis-Francis Ratté-Boulianne
2019-10-12 00:19:50 -04:00
committed by Marge Bot
parent 00746fa2da
commit 4a329bea44
6 changed files with 283 additions and 0 deletions

View File

@@ -175,6 +175,7 @@ files_libglsl = files(
'lower_output_reads.cpp',
'lower_shared_reference.cpp',
'lower_ubo_reference.cpp',
'lower_xfb_varying.cpp',
'opt_algebraic.cpp',
'opt_array_splitting.cpp',
'opt_conditional_discard.cpp',