From 9fd4deead38279f291a046449c84130b7cdbf991 Mon Sep 17 00:00:00 2001 From: Patrick Lerda Date: Thu, 6 Feb 2025 18:19:02 +0100 Subject: [PATCH] r600: fix r600_init_shader_caps() has_atomics issue Indeed, has_atomics is not yet initialized at the time of the call of r600_init_shader_caps(). This change fixes this issue. For instance, this issue is triggered with "piglit/bin/clearbuffer-depth-cs-probe -auto -fbo": clearbuffer-depth-cs-probe: ../src/gallium/drivers/r600/evergreen_state.c:5039: evergreen_emit_atomic_buffer_setup: Assertion `resource' failed. Aborted Fixes: 7cd606f01b99 ("r600: add r600_init_screen_caps") Signed-off-by: Patrick Lerda Reviewed-by: Qiang Yu Part-of: (cherry picked from commit bb44052ee95d4643f5d995b851feae55d5cd2555) --- .pick_status.json | 2 +- src/gallium/drivers/r600/r600_pipe.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index c72cd6eb686..97e5b2a71de 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -384,7 +384,7 @@ "description": "r600: fix r600_init_shader_caps() has_atomics issue", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "7cd606f01b999cde306539bdf38fbe24072f90c7", "notes": null diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index cf3b9b08b18..865f726eef6 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -625,8 +625,6 @@ struct pipe_screen *r600_screen_create(struct radeon_winsys *ws, rscreen->has_msaa = true; - r600_init_screen_caps(rscreen); - /* MSAA support. */ switch (rscreen->b.gfx_level) { case R600: @@ -653,10 +651,13 @@ struct pipe_screen *r600_screen_create(struct radeon_winsys *ws, rscreen->global_pool = compute_memory_pool_new(rscreen); + rscreen->has_atomics = true; + + r600_init_screen_caps(rscreen); + /* Create the auxiliary context. This must be done last. */ rscreen->b.aux_context = rscreen->b.b.context_create(&rscreen->b.b, NULL, 0); - rscreen->has_atomics = true; #if 0 /* This is for testing whether aux_context and buffer clearing work correctly. */ struct pipe_resource templ = {};