mutter/cogl/driver/gl
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 Add support for per-vertex point sizes 2013-06-07 16:53:29 +01:00
gles Add support for per-vertex point sizes 2013-06-07 16:53:29 +01:00
cogl-attribute-gl-private.h buffer: splits out GL specific code 2013-01-22 17:47:59 +00:00
cogl-attribute-gl.c pipeline: improve real_blend_enable checks 2013-06-06 21:27:09 +01:00
cogl-buffer-gl-private.h Allow propogation of OOM errors to apps 2013-01-22 17:48:07 +00:00
cogl-buffer-gl.c buffer: Don't set the invalidate hint when requesting read access 2013-02-19 15:03:30 +00:00
cogl-clip-stack-gl-private.h clip-stack: Splits out opengl specific code 2013-01-22 17:47:59 +00:00
cogl-clip-stack-gl.c pipeline: improve real_blend_enable checks 2013-06-06 21:27:09 +01:00
cogl-framebuffer-gl-private.h framebuffer: Bind the framebuffer before querying the bits 2013-01-22 17:48:18 +00:00
cogl-framebuffer-gl.c gl: ensure depth isn't masked during clear 2013-03-06 16:45:31 +00:00
cogl-pipeline-fragend-fixed-private.h Re-organize the source layout 2013-01-22 17:47:19 +00:00
cogl-pipeline-fragend-fixed.c Remove cogl-internal.h 2013-01-22 17:48:17 +00:00
cogl-pipeline-fragend-glsl-private.h Re-organize the source layout 2013-01-22 17:47:19 +00:00
cogl-pipeline-fragend-glsl.c Use the Wayland embedded linked list implementation instead of BSD's 2013-06-13 13:45:47 +01:00
cogl-pipeline-opengl-private.h pipeline: improve real_blend_enable checks 2013-06-06 21:27:09 +01:00
cogl-pipeline-opengl.c Add support for per-vertex point sizes 2013-06-07 16:53:29 +01:00
cogl-pipeline-progend-fixed-private.h Re-organize the source layout 2013-01-22 17:47:19 +00:00
cogl-pipeline-progend-fixed.c Add support for per-vertex point sizes 2013-06-07 16:53:29 +01:00
cogl-pipeline-progend-glsl-private.h Re-organize the source layout 2013-01-22 17:47:19 +00:00
cogl-pipeline-progend-glsl.c Don't generate GLSL for the point size for default pipelines 2013-06-21 14:18:37 +01:00
cogl-pipeline-vertend-fixed-private.h Re-organize the source layout 2013-01-22 17:47:19 +00:00
cogl-pipeline-vertend-fixed.c Don't generate GLSL for the point size for default pipelines 2013-06-21 14:18:37 +01:00
cogl-pipeline-vertend-glsl-private.h Re-organize the source layout 2013-01-22 17:47:19 +00:00
cogl-pipeline-vertend-glsl.c Don't generate GLSL for the point size for default pipelines 2013-06-21 14:18:37 +01:00
cogl-texture-2d-gl-private.h Allow lazy texture storage allocation 2013-01-22 17:48:17 +00:00
cogl-texture-2d-gl.c Replace some #if HAVE_COGL_GL lines with #ifdef 2013-01-25 18:21:09 +00:00
cogl-texture-gl-private.h Move _cogl_texture_get_gl_format to -texture-gl.c 2013-01-22 17:48:17 +00:00
cogl-texture-gl.c Don't set GL_TEXTURE_MAX_LEVEL on GLES 2013-01-25 18:21:09 +00:00
cogl-util-gl-private.h Add the layer's sampler and uniform declarations at the start 2013-02-27 15:53:43 +00:00
cogl-util-gl.c Add the layer's sampler and uniform declarations at the start 2013-02-27 15:53:43 +00:00