I changed link to this:

template link (alias variable)
{
        const string link ()
        {
                const string name = __traits (identifier, variable);
                return name~`= glGetUniformLocation (program, "`~name~`");`;
        }
}

but the results are the same - however
I've realized that the first mixin doesn't necessarily work - I think what is actually happening is that, since the variables never get written to, they retain their initial values, and this corresponds to the first uniform location in the shader, and so this location receives the variable when I upload the uniforms. (But then I would expect the last uniform I sent to assume the color but this isn't what happens, so I'm not sure).

Reply via email to