diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-05-31 19:34:56 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-05-31 20:09:20 +0300 |
commit | f43e3d0b6bee3bef69649e4ebb85bdebdf19e8ce (patch) | |
tree | 4893b5c74ec48193ca9e61374e83e2fa2c247aec /source | |
parent | 494470ba232dafaaff771ac90f773c6771375b50 (diff) |
DRW: Fix DRW_shgroup_call_procedural_* vertex count.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/intern/draw_manager.h | 2 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager_data.c | 8 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager_exec.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/draw/intern/draw_manager.h b/source/blender/draw/intern/draw_manager.h index 9faab2cc2b0..ff4f6d25810 100644 --- a/source/blender/draw/intern/draw_manager.h +++ b/source/blender/draw/intern/draw_manager.h @@ -149,7 +149,7 @@ typedef struct DRWCall { void *user_data; } generate; struct { /* type == DRW_CALL_PROCEDURAL */ - unsigned int prim_count; + uint vert_count; Gwn_PrimType prim_type; } procedural; }; diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c index 054db5968cc..25d720abc71 100644 --- a/source/blender/draw/intern/draw_manager_data.c +++ b/source/blender/draw/intern/draw_manager_data.c @@ -367,7 +367,7 @@ void DRW_shgroup_call_add(DRWShadingGroup *shgroup, Gwn_Batch *geom, float (*obm } static void drw_shgroup_call_procedural_add_ex( - DRWShadingGroup *shgroup, Gwn_PrimType prim_type, uint prim_count, float (*obmat)[4]) + DRWShadingGroup *shgroup, Gwn_PrimType prim_type, uint vert_count, float (*obmat)[4]) { BLI_assert(ELEM(shgroup->type, DRW_SHG_NORMAL, DRW_SHG_FEEDBACK_TRANSFORM)); @@ -375,7 +375,7 @@ static void drw_shgroup_call_procedural_add_ex( call->state = drw_call_state_create(shgroup, obmat, NULL); call->type = DRW_CALL_PROCEDURAL; call->procedural.prim_type = prim_type; - call->procedural.prim_count = prim_count; + call->procedural.vert_count = vert_count; #ifdef USE_GPU_SELECT call->select_id = DST.select_id; #endif @@ -390,12 +390,12 @@ void DRW_shgroup_call_procedural_points_add(DRWShadingGroup *shgroup, uint point void DRW_shgroup_call_procedural_lines_add(DRWShadingGroup *shgroup, uint line_count, float (*obmat)[4]) { - drw_shgroup_call_procedural_add_ex(shgroup, GWN_PRIM_LINES, line_count, obmat); + drw_shgroup_call_procedural_add_ex(shgroup, GWN_PRIM_LINES, line_count * 2, obmat); } void DRW_shgroup_call_procedural_triangles_add(DRWShadingGroup *shgroup, uint tria_count, float (*obmat)[4]) { - drw_shgroup_call_procedural_add_ex(shgroup, GWN_PRIM_TRIS, tria_count, obmat); + drw_shgroup_call_procedural_add_ex(shgroup, GWN_PRIM_TRIS, tria_count * 3, obmat); } diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index 94250920c57..9fd0435aa78 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -1157,7 +1157,7 @@ static void draw_shgroup(DRWShadingGroup *shgroup, DRWState pass_state) call->generate.geometry_fn(shgroup, draw_geometry_execute, call->generate.user_data); break; case DRW_CALL_PROCEDURAL: - GWN_draw_primitive(call->procedural.prim_type, call->procedural.prim_count); + GWN_draw_primitive(call->procedural.prim_type, call->procedural.vert_count); break; default: BLI_assert(0); |