[Mesa-dev] [PATCH 0/6] TressFX fixes / constant array propagation rework

Kenneth Graunke kenneth at whitecape.org
Wed Jun 22 03:02:49 UTC 2016


Hello!

This series fixes the TressFX advanced hair rendering technique used
in Tomb Raider (2013).  Prior to this series, the shaders would fail
to link because a uvec4[327] constant array would get replicated a
ton of times, and then each copy would get promoted to a uniform array,
wildly exceeding the maximum number of uniform components.

To avoid this, we restrict the compiler from constant propagating whole
arrays, which duplicates a lot of data.  In the process, we fix some
other nasty bugs (creation of "const = const" statements), spiff up
the array splitting pass so it actually splits most constant arrays,
fix copy propagation of const arrays after the precise/invariant
work, and invoke copy propagation to clean up temps before resorting
to variable index lowering.

 src/compiler/glsl/linker.cpp                       |  1 +
 .../glsl/lower_const_arrays_to_uniforms.cpp        | 11 ++---
 src/compiler/glsl/opt_array_splitting.cpp          | 56 ++++++++++++++++++++++
 src/compiler/glsl/opt_constant_propagation.cpp     |  4 +-
 src/mesa/drivers/dri/i965/brw_link.cpp             |  2 +
 5 files changed, 64 insertions(+), 10 deletions(-)

--Ken



More information about the mesa-dev mailing list