From c0d7839c55aaf010b3f76b1e6af0645029f17a07 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Tue, 28 Feb 2012 14:10:43 +0000 Subject: [PATCH] vertend-glsl: Fix flushing the point size with the GL driver When using the GLSL vertend on GL, the point size was being flushed in _cogl_pipeline_vertend_glsl_start. However, this function bails out early if the pipeline already has a usable program so it would not hit the code to flush the point size in that case. This patch moves the code to _cogl_pipeline_vertend_glsl_end so that it will always be flushed if it is different. That is the same place that is flushed for the fixed vertend. Reviewed-by: Robert Bragg --- cogl/cogl-pipeline-vertend-glsl.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/cogl/cogl-pipeline-vertend-glsl.c b/cogl/cogl-pipeline-vertend-glsl.c index 31cc8e940..7ad5fc701 100644 --- a/cogl/cogl-pipeline-vertend-glsl.c +++ b/cogl/cogl-pipeline-vertend-glsl.c @@ -280,18 +280,6 @@ _cogl_pipeline_vertend_glsl_start (CoglPipeline *pipeline, to copy it from the custom uniform in the vertex shader */ g_string_append (shader_state->source, " cogl_point_size_out = cogl_point_size_in;\n"); - /* On regular OpenGL we'll just flush the point size builtin */ - else if (pipelines_difference & COGL_PIPELINE_STATE_POINT_SIZE) - { - CoglPipeline *authority = - _cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_POINT_SIZE); - - if (ctx->point_size_cache != authority->big_state->point_size) - { - GE( ctx, glPointSize (authority->big_state->point_size) ); - ctx->point_size_cache = authority->big_state->point_size; - } - } return TRUE; } @@ -509,6 +497,19 @@ _cogl_pipeline_vertend_glsl_end (CoglPipeline *pipeline, shader_state->gl_shader = shader; } + if (ctx->driver == COGL_DRIVER_GL && + (pipelines_difference & COGL_PIPELINE_STATE_POINT_SIZE)) + { + CoglPipeline *authority = + _cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_POINT_SIZE); + + if (ctx->point_size_cache != authority->big_state->point_size) + { + GE( ctx, glPointSize (authority->big_state->point_size) ); + ctx->point_size_cache = authority->big_state->point_size; + } + } + return TRUE; }