glsl: Skip rewriting instructions in opt_cpe when unnecessary.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 28 Aug 2014 22:44:49 +0000 (15:44 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 4 Sep 2014 00:26:04 +0000 (17:26 -0700)
commit702b6ea05178388aef22af36a53362212ce9b629
tree600a2df2e40d189c13979b678a4f8b3260c24ac4
parent5ced83ee1561553d9eba831fa356bf63cc214447
glsl: Skip rewriting instructions in opt_cpe when unnecessary.

Previously, opt_copy_propagation_elements would always rewrite the
instruction stream, even if was the same thing as before.  In order to
report progress correctly, we'll need to bail if the suggested
replacement is identical (or equivalent) to the original code.

This also introduced unnecessary noop swizzles, as far as I can tell.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/glsl/opt_copy_propagation_elements.cpp