OSDN Git Service

glsl: Add an array splitting pass.
authorEric Anholt <eric@anholt.net>
Sun, 3 Oct 2010 05:57:17 +0000 (22:57 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 12 Apr 2012 01:08:21 +0000 (18:08 -0700)
commit60177d5e2aec07ed6386a6935b118a356d58c4ec
treea013f97449bccc118aaa9ee42abc01fc22e11e6a
parentfda662f4dffa658d28ea739dd236fe0350828d59
glsl: Add an array splitting pass.

I've had this code laying around almost done for a long time.  The
idea is like opt_structure_splitting, that we've got a bunch of
transforms at the GLSL IR level that only understand scalars and
vectors, which just skip complicated dereferences.  While driver
backends may manage some optimization after they split matrices up
themselves, it would be better to bring all of our optimization to
bear on the problem.

While I wasn't expecting changes quite yet, a few programs end up
winning: a gstreamer convolution shader, and the Humus dynamic
branching demo:
Total instructions: 269430 -> 269342
3/2148 programs affected (0.1%)
1498 -> 1410 instructions in affected programs (5.9% reduction)
src/glsl/Makefile.sources
src/glsl/glsl_parser_extras.cpp
src/glsl/ir_optimization.h
src/glsl/opt_array_splitting.cpp [new file with mode: 0644]