diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-17 00:20:59 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-18 22:30:10 +0300 |
commit | d10f000322914edf83ace36ee2abb2479c2b533b (patch) | |
tree | b33d453cf2e1c5364cea88998103a7008ab31763 /source/blender/editors | |
parent | f30df15edc0b5bfce98809cfa8c2ca96cfe03e97 (diff) |
GPUState: Remove gpuPushAttr/gpuPopAttr
And use manual save/restore mechanism.
The stack method is not used so much to be considered useful.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_cursor.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_draw.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index 4115b5e51d6..0e38340d3bc 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -775,7 +775,8 @@ static bool paint_draw_alpha_overlay(UnifiedPaintSettings *ups, bool alpha_overlay_active = false; ePaintOverlayControlFlags flags = BKE_paint_get_overlay_flags(); - gpuPushAttr(GPU_DEPTH_BUFFER_BIT | GPU_BLEND_BIT); + eGPUBlend blend_state = GPU_blend_get(); + bool depth_test = GPU_depth_test_enabled(); /* Translate to region. */ GPU_matrix_push(); @@ -805,7 +806,8 @@ static bool paint_draw_alpha_overlay(UnifiedPaintSettings *ups, } GPU_matrix_pop(); - gpuPopAttr(); + GPU_blend(blend_state); + GPU_depth_test(depth_test); return alpha_overlay_active; } diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 5553928b012..696fe666f41 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -835,7 +835,7 @@ void ED_node_socket_draw(bNodeSocket *sock, const rcti *rect, const float color[ uint outline_col_id = GPU_vertformat_attr_add( format, "outlineColor", GPU_COMP_F32, 4, GPU_FETCH_FLOAT); - gpuPushAttr(GPU_BLEND_BIT); + eGPUBlend state = GPU_blend_get(); GPU_blend(GPU_BLEND_ALPHA); GPU_program_point_size(true); @@ -860,7 +860,9 @@ void ED_node_socket_draw(bNodeSocket *sock, const rcti *rect, const float color[ immUnbindProgram(); GPU_program_point_size(false); - gpuPopAttr(); + + /* Restore. */ + GPU_blend(state); } /* ************** Socket callbacks *********** */ |