freedreno/turnip: Use the NIR info to decide if we need helper invocations.
authorEric Anholt <eric@anholt.net>
Tue, 24 Mar 2020 16:59:16 +0000 (09:59 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 31 Mar 2020 22:29:22 +0000 (22:29 +0000)
commit31011c7a39f0d054b97b730c8928176d72c9707c
tree39425f310da4215084c732773a1682cc5ad51902
parent974b9c57c1efec7b58339f23d0d35bae2c6d9890
freedreno/turnip: Use the NIR info to decide if we need helper invocations.

We had an approximation that was assuming any ddx or tex instruction
needed helper invocations, but that's not true for texelFetch() or
textureSize().  It also meant that we were setting PIXLOD on vertex and
compute shaders doing texturing, which doesn't really make sense.

shader-db (with a hack to log pixlod):
total pixlod in shared programs: 582 -> 573 (-1.55%)

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2681
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4308>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4308>
src/freedreno/ir3/ir3_compiler_nir.c
src/freedreno/ir3/ir3_legalize.c
src/freedreno/ir3/ir3_nir_lower_load_barycentric_at_offset.c