Antialiased lines with correct destination alpha

I’m rendering in to a texture. I have some background colours, and the drawing some antialiased lines over the top. Problem is, when I draw the antialiased line, the pixels that are blended end up blending the alpha channel as well.

Ideally, I need to somehow seperate the blending of the alpha channel, so the colours can be blended using


But the alpha channel needs


Is there away to do this?

Alternatively, I would settile for some way to disable writing to the alpha channel temporarily, so it can just remain at the original block-colour alpha, but that’s not ideal - eventually, I might like to have antialiased lines drawn over transparent sections of the texture.

Any thoughts?

Something like blend_func_separate ?

Aha! Perfect, thank you very much. It works great now!