When using the texture combine constant differently in separate RGB and alpha blend strings, the arbfp fragment backend creates a shader that uses two different local shader parameters, but only assigns an actual value to one of them. This patch changes this behaviour so that only one local parameter index is used for the texture combine constant, which is guaranteed to be the same in both instances.
The undesired behaviour can be triggered by setting a blend string like
"RGB = MODULATE (PRIMARY, CONSTANT[A]) A = REPLACE (CONSTANT)" with cogl_pipeline_set_layer_combine on layer 0. In this specific instance, the RGB blend string does not receive a value for CONSTANT[A], making it so it is 0 and the RGB values are always modulated to 0 regardless of the value of PRIMARY.
This passes the conformance tests in the tests directory. I wasn't sure exactly which branch I should make the target of my merge request, as the master branch doesn't seem to work correctly on my machine. I apologize if I made the wrong choice in choosing the cogl-1.22 branch.
I apologize for any mistakes I made in contributing. If there is anything I can improve on, I would greatly appreciate knowing.
Thank you for taking the time to read this.
Signed-off-by: George Matsumura email@example.com