diff options
author | Tom Stellard <[email protected]> | 2012-09-15 23:25:34 -0400 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2012-11-16 17:07:11 -0500 |
commit | 71877143b62ce3f10ef4716d19361fa95a53ff42 (patch) | |
tree | e2dd4e238e7991338d2c767d5592b51c98363316 /src/gallium/targets | |
parent | 26463b89960521dd51d661fd0608e2d665111f1a (diff) |
r300/compiler: Avoid generating MOV instructions for invalid IMM swizzles v2
If an instruction reads from a constant register that contains
immediates using an invalid swizzle, we can avoid generating MOV
instructions to fix up the swizzle by loading the immediates into a
different constant register that can be read using a valid swizzle.
This only affects r300 and r400 cards.
For example:
CONST[1] = { -3.5000 3.5000 2.5000 1.5000 }
MAD temp[4].xy, const[0].xy__, const[1].xz__, input[0].xy__;
========== Before this change would be lowered to: =========
CONST[1] = { -3.5000 3.5000 2.5000 1.5000 }
MOV temp[0].x, const[1].x___;
MOV temp[0].y, const[1]._z__;
MAD temp[4].xy, const[0].xy__, temp[0].xy__, input[0].xy__;
========== After this change is lowered to: ===============
CONST[1] = { -3.5000 3.5000 2.5000 1.5000 }
CONST[2] = { 0.0000 -3.5000 2.5000 0.0000 }
MAD temp[4].xy, const[0].xy__, const[2].yz__, input[0].xy__;
============================================================
This change reduces one of the Lightsmark shaders from 133 to 91
instructions.
v2:
- Fix crash caused by swizzles with only inline constants.
Diffstat (limited to 'src/gallium/targets')
0 files changed, 0 insertions, 0 deletions