From bb44052ee95d4643f5d995b851feae55d5cd2555 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: --- src/gallium/drivers/r600/r600_pipe.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index 1b502550ff1..c7895c8b295 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -631,10 +631,6 @@ struct pipe_screen *r600_screen_create(struct radeon_winsys *ws, rscreen->has_msaa = true; - r600_init_compute_caps(rscreen); - r600_init_shader_caps(rscreen); - r600_init_screen_caps(rscreen); - /* MSAA support. */ switch (rscreen->b.gfx_level) { case R600: @@ -661,10 +657,15 @@ struct pipe_screen *r600_screen_create(struct radeon_winsys *ws, rscreen->global_pool = compute_memory_pool_new(rscreen); + rscreen->has_atomics = true; + + r600_init_compute_caps(rscreen); + r600_init_shader_caps(rscreen); + 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 = {};