Closed requested to merge gfxstrand/mesa:review/intel-fs-avoid-helper-tex into master
In some fragment shaders which run with piles of helper invocations, the bandwidth burned by texturing in those helpers can be significant. We can reduce this bandwidth by looking at the pixel mask and predicating the texture instruction if our pixel isn't actually lit. Of course, we can't do this in general because we have to first scan the shader to make sure that the result of the texture instruction isn't needed for helpers. This improves GpuTest FurMark performance by 5%.
Unfortunately, all this predication wreaks havoc on shader-db:
total instructions in shared programs: 15188837 -> 17454925 (14.92%) instructions in affected programs: 9379817 -> 11645905 (24.16%) helped: 1 HURT: 73011 total cycles in shared programs: 353895622 -> 476904628 (34.76%) cycles in affected programs: 207008867 -> 330017873 (59.42%) helped: 6794 HURT: 63487 total spills in shared programs: 8843 -> 186532 (2009.37%) spills in affected programs: 1762 -> 179451 (10084.51%) helped: 3 HURT: 375 total fills in shared programs: 21738 -> 378544 (1641.39%) fills in affected programs: 3407 -> 360213 (10472.73%) helped: 3 HURT: 375 LOST: 150 GAINED: 34
If this helps anything else, we likely will want a driconf option.