[Mesa-dev] [PATCH 27/31] mesa: flush vertices before updating ctx->_Shader

Marek Olšák maraeo at gmail.com
Mon Jun 12 16:55:52 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

Cc: 17.1 <mesa-stable at lists.freedesktop.org>
---
 src/mesa/main/pipelineobj.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c
index 0d1d57c..0f0d1da 100644
--- a/src/mesa/main/pipelineobj.c
+++ b/src/mesa/main/pipelineobj.c
@@ -518,33 +518,33 @@ _mesa_bind_pipeline(struct gl_context *ctx,
 
    /* Section 2.11.3 (Program Objects) of the OpenGL 4.1 spec says:
     *
     *     "If there is a current program object established by UseProgram,
     *     that program is considered current for all stages. Otherwise, if
     *     there is a bound program pipeline object (see section 2.11.4), the
     *     program bound to the appropriate stage of the pipeline object is
     *     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
           */
          _mesa_reference_pipeline_object(ctx, &ctx->_Shader, pipe);
       } else {
          /* Unbind the pipeline */
          _mesa_reference_pipeline_object(ctx, &ctx->_Shader,
                                          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) {
             _mesa_program_init_subroutine_defaults(ctx, prog);
          }
       }
    }
 }
 
 /**
-- 
2.7.4



More information about the mesa-dev mailing list