Skip to content

lima: add native txp support

Vasily Khoruzhick requested to merge anarsoul/mesa:lima-tex-proj into main

Currently lima uses generic TXP lowering that results in downgrading coords precision to FP16 since we have to do some calculations with coords instead of loading them directly from varying.

Mali4x0 has native TXP support, however coords and projector have to come from a single source.

Add NIR lowering pass that combines coords and projector into a single backend-specific source and use it instead of generic lowering.

Unfortunately this change regresses one test, but it also fails in blob and disassembly is now identical.

shader-db:

instructions helped:   test/unity/38.shader_test MESA_SHADER_FRAGMENT:   230 -> 228 (-0.87%)
instructions helped:   test/unity/39.shader_test MESA_SHADER_FRAGMENT:   218 -> 216 (-0.92%)
instructions helped:   test/unity/40.shader_test MESA_SHADER_FRAGMENT:   192 -> 190 (-1.04%)
instructions helped:   test/unity/60-DeferredSpot.shader_test MESA_SHADER_FRAGMENT: 108 -> 106 (-1.85%)
instructions helped:   test/unity/99-Water.shader_test MESA_SHADER_FRAGMENT: 91 -> 83 (-8.79%)
instructions helped:   test/unity/41-GrassBillboard.shader_test MESA_SHADER_FRAGMENT: 19 -> 17 (-10.53%)
instructions helped:   test/unity/37-Terrain.shader_test MESA_SHADER_FRAGMENT: 19 -> 17 (-10.53%)

spills HURT:   test/unity/99-Water.shader_test MESA_SHADER_FRAGMENT: 0 -> 1

fills HURT:   test/unity/99-Water.shader_test MESA_SHADER_FRAGMENT: 0 -> 4

total instructions in shared programs: 15623 -> 15603 (-0.13%)
instructions in affected programs: 877 -> 857 (-2.28%)
helped: 7
HURT: 0
helped stats (abs) min: 2 max: 8 x̄: 2.86 x̃: 2
helped stats (rel) min: 0.87% max: 10.53% x̄: 4.93% x̃: 1.85%
95% mean confidence interval for instructions value: -4.95 -0.76
95% mean confidence interval for instructions %-change: -9.31% -0.55%
Instructions are helped.

total loops in shared programs: 3 -> 3 (0.00%)
loops in affected programs: 0 -> 0
helped: 0
HURT: 0

total spills in shared programs: 136 -> 137 (0.74%)
spills in affected programs: 0 -> 1
helped: 0
HURT: 1

total fills in shared programs: 598 -> 602 (0.67%)
fills in affected programs: 0 -> 4
helped: 0
HURT: 1

LOST:   0
GAINED: 0

Total CPU time (seconds): 82.58 -> 72.23 (-12.53%)
Edited by Vasily Khoruzhick

Merge request reports