diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-16 15:47:13 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-18 22:30:10 +0300 |
commit | a1459b2f7a53fc9e7a52260e975c47c48c6c383d (patch) | |
tree | 2a6c612d8efd0fa3240a7618b66490b8be1b8bbd /source/blender/editors/sculpt_paint/paint_cursor.c | |
parent | 2ae1c895a2f7590d0783a27176085da45ef12bc5 (diff) |
Cleanup: GPU: Move towards an explicit Blend state
This make use of the GLStateStack functions for:
- `GPU_blend()`
- `GPU_blend_set_func()`
- `GPU_blend_set_func_separate()`
The goal is to unify them using an explicit state setting.
This will remove the need to use obscure blend functions
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_cursor.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_cursor.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index 63b4516b1cc..0c5e4ea9538 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -634,8 +634,8 @@ static bool paint_draw_tex_overlay(UnifiedPaintSettings *ups, uint texCoord = GPU_vertformat_attr_add(format, "texCoord", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); /* Premultiplied alpha blending. */ - GPU_blend_set_func(GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); GPU_blend(true); + GPU_blend_set_func(GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_COLOR); @@ -670,8 +670,6 @@ static bool paint_draw_tex_overlay(UnifiedPaintSettings *ups, GPU_texture_unbind(texture); - GPU_blend_set_func(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA); - if (ELEM(mtex->brush_map_mode, MTEX_MAP_MODE_STENCIL, MTEX_MAP_MODE_VIEW)) { GPU_matrix_pop(); } @@ -729,8 +727,8 @@ static bool paint_draw_cursor_overlay( uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); uint texCoord = GPU_vertformat_attr_add(format, "texCoord", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); - GPU_blend_set_func(GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); GPU_blend(true); + GPU_blend_set_func(GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_COLOR); @@ -757,8 +755,6 @@ static bool paint_draw_cursor_overlay( immUnbindProgram(); - GPU_blend_set_func(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA); - if (do_pop) { GPU_matrix_pop(); } |