diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-05-28 18:18:39 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-28 18:19:42 +0300 |
commit | c4e4b6872a918e8e58ff2d01306f96a17c65b9f5 (patch) | |
tree | 057f31d4ebf827056e5f886185cf669d88ee77f8 /source | |
parent | 9e85d4052fbc19d9244862d5858147e0d1ba83c3 (diff) |
DRW: Fix issue introduce in removal of DRW_STATE_POINT
Fix issue raised by mano-wii in rB97d22e12b521
Fix T65050 knife tool snapping indicator not visible
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/intern/DRW_render.h | 2 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager_data.c | 4 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager_exec.c | 14 |
3 files changed, 17 insertions, 3 deletions
diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h index 09144e0ceeb..406635297ab 100644 --- a/source/blender/draw/intern/DRW_render.h +++ b/source/blender/draw/intern/DRW_render.h @@ -350,6 +350,8 @@ typedef enum { DRW_STATE_CLIP_PLANES = (1 << 22), DRW_STATE_WIRE_SMOOTH = (1 << 23), DRW_STATE_FIRST_VERTEX_CONVENTION = (1 << 24), + /** DO NOT USE. Assumed always enabled. Only used internally. */ + DRW_STATE_PROGRAM_POINT_SIZE = (1 << 25), } DRWState; #define DRW_STATE_DEFAULT \ diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c index c3b905323cc..5674ebd3a60 100644 --- a/source/blender/draw/intern/draw_manager_data.c +++ b/source/blender/draw/intern/draw_manager_data.c @@ -1541,7 +1541,7 @@ void DRW_view_persmat_get(const DRWView *view, float mat[4][4], bool inverse) DRWPass *DRW_pass_create(const char *name, DRWState state) { DRWPass *pass = BLI_memblock_alloc(DST.vmempool->passes); - pass->state = state; + pass->state = state | DRW_STATE_PROGRAM_POINT_SIZE; if (((G.debug_value > 20) && (G.debug_value < 30)) || (G.debug & G_DEBUG)) { BLI_strncpy(pass->name, name, MAX_PASS_NAME); } @@ -1564,7 +1564,7 @@ bool DRW_pass_is_empty(DRWPass *pass) void DRW_pass_state_set(DRWPass *pass, DRWState state) { - pass->state = state; + pass->state = state | DRW_STATE_PROGRAM_POINT_SIZE; } void DRW_pass_state_add(DRWPass *pass, DRWState state) diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index ae0239a7e49..85490e2f81d 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -251,6 +251,19 @@ void drw_state_set(DRWState state) } } + /* Program Points Size */ + { + int test; + if ((test = CHANGED_TO(DRW_STATE_PROGRAM_POINT_SIZE))) { + if (test == 1) { + GPU_program_point_size(true); + } + else { + GPU_program_point_size(false); + } + } + } + /* Stencil */ { DRWState test; @@ -355,7 +368,6 @@ void DRW_state_reset(void) DRW_state_reset_ex(DRW_STATE_DEFAULT); GPU_point_size(5); - GPU_program_point_size(true); /* Reset blending function */ glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); |