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:
authorAntony Riakiotakis <kalast@gmail.com>2014-04-09 05:03:25 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-04-09 05:03:44 +0400
commitb5d3f183b0fd6f72d84fbcdd594f80e70422eb24 (patch)
treec3a2d297f165c45d63d21a790bc9632264e3d341 /source/blender/editors
parent6ffabfae852f956f5074ddb75e94a4f6fb846d1d (diff)
Add material storage to derivedmesh.
The variables are considered invalid unless DM_update_materials is called prior to use. Only use case currently is mesh drawing. This helps with excessive allocation on the stack during GPUObject creation, but may help elsewhere in the future as well.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_view3d/drawobject.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 61866b60a8c..e7f94485664 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -3419,6 +3419,8 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
if (!dm)
return;
+ DM_update_materials(dm, ob);
+
/* Check to draw dynamic paint colors (or weights from WeightVG modifiers).
* Note: Last "preview-active" modifier in stack will win! */
if (DM_get_tessface_data_layer(dm, CD_PREVIEW_MCOL) && modifiers_isPreview(ob))
@@ -3707,6 +3709,9 @@ static bool draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3
cageDM = editbmesh_get_derived_cage_and_final(scene, ob, em, &finalDM,
scene->customdata_mask);
+ DM_update_materials(finalDM, ob);
+ DM_update_materials(cageDM, ob);
+
if (dt > OB_WIRE) {
const bool glsl = draw_glsl_material(scene, ob, v3d, dt);