summaryrefslogtreecommitdiff
path: root/cogl/cogl-pipeline-cache.c
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2013-06-20 13:25:49 +0100
committerNeil Roberts <neil@linux.intel.com>2013-06-21 14:18:37 +0100
commit2933423ca7fe28f959c44785e7a445ab9a34d4bd (patch)
treece9da4dd6a8132ae86c4b7e72537631d959c88ae /cogl/cogl-pipeline-cache.c
parent1455561a202002479f097ea88e0c93a2504c29b2 (diff)
downloadcogl-2933423ca7fe28f959c44785e7a445ab9a34d4bd.tar.gz
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
Diffstat (limited to 'cogl/cogl-pipeline-cache.c')
-rw-r--r--cogl/cogl-pipeline-cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cogl/cogl-pipeline-cache.c b/cogl/cogl-pipeline-cache.c
index df4c4338..3a96490c 100644
--- a/cogl/cogl-pipeline-cache.c
+++ b/cogl/cogl-pipeline-cache.c
@@ -53,7 +53,7 @@ _cogl_pipeline_cache_new (void)
_COGL_GET_CONTEXT (ctx, 0);
vertex_state =
- COGL_PIPELINE_STATE_AFFECTS_VERTEX_CODEGEN;
+ _cogl_pipeline_get_state_for_vertex_codegen (ctx);
layer_vertex_state =
COGL_PIPELINE_LAYER_STATE_AFFECTS_VERTEX_CODEGEN;
fragment_state =