r600/sfn: keep workgroup and invocation ID registers for whole shader
authorGert Wollny <gert.wollny@collabora.com>
Sun, 22 Oct 2023 19:31:08 +0000 (21:31 +0200)
committerEric Engestrom <eric@engestrom.ch>
Sun, 17 Dec 2023 23:48:00 +0000 (23:48 +0000)
For some reason one must not overwrite these values "too early", so
pin them for the whole shader.

Fixes: 79ca45 (r600/sfn: rewrite NIR backend)
Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10004

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25846>
(cherry picked from commit eb25c7a4e284cf5a8986978d4f35cb105c073712)

.pick_status.json
src/gallium/drivers/r600/sfn/sfn_shader_cs.cpp

index 3959c68..513a0af 100644 (file)
         "description": "r600/sfn: keep workgroup and invocation ID registers for whole shader",
         "nominated": false,
         "nomination_type": 3,
-        "resolution": 4,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null,
         "notes": null
index 4cd2d4c..9ae839d 100644 (file)
@@ -52,7 +52,9 @@ ComputeShader::do_allocate_reserved_registers()
 
    for (int i = 0; i < 3; ++i) {
       m_local_invocation_id[i] = vf.allocate_pinned_register(thread_id_sel, i);
+      m_local_invocation_id[i]->set_flag(Register::pin_end);
       m_workgroup_id[i] = vf.allocate_pinned_register(wg_id_sel, i);
+      m_workgroup_id[i]->set_flag(Register::pin_end);
    }
    return 2;
 }