diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-05-17 15:04:30 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-17 19:17:23 +0300 |
commit | 97d22e12b521a04e1d8809704bfeae8d526b24a8 (patch) | |
tree | eb26a45b4afccf8ed3e353167e328c2ebc743da5 /source/blender/draw/intern/draw_manager_exec.c | |
parent | 02319549c3061562349cf8ed98b3d77b88804824 (diff) |
Cleanup: DRW: Remove uneeded DRWState values
This removes:
- DRW_STATE_TRANS_FEEDBACK
- DRW_STATE_WIRE
- DRW_STATE_POINT
Diffstat (limited to 'source/blender/draw/intern/draw_manager_exec.c')
-rw-r--r-- | source/blender/draw/intern/draw_manager_exec.c | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index bb4e807bb2d..2c29ce343dd 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -168,18 +168,11 @@ void drw_state_set(DRWState state) /* Wire Width */ { int test; - if (CHANGED_ANY_STORE_VAR(DRW_STATE_WIRE | DRW_STATE_WIRE_WIDE | DRW_STATE_WIRE_SMOOTH, - test)) { - if (test & DRW_STATE_WIRE_WIDE) { - GPU_line_width(3.0f); - } - else if (test & DRW_STATE_WIRE_SMOOTH) { + if ((test = CHANGED_TO(DRW_STATE_WIRE_SMOOTH))) { + if (test == 1) { GPU_line_width(2.0f); GPU_line_smooth(true); } - else if (test & DRW_STATE_WIRE) { - GPU_line_width(1.0f); - } else { GPU_line_width(1.0f); GPU_line_smooth(false); @@ -187,20 +180,6 @@ void drw_state_set(DRWState state) } } - /* Points Size */ - { - int test; - if ((test = CHANGED_TO(DRW_STATE_POINT))) { - if (test == 1) { - GPU_enable_program_point_size(); - glPointSize(5.0f); - } - else { - GPU_disable_program_point_size(); - } - } - } - /* Blending (all buffer) */ { int test; @@ -401,6 +380,9 @@ void DRW_state_reset(void) { DRW_state_reset_ex(DRW_STATE_DEFAULT); + GPU_point_size(5); + GPU_enable_program_point_size(); + /* Reset blending function */ glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); } @@ -689,8 +671,8 @@ bool DRW_culling_sphere_test(BoundSphere *bsphere) /* TODO we could test against the inscribed sphere of the frustum to early out positively. */ /* Test against the 6 frustum planes. */ - /* TODO order planes with sides first then far then near clip. Should be better culling heuristic - * when sculpting. */ + /* TODO order planes with sides first then far then near clip. Should be better culling + * heuristic when sculpting. */ for (int p = 0; p < 6; p++) { float dist = plane_point_side_v3(DST.clipping.frustum_planes[p], bsphere->center); if (dist < -bsphere->radius) { @@ -1101,7 +1083,7 @@ static void draw_shgroup(DRWShadingGroup *shgroup, DRWState pass_state) DST.shader = shgroup->shader; } - if ((pass_state & DRW_STATE_TRANS_FEEDBACK) != 0 && (shgroup->tfeedback_target != NULL)) { + if (shgroup->tfeedback_target != NULL) { use_tfeedback = GPU_shader_transform_feedback_enable(shgroup->shader, shgroup->tfeedback_target->vbo_id); } |