summaryrefslogtreecommitdiff
path: root/cogl/cogl-pipeline-opengl.c
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2010-11-23 14:47:17 +0000
committerNeil Roberts <neil@linux.intel.com>2010-11-24 18:06:44 +0000
commitc50cb72748f708b8e4cf80a38c833403ef07f981 (patch)
tree1ee9064d7937946325d36442f69f34faff2c0e6e /cogl/cogl-pipeline-opengl.c
parent9089d95b3fa78a712cc56fee76e37bfd9f16c04f (diff)
downloadcogl-c50cb72748f708b8e4cf80a38c833403ef07f981.tar.gz
Remove the fragment shader generation from the GLES2 wrapper
The GLES2 wrapper no longer needs to generate any fragment shader state because the GLSL pipeline backend will always give the wrapper a custom fragment shader. This simplifies a lot of the state comparison done by the wrapper. The fog generation is also removed even though it's actually part of the vertex shader because only the fixed function pipeline backend actually calls the fog functions so it would be disabled when using any of the other backends anyway. We can fix this when the two shader backends also start generating vertex shaders.
Diffstat (limited to 'cogl/cogl-pipeline-opengl.c')
-rw-r--r--cogl/cogl-pipeline-opengl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cogl/cogl-pipeline-opengl.c b/cogl/cogl-pipeline-opengl.c
index 39db8d7c..39f7ec82 100644
--- a/cogl/cogl-pipeline-opengl.c
+++ b/cogl/cogl-pipeline-opengl.c
@@ -521,6 +521,9 @@ _cogl_pipeline_flush_color_blend_alpha_depth_state (
blend_state->blend_dst_factor_rgb));
}
+ /* Under GLES2 the alpha function is implemented as part of the
+ fragment shader */
+#ifndef HAVE_COGL_GLES2
if (pipelines_difference & (COGL_PIPELINE_STATE_ALPHA_FUNC |
COGL_PIPELINE_STATE_ALPHA_FUNC_REFERENCE))
{
@@ -533,6 +536,7 @@ _cogl_pipeline_flush_color_blend_alpha_depth_state (
GE (glAlphaFunc (alpha_state->alpha_func,
alpha_state->alpha_func_reference));
}
+#endif /* HAVE_COGL_GLES2 */
if (pipelines_difference & COGL_PIPELINE_STATE_DEPTH)
{
@@ -738,6 +742,9 @@ flush_layers_common_gl_state_cb (CoglPipelineLayer *layer, void *user_data)
_cogl_matrix_stack_flush_to_gl (unit->matrix_stack, COGL_MATRIX_TEXTURE);
}
+ /* Under GLES2 the fragment shader will use gl_PointCoord instead of
+ replacing the texture coordinates */
+#ifndef HAVE_COGL_GLES2
if (layers_difference & COGL_PIPELINE_LAYER_STATE_POINT_SPRITE_COORDS)
{
CoglPipelineState change = COGL_PIPELINE_LAYER_STATE_POINT_SPRITE_COORDS;
@@ -750,6 +757,7 @@ flush_layers_common_gl_state_cb (CoglPipelineLayer *layer, void *user_data)
GE (glTexEnvi (GL_POINT_SPRITE, GL_COORD_REPLACE,
big_state->point_sprite_coords));
}
+#endif /* HAVE_COGL_GLES2 */
cogl_handle_ref (layer);
if (unit->layer != COGL_INVALID_HANDLE)