diff options
author | Falk David <falkdavid@gmx.de> | 2021-01-04 17:31:53 +0300 |
---|---|---|
committer | Falk David <falkdavid@gmx.de> | 2021-01-04 17:34:02 +0300 |
commit | 09c1cb8a17e4c1a0aeea0d5477ec2db61390a5e8 (patch) | |
tree | 375c360ff15a6d346f337edee0492501c0f659b9 /source/blender/draw/intern/draw_cache_impl_gpencil.c | |
parent | c6e5b3f42dfc05e911ef30df12821138e1225e91 (diff) |
Fix T84260: NURBS edit mode lines not showing
When in edit mode, the edit lines for de-selected surfaces did not
show up.
The bug was caused by the is_gpencil bool which reused another flag.
Both grease pencil and nurbs surfaces use the edit_curve_handle shader.
A dedicated flag was added to make sure the is_gpencil bool is
set correctly.
Reviewed By: fclem
Maniphest Tasks: T84260
Differential Revision: https://developer.blender.org/D9985
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_gpencil.c')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_gpencil.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_gpencil.c b/source/blender/draw/intern/draw_cache_impl_gpencil.c index 4e809ad45fe..b1814d54353 100644 --- a/source/blender/draw/intern/draw_cache_impl_gpencil.c +++ b/source/blender/draw/intern/draw_cache_impl_gpencil.c @@ -211,7 +211,7 @@ static GPUVertFormat *gpencil_edit_stroke_format(void) /* MUST match the format below. */ typedef struct gpEditCurveVert { float pos[3]; - int data; + uint32_t data; } gpEditCurveVert; static GPUVertFormat *gpencil_edit_curve_format(void) @@ -220,7 +220,7 @@ static GPUVertFormat *gpencil_edit_curve_format(void) if (format.attr_len == 0) { /* initialize vertex formats */ GPU_vertformat_attr_add(&format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT); - GPU_vertformat_attr_add(&format, "data", GPU_COMP_U8, 1, GPU_FETCH_INT); + GPU_vertformat_attr_add(&format, "data", GPU_COMP_U32, 1, GPU_FETCH_INT); } return &format; } @@ -754,17 +754,16 @@ static void gpencil_edit_curve_stroke_count_cb(bGPDlayer *gpl, iter->curve_len += gps->editcurve->tot_curve_points * 4; } -static char gpencil_beztriple_vflag_get(char flag, +static uint32_t gpencil_beztriple_vflag_get(char flag, char col_id, bool handle_point, const bool handle_selected) { - char vflag = 0; + uint32_t vflag = 0; SET_FLAG_FROM_TEST(vflag, (flag & SELECT), VFLAG_VERT_SELECTED); SET_FLAG_FROM_TEST(vflag, handle_point, BEZIER_HANDLE); SET_FLAG_FROM_TEST(vflag, handle_selected, VFLAG_VERT_SELECTED_BEZT_HANDLE); - /* Reuse flag of Freestyle to indicate is GPencil data. */ - vflag |= VFLAG_EDGE_FREESTYLE; + vflag |= VFLAG_VERT_GPENCIL_BEZT_HANDLE; /* Handle color id. */ vflag |= col_id << COLOR_SHIFT; @@ -794,7 +793,7 @@ static void gpencil_edit_curve_stroke_iter_cb(bGPDlayer *gpl, for (int i = 0; i < editcurve->tot_curve_points; i++) { BezTriple *bezt = &editcurve->curve_points[i].bezt; const bool handle_selected = BEZT_ISSEL_ANY(bezt); - const char vflag[3] = { + const uint32_t vflag[3] = { gpencil_beztriple_vflag_get(bezt->f1, bezt->h1, true, handle_selected), gpencil_beztriple_vflag_get(bezt->f2, bezt->h1, hide, handle_selected), gpencil_beztriple_vflag_get(bezt->f3, bezt->h2, true, handle_selected), |