cogl-pipeline: Fix the enum names for the constant combine source

When determining whether to hash the combine constant Cogl checks the
arguments to the combine funcs to determine whether the combine
constant is used. However is was using the GLenums GL_CONSTANT_COLOR
and GL_CONSTANT_ALPHA but these are not valid values for the
CoglPipelineCombineSource enum so presumably the constant would never
get hashed. This patch makes it use Cogl's enum of
COGL_PIPELINE_COMBINE_SOURCE_CONSTANT instead.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2516
This commit is contained in:
Neil Roberts 2011-01-17 12:06:13 +00:00
parent 0c070cdf91
commit 568d32acf3

View File

@ -5987,11 +5987,11 @@ _cogl_pipeline_layer_hash_combine_constant_state (CoglPipelineLayer *authority,
n_args = _cogl_get_n_args_for_combine_func (b->texture_combine_rgb_func);
for (i = 0; i < n_args; i++)
{
if (b->texture_combine_rgb_src[i] == GL_CONSTANT_COLOR ||
b->texture_combine_rgb_src[i] == GL_CONSTANT_ALPHA)
if (b->texture_combine_rgb_src[i] ==
COGL_PIPELINE_COMBINE_SOURCE_CONSTANT)
{
/* XXX: should we be careful to only hash the alpha
* component in the GL_CONSTANT_ALPHA case? */
* component in the COGL_PIPELINE_COMBINE_OP_SRC_ALPHA case? */
need_hash = TRUE;
goto done;
}
@ -6000,11 +6000,11 @@ _cogl_pipeline_layer_hash_combine_constant_state (CoglPipelineLayer *authority,
n_args = _cogl_get_n_args_for_combine_func (b->texture_combine_alpha_func);
for (i = 0; i < n_args; i++)
{
if (b->texture_combine_alpha_src[i] == GL_CONSTANT_COLOR ||
b->texture_combine_alpha_src[i] == GL_CONSTANT_ALPHA)
if (b->texture_combine_alpha_src[i] ==
COGL_PIPELINE_COMBINE_SOURCE_CONSTANT)
{
/* XXX: should we be careful to only hash the alpha
* component in the GL_CONSTANT_ALPHA case? */
* component in the COGL_PIPELINE_COMBINE_OP_SRC_ALPHA case? */
need_hash = TRUE;
goto done;
}