Implement glBlend
Created by: PabloPL
Findings about blending:
It looks like binary driver is generating the same alpha_blend value (in render_state) when:
- only glEnable(GL_BLEND) is called
- no glEnable(GL_BLEND) is called (so blending is disabled)
Generated value (0xfc3b1ad2) is calculated from
blend_enable = 1
rgb_func = 0 // GL_FUNC_ADD
rgb_src_factor = 1 // GL_ONE
rgb_dst_factor = 17 // GL_ZERO
alpha_func = 0 // GL_FUNC_ADD
alpha_src_factor = 1 // GL_ONE
alpha_dst_factor = 17 // GL_ZERO
Mesa is behaving little different:
- when only glEnable(GL_BLEND) is called, it's calculating the same value as binary driver
- when blending is disabled, it's setting all func/factor as 0 (so is calculating different value as binary driver)
do we need to check if blend enabled to setup these fields?
Test showed that blend_color is independ from blend_enable, so we can allways set blend_color_bg/blend_color_ra.