diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-03-06 06:07:54 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-03-06 06:07:54 +0300 |
commit | dc9a7f861fa43fecae7450ee254a711b061c0c26 (patch) | |
tree | 8daf4221714c470fa2c999124873566d6d81d06c /source | |
parent | d4e7288af9caec2c5f5a2af758d265663fd75063 (diff) |
Edit Mode overlay: Optimisation
Don't generate more verts than we need if we don't render vertex.
Getting a big boost from 12fps to 20fps on my test scene
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/modes/shaders/edit_overlay_geom_tri.glsl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/draw/modes/shaders/edit_overlay_geom_tri.glsl b/source/blender/draw/modes/shaders/edit_overlay_geom_tri.glsl index 59d7971f944..7d9deeec397 100644 --- a/source/blender/draw/modes/shaders/edit_overlay_geom_tri.glsl +++ b/source/blender/draw/modes/shaders/edit_overlay_geom_tri.glsl @@ -57,8 +57,12 @@ layout(triangles) in; * TODO diagram */ +#ifdef VERTEX_SELECTION layout(triangle_strip, max_vertices=23) out; #else +layout(triangle_strip, max_vertices=17) out; +#endif +#else layout(triangle_strip, max_vertices=3) out; #endif @@ -290,8 +294,10 @@ void main() /* corner vertices should not drax edges but draw point only */ flag[2] = (vData[vbe].x << 8); +#ifdef VERTEX_SELECTION doVertex(vaf, pPos[vaf]); doVertex(vaf, pPos[vaf] + vec4(cornervec[vaf], 0.0, 0.0)); +#endif } /* finish the loop strip */ |