Skip to content

freedreno/ir3: Switch to NIR for a5xx's vertex id lowering.

This was similarly done for a3xx & a4xx with 4bdd226a (freedreno/ir3: Switch to NIR for a3xx/a4xx's vertex id lowering., part of !18327 (merged)) already, yet a5xx was missed which I noticed as Minecraft window titlebar text corruption on my OnePlus 5T with an Adreno 540.

Before:

After:

How would backporting this to 22.2.x work? I initially noticed this after upgrading from 22.1.7 to 22.2.2.
UPDATE: I've added Cc: mesa-stable to the commit, however on stable https://gitlab.freedesktop.org/mesa/mesa/-/blob/22.2/src/freedreno/ir3/ir3_compiler.c#L121-122 will need to be modified as https://gitlab.freedesktop.org/mesa/mesa/-/blob/fdbb0059/src/freedreno/ir3/ir3_compiler.c#L285-286 doesn't exist there.

Here's also my full bisect session which lead me to 34e868d8 (freedreno/ir3: tidy up duplication of common nir options, part of !16366 (merged)) which incorrectly "deduplicated" vertex_id_zero_based by setting it from true to false on all non-A6XX Adreno GPUs.

mesa$ git bisect bad 373b232675b72dfa9dac331c15123ca790c1f990
You need to start by "git bisect start"

Do you want me to do it for you [Y/n]? y
status: waiting for both good and bad commits
status: waiting for good commit(s), bad commit known
mesa$ git bisect good 2036a2c5c5ed63439d267b781c01e2edf7c15b74
Bisecting: 2579 revisions left to test after this (roughly 11 steps)
[8c4b88ee4885fcff8547238a8f752329083347d8] gallium+glsl: Remove EmitNoSat/PIPE_CAP_VERTEX_SHADER_SATURATE
mesa$ git bisect bad
Bisecting: 1287 revisions left to test after this (roughly 10 steps)
[997dc0a5e87cde58b4527185ed89196261164801] radeonsi: Move NULL check before dereference.
mesa$ git bisect good
Bisecting: 643 revisions left to test after this (roughly 9 steps)
[343f4f886faa9a0b4d1ff831b71623f49da2b5aa] asahi: Split unknown field in segment list header
mesa$ git bisect good
Bisecting: 321 revisions left to test after this (roughly 8 steps)
[d3c1b0ac2815617fe12a0969cbb384ee4e466d79] nir/divergence: handle load_scratch_base_ptr
mesa$ git bisect good
Bisecting: 160 revisions left to test after this (roughly 7 steps)
[cf52d79d2472c83ae6d8de8f8fc0796174beb854] v3dv: do not do STATIC_ASSERT on variables
mesa$ git bisect good
Bisecting: 80 revisions left to test after this (roughly 6 steps)
[bc9b2f378132ee701bd4e7f418228f15127efa08] r300: don't try to use inline constants instead of constant swizzles
mesa$ git bisect bad
Bisecting: 39 revisions left to test after this (roughly 5 steps)
[b4ef984ef3f5ff2ab1e762231f490e7407b01e00] Revert "zink: remove drm_fd"
mesa$ git bisect good
Bisecting: 19 revisions left to test after this (roughly 4 steps)
[a510a94b02449c3ecb9fad043a28fc8641ab66c8] panfrost: Create transform feedback shaders
mesa$ git bisect good
Bisecting: 9 revisions left to test after this (roughly 3 steps)
[bc0f8455e5dd969bdcc01bb03060c3259330e100] nouveau/nvc0: disable GLSL IR loop unrolling
mesa$ git bisect bad
Bisecting: 4 revisions left to test after this (roughly 2 steps)
[53df6dfb5baea9941167492d05c7f39ef0fafa8d] lima: lower all undefs to zero in vs
mesa$ git bisect bad
Bisecting: 2 revisions left to test after this (roughly 1 step)
[0f1cbcd6a7874da0ee36ebcec91b0a15cd643bfe] gallivm: disable GLSL IR loop unrolling in LLVMPIPE
mesa$ git bisect good
Bisecting: 0 revisions left to test after this (roughly 1 step)
[57dee95b854fe0ede3a6744f34e102000a118c2f] freedreno: switch to NIR loop unrolling
mesa$ git bisect bad
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[34e868d882c572fae8393fb005f93e86bb6ea3f5] freedreno/ir3: tidy up duplication of common nir options
mesa$ git bisect bad
34e868d882c572fae8393fb005f93e86bb6ea3f5 is the first bad commit
commit 34e868d882c572fae8393fb005f93e86bb6ea3f5
Author: Timothy Arceri <tarceri@itsqueeze.com>
Date:   Wed May 18 16:00:42 2022 +1000

    freedreno/ir3: tidy up duplication of common nir options
    
    Reviewed-by: Emma Anholt <emma@anholt.net>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16366>

 src/freedreno/ir3/ir3_compiler.c | 139 ++++++++++++++-------------------------
 1 file changed, 49 insertions(+), 90 deletions(-)
Edited by Jami Kettunen

Merge request reports