diff options
author | Kenneth Graunke <[email protected]> | 2016-07-17 18:44:58 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2016-07-20 11:01:11 -0700 |
commit | a2dc11a7818c04d8dc0324e8fcba98d60baea529 (patch) | |
tree | 3530cdae3475ed421f1530ec56f5ba4d23f1f7eb /src/mesa/tnl_dd | |
parent | 048a56c1fc8f66e74645cc5ff4b4eb3d5ee471a8 (diff) |
i965: Move load_interpolated_input/barycentric_* intrinsics to the top.
Currently, i965 interpolates all FS inputs at the top of the program.
This has advantages and disadvantages, but I'd like to keep that policy
while reworking this code. We can consider changing it independently.
The next patch will make the compiler generate PLN instructions "on the
fly", when it encounters an input load intrinsic, rather than doing it
for all inputs at the start of the program.
To emulate this behavior, we introduce an ugly pass to move all NIR
load_interpolated_input and payload-based (not interpolator message)
load_barycentric_* intrinsics to the shader's start block.
This helps avoid regressions in shader-db for cases such as:
if (...) {
...load some input...
} else {
...load that same input...
}
which CSE can't handle, because there's no dominance relationship
between the two loads. Because the start block dominates all others,
we can CSE all inputs and emit PLNs exactly once, as we did before.
Ideally, global value numbering would eliminate these redundant loads,
while not forcing them all the way to the start block. When that lands,
we should consider dropping this hacky pass.
Again, this pass currently does nothing, as i965 doesn't generate these
intrinsics yet. But it will shortly, and I figured I'd separate this
code as it's relatively self-contained.
v2: Dramatically simplify pass - instead of creating new instructions,
just remove/re-insert their list nodes (suggested by Jason Ekstrand).
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Chris Forbes <[email protected]> [v1]
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/tnl_dd')
0 files changed, 0 insertions, 0 deletions