radeonsi/gfx10: fix binding on si_update_scratch_relocs
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 21 Jun 2018 12:56:54 +0000 (14:56 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 3 Jul 2019 19:51:12 +0000 (15:51 -0400)
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/gallium/drivers/radeonsi/si_state_shaders.c

index 80d06b198677cd91264c03a11e1d04f3aec47b41..b83e3d0b9660ed23133f18c0d2c85c9224dba3ae 100644 (file)
@@ -3510,10 +3510,12 @@ static bool si_update_scratch_relocs(struct si_context *sctx)
        if (r < 0)
                return false;
        if (r == 1) {
-               if (sctx->tes_shader.current)
+               if (sctx->vs_shader.current->key.as_ls)
                        si_pm4_bind_state(sctx, ls, sctx->vs_shader.current->pm4);
-               else if (sctx->gs_shader.current)
+               else if (sctx->vs_shader.current->key.as_es)
                        si_pm4_bind_state(sctx, es, sctx->vs_shader.current->pm4);
+               else if (sctx->vs_shader.current->key.as_ngg)
+                       si_pm4_bind_state(sctx, gs, sctx->vs_shader.current->pm4);
                else
                        si_pm4_bind_state(sctx, vs, sctx->vs_shader.current->pm4);
        }
@@ -3523,8 +3525,10 @@ static bool si_update_scratch_relocs(struct si_context *sctx)
        if (r < 0)
                return false;
        if (r == 1) {
-               if (sctx->gs_shader.current)
+               if (sctx->tes_shader.current->key.as_es)
                        si_pm4_bind_state(sctx, es, sctx->tes_shader.current->pm4);
+               else if (sctx->tes_shader.current->key.as_ngg)
+                       si_pm4_bind_state(sctx, gs, sctx->tes_shader.current->pm4);
                else
                        si_pm4_bind_state(sctx, vs, sctx->tes_shader.current->pm4);
        }