diff options
author | Emmanuele Bassi <ebassi@linux.intel.com> | 2010-08-12 17:06:29 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@linux.intel.com> | 2010-08-12 17:08:26 +0100 |
commit | daf6e739364282b77a66d7bf8abb4e90ada8c865 (patch) | |
tree | e642e801462b8284b799c58fb718b9e326b4e80b /clutter/clutter-shader-effect.c | |
parent | e016a62ab03e2d1683cc4d100ac6079fe7863788 (diff) | |
download | clutter-daf6e739364282b77a66d7bf8abb4e90ada8c865.tar.gz |
Remove last uses of cogl_program_uniform*
Following the commits:
c03544da - clutter-shader: use cogl_program_set_uniform_xyz API
a26119b5 - tests: Remove use of cogl_program_use
Remove the users of cogl_program_uniform_* and cogl_program_use() in the
shader-based effects.
Diffstat (limited to 'clutter/clutter-shader-effect.c')
-rw-r--r-- | clutter/clutter-shader-effect.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/clutter/clutter-shader-effect.c b/clutter/clutter-shader-effect.c index fa8b6f564..8b0de595c 100644 --- a/clutter/clutter-shader-effect.c +++ b/clutter/clutter-shader-effect.c @@ -211,13 +211,11 @@ clutter_shader_effect_update_uniforms (ClutterShaderEffect *effect) gpointer key, value; gsize size; - if (priv->uniforms == NULL) + if (priv->program == COGL_INVALID_HANDLE) return; - /* XXX - we need to do this dance here because the cogl_program_uniform* - * family of functions do not take the program as a parameter - */ - cogl_program_use (priv->program); + if (priv->uniforms == NULL) + return; key = value = NULL; g_hash_table_iter_init (&iter, priv->uniforms); @@ -234,41 +232,50 @@ clutter_shader_effect_update_uniforms (ClutterShaderEffect *effect) const GLfloat *floats; floats = clutter_value_get_shader_float (&uniform->value, &size); - cogl_program_uniform_float (uniform->location, size, 1, floats); + cogl_program_set_uniform_float (priv->program, uniform->location, + size, 1, + floats); } else if (CLUTTER_VALUE_HOLDS_SHADER_INT (&uniform->value)) { const GLint *ints; ints = clutter_value_get_shader_int (&uniform->value, &size); - cogl_program_uniform_int (uniform->location, size, 1, ints); + cogl_program_set_uniform_int (priv->program, uniform->location, + size, 1, + ints); } else if (CLUTTER_VALUE_HOLDS_SHADER_MATRIX (&uniform->value)) { const GLfloat *matrix; matrix = clutter_value_get_shader_matrix (&uniform->value, &size); - cogl_program_uniform_matrix (uniform->location, size, 1, FALSE, matrix); + cogl_program_set_uniform_matrix (priv->program, uniform->location, + size, 1, + FALSE, + matrix); } else if (G_VALUE_HOLDS_FLOAT (&uniform->value)) { const GLfloat float_val = g_value_get_float (&uniform->value); - cogl_program_uniform_float (uniform->location, 1, 1, &float_val); + cogl_program_set_uniform_float (priv->program, uniform->location, + 1, 1, + &float_val); } else if (G_VALUE_HOLDS_INT (&uniform->value)) { const GLint int_val = g_value_get_int (&uniform->value); - cogl_program_uniform_int (uniform->location, 1, 1, &int_val); + cogl_program_set_uniform_int (priv->program, uniform->location, + 1, 1, + &int_val); } else g_warning ("Invalid uniform of type '%s' for name '%s'", g_type_name (G_VALUE_TYPE (&uniform->value)), uniform->name); } - - cogl_program_use (COGL_INVALID_HANDLE); } static void |