vbo: correctly restore _VaryingInputs for display list fast path
authorMarek Olšák <marek.olsak@amd.com>
Thu, 22 Jun 2023 11:15:02 +0000 (07:15 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 6 Jul 2023 04:01:50 +0000 (04:01 +0000)
Fixes: 3a294ff0 - mesa: move the _mesa_set_varying_vp_inputs call to where the state changes
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9007

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23796>

src/mesa/vbo/vbo_save_draw.c

index 29e7f3a..9663ff1 100644 (file)
@@ -207,6 +207,7 @@ vbo_save_playback_vertex_list_gallium(struct gl_context *ctx,
     * which attribs have stride = 0 and whether edge flags are enabled.
     */
    const GLbitfield enabled = node->enabled_attribs[mode];
+   const GLbitfield saved_varying_vp_inputs = ctx->VertexProgram._VaryingInputs;
    _mesa_set_varying_vp_inputs(ctx, enabled);
 
    if (ctx->NewState)
@@ -291,8 +292,9 @@ vbo_save_playback_vertex_list_gallium(struct gl_context *ctx,
                                          NULL, 1);
    }
 
-   /* Restore edge flag state. */
+   /* Restore edge flag state and ctx->VertexProgram._VaryingInputs. */
    _mesa_update_edgeflag_state_vao(ctx);
+   _mesa_set_varying_vp_inputs(ctx, saved_varying_vp_inputs);
 
    if (copy_to_current)
       playback_copy_to_current(ctx, node);