Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-05-04 22:17:31 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-05-04 22:17:31 +0300
commit4bd2429f3519a58ccd1f93200dae42e52c45956e (patch)
tree90370ccbb2029ae2850fcc09bfbb43167a76e2cc /source/blender/editors/space_view3d
parent9869436b89449a346fac07ca8061221ce8d4ce7e (diff)
Use mesh draw cache for back-buffer selection
Vertex/weight paint now work with core profile, resolves T51380.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/drawobject.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 254a48fccbb..63b44e6daa3 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -9542,8 +9542,9 @@ static void bbs_mesh_solid_verts(Scene *scene, Object *ob)
static void bbs_mesh_solid_faces(Scene *scene, Object *ob)
{
- DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask);
Mesh *me = ob->data;
+#if defined(WITH_LEGACY_OPENGL)
+ DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask);
DM_update_materials(dm, ob);
@@ -9553,6 +9554,19 @@ static void bbs_mesh_solid_faces(Scene *scene, Object *ob)
dm->drawMappedFaces(dm, bbs_mesh_solid__setDrawOpts, NULL, NULL, me, 0);
dm->release(dm);
+#else
+ UNUSED_VARS(scene, bbs_mesh_solid_hide__setDrawOpts, bbs_mesh_solid__setDrawOpts);
+ Batch *batch;
+ if ((me->editflag & ME_EDIT_PAINT_FACE_SEL)) {
+ batch = DRW_mesh_batch_cache_get_triangles_with_select_id(me, true);
+ }
+ else {
+ batch = DRW_mesh_batch_cache_get_triangles_with_select_id(me, false);
+ }
+ Batch_set_builtin_program(batch, GPU_SHADER_3D_FLAT_COLOR_U32);
+ Batch_draw(batch);
+
+#endif
}
void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob)