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 <robert@linux.intel.com>
This commit is contained in:
Neil Roberts 2012-02-28 14:10:43 +00:00
parent 1d59fccf10
commit c0d7839c55

View File

@ -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;
}