radeonsi: don't allow draw calls with uninitialized VS inputs
[mesa.git] / src / gallium / drivers / radeonsi / si_state_shaders.c
index c5412f3b143789d42a1001cbaff83543790d6db5..18015bbec485f74bfffdd202d240d112ce64c808 100644 (file)
@@ -2714,6 +2714,10 @@ static void *si_create_shader_selector(struct pipe_context *ctx,
                        (sel->so.output[i].stream * 4);
        }
 
+       sel->num_vs_inputs = sel->type == PIPE_SHADER_VERTEX &&
+                            !sel->info.properties[TGSI_PROPERTY_VS_BLIT_SGPRS_AMD] ?
+                                    sel->info.num_inputs : 0;
+
        /* The prolog is a no-op if there are no inputs. */
        sel->vs_needs_prolog = sel->type == PIPE_SHADER_VERTEX &&
                               sel->info.num_inputs &&
@@ -3050,7 +3054,7 @@ bool si_update_ngg(struct si_context *sctx)
                        sctx->flags |= SI_CONTEXT_VGT_FLUSH;
 
                sctx->ngg = new_ngg;
-               sctx->last_rast_prim = -1; /* reset this so that it gets updated */
+               sctx->last_gs_out_prim = -1; /* reset this so that it gets updated */
                return true;
        }
        return false;
@@ -3073,7 +3077,7 @@ static void si_bind_gs_shader(struct pipe_context *ctx, void *state)
        sctx->ia_multi_vgt_param_key.u.uses_gs = sel != NULL;
 
        si_update_common_shader_state(sctx);
-       sctx->last_rast_prim = -1; /* reset this so that it gets updated */
+       sctx->last_gs_out_prim = -1; /* reset this so that it gets updated */
 
        ngg_changed = si_update_ngg(sctx);
        if (ngg_changed || enable_changed)
@@ -3127,7 +3131,7 @@ static void si_bind_tes_shader(struct pipe_context *ctx, void *state)
        si_update_tess_uses_prim_id(sctx);
 
        si_update_common_shader_state(sctx);
-       sctx->last_rast_prim = -1; /* reset this so that it gets updated */
+       sctx->last_gs_out_prim = -1; /* reset this so that it gets updated */
 
        bool ngg_changed = si_update_ngg(sctx);
        if (ngg_changed || enable_changed)