mesa: flush vertices before updating ctx->_Shader

Cc: 17.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
(cherry picked from commit 0b70d6ec56)
This commit is contained in:
Marek Olšák 2017-06-10 15:41:22 +02:00 committed by Andres Gomez
parent 365c326861
commit f174362ce7

View file

@ -469,6 +469,8 @@ _mesa_bind_pipeline(struct gl_context *ctx,
* considered current."
*/
if (&ctx->Shader != ctx->_Shader) {
FLUSH_VERTICES(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS);
if (pipe != NULL) {
/* Bound the pipeline to the current program and
* restore the pipeline state
@ -480,8 +482,6 @@ _mesa_bind_pipeline(struct gl_context *ctx,
ctx->Pipeline.Default);
}
FLUSH_VERTICES(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS);
for (i = 0; i < MESA_SHADER_STAGES; i++) {
struct gl_program *prog = ctx->_Shader->CurrentProgram[i];
if (prog) {