mutter/cogl/driver
Neil Roberts 2933423ca7 Don't generate GLSL for the point size for default pipelines
Previously on GLES2 where there is no builtin point size uniform then
we would always add a line to the vertex shader to write to the
builtin point size output because when generating the shader it is not
possible to determine if the pipeline will be used to draw points or
not. This patch changes it so that the default point size is 0.0f
which is documented to have undefined results when drawing points.
That way we can avoid adding the point size code to the shader in that
case. The assumption is that any application that is drawing points
will probably have explicitly set the point size on the pipeline
anyway so it is not a big deal to change the default size from 1.0f.

This adds a new pipeline state flag to track whether the point size is
non-zero. This needs to be its own state because altering it needs to
cause a different shader to be added to the pipeline cache. The state
flags that affect the vertex shader have been changed from a constant
to a runtime function because they will be different depending on
whether there is a builtin point size uniform.

There is also a unit test to ensure that changing the point size does
or doesn't generate a new shader depending on the values.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit b2eba06e16b587acbf5c57944a70ceccecb4f175)

Conflicts:
	cogl/cogl-pipeline-private.h
	cogl/cogl-pipeline-state-private.h
	cogl/cogl-pipeline-state.c
	cogl/cogl-pipeline.c
2013-06-21 14:18:37 +01:00
..
gl Don't generate GLSL for the point size for default pipelines 2013-06-21 14:18:37 +01:00
nop framebuffer: Bind the framebuffer before querying the bits 2013-01-22 17:48:18 +00:00