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: 7cd606f01b ("r600: add r600_init_screen_caps")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33438>
This commit is contained in:
Patrick Lerda 2025-02-06 18:19:02 +01:00 committed by Marge Bot
parent c317778c67
commit bb44052ee9

View file

@ -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 = {};