Module: Mesa
Branch: master
Commit: c97ebe14617dac2afd2c66813b3679085a575e6b
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c97ebe14617dac2afd2c66813b3679085a575e6b

Author: Marek Olšák <[email protected]>
Date:   Fri Feb 26 18:01:19 2021 -0500

radeonsi: don't index si_context::shaders with enum gl_shader_stage

Fixes: a8373b3d387 "radeonsi: store si_context::xxx_shader members in union"

Reviewed-by: Zoltán Böszörményi <[email protected]>
Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9313>

---

 src/gallium/drivers/radeonsi/si_pipe.h          | 1 +
 src/gallium/drivers/radeonsi/si_state_shaders.c | 7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_pipe.h 
b/src/gallium/drivers/radeonsi/si_pipe.h
index 3cfa56c1d8d..23939873b61 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -1051,6 +1051,7 @@ struct si_context {
          struct si_shader_ctx_state tcs;
          struct si_shader_ctx_state tes;
       } shader;
+      /* indexed access using pipe_shader_type (not by MESA_SHADER_*) */
       struct si_shader_ctx_state shaders[SI_NUM_GRAPHICS_SHADERS];
    };
    struct si_shader_ctx_state cs_prim_discard_state;
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c 
b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 2a252c60cb7..c4b1cba6a0d 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -3279,12 +3279,13 @@ static void si_destroy_shader_selector(struct 
pipe_context *ctx, void *cso)
    struct si_context *sctx = (struct si_context *)ctx;
    struct si_shader_selector *sel = (struct si_shader_selector *)cso;
    struct si_shader *p = sel->first_variant, *c;
+   enum pipe_shader_type type = pipe_shader_type_from_mesa(sel->info.stage);
 
    util_queue_drop_job(&sctx->screen->shader_compiler_queue, &sel->ready);
 
-   if (sctx->shaders[sel->info.stage].cso == sel) {
-      sctx->shaders[sel->info.stage].cso = NULL;
-      sctx->shaders[sel->info.stage].current = NULL;
+   if (sctx->shaders[type].cso == sel) {
+      sctx->shaders[type].cso = NULL;
+      sctx->shaders[type].current = NULL;
    }
 
    while (p) {

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to