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
path: root/source
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2015-07-28 19:23:59 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-07-28 19:24:21 +0300
commit79a51f0839cab9e166a9fc4a0f6ea794cea4db03 (patch)
tree7a86f51c823c2a5557ada55c2027c762416ebd5e /source
parent1e6e3dcbd7cd4bc0148062e15229cd284cb30f7d (diff)
cdderivedmesh: don't prepare a normal buffer when selecting, even
if we skip creating the selection color layer.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c42
1 files changed, 22 insertions, 20 deletions
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 5945a342738..6a766037c8b 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -652,31 +652,33 @@ static void cdDM_drawMappedFaces(
totpoly = dm->getNumPolys(dm);
/* if we do selection, fill the selection buffer color */
- if ((G.f & G_BACKBUFSEL) && !(flag & DM_DRAW_SKIP_SELECT)) {
- Mesh *me = userData;
- unsigned int *fi_map;
+ if (G.f & G_BACKBUFSEL) {
+ if (!(flag & DM_DRAW_SKIP_SELECT)) {
+ Mesh *me = userData;
+ unsigned int *fi_map;
- findex_buffer = GPU_buffer_alloc(dm->drawObject->tot_loop_verts * sizeof(int), false);
- fi_map = GPU_buffer_lock(findex_buffer, GPU_BINDING_ARRAY);
+ findex_buffer = GPU_buffer_alloc(dm->drawObject->tot_loop_verts * sizeof(int), false);
+ fi_map = GPU_buffer_lock(findex_buffer, GPU_BINDING_ARRAY);
- if (fi_map) {
- for (i = 0; i < totpoly; i++, mpoly++) {
- int selcol = 0xFFFFFFFF;
- const int orig = (index_mp_to_orig) ? index_mp_to_orig[i] : i;
+ if (fi_map) {
+ for (i = 0; i < totpoly; i++, mpoly++) {
+ int selcol = 0xFFFFFFFF;
+ const int orig = (index_mp_to_orig) ? index_mp_to_orig[i] : i;
- if ((orig != ORIGINDEX_NONE) && (!useHide || !(me->mpoly[orig].flag & ME_HIDE))) {
- WM_framebuffer_index_get(orig + 1, &selcol);
- }
+ if ((orig != ORIGINDEX_NONE) && (!useHide || !(me->mpoly[orig].flag & ME_HIDE))) {
+ WM_framebuffer_index_get(orig + 1, &selcol);
+ }
- for (j = 0; j < mpoly->totloop; j++)
- fi_map[start_element++] = selcol;
- }
+ for (j = 0; j < mpoly->totloop; j++)
+ fi_map[start_element++] = selcol;
+ }
- start_element = 0;
- mpoly = cddm->mpoly;
+ start_element = 0;
+ mpoly = cddm->mpoly;
- GPU_buffer_unlock(findex_buffer, GPU_BINDING_ARRAY);
- GPU_buffer_bind_as_color(findex_buffer);
+ GPU_buffer_unlock(findex_buffer, GPU_BINDING_ARRAY);
+ GPU_buffer_bind_as_color(findex_buffer);
+ }
}
}
else {
@@ -792,7 +794,7 @@ static void cdDM_drawMappedFaces(
GPU_buffers_unbind();
- if (G.f & G_BACKBUFSEL)
+ if (findex_buffer)
GPU_buffer_free(findex_buffer);
}