diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-05-08 13:00:50 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-08 18:52:48 +0300 |
commit | bb4b6cddcb89fb64479c6a246565b34ad0b74d82 (patch) | |
tree | 7e177fc5e429857aa69395507f3f79610bf3d3e1 /source | |
parent | 7bfe70f2ba09f6311cb4f1170398d522480bb274 (diff) |
Mesh Batch Cache: Speedup: Only alloc gpu_attrs if needed and don't clear
No need to clear since GPU_material_vertex_attrs is overriding
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_mesh.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c index 02ebe16fb37..f3db1467883 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.c +++ b/source/blender/draw/intern/draw_cache_impl_mesh.c @@ -423,13 +423,13 @@ static DRW_MeshCDMask mesh_cd_calc_used_gpu_layers(const Mesh *me, const CustomData *cd_ldata = (me->edit_mesh) ? &me->edit_mesh->bm->ldata : &me->ldata; /* See: DM_vertex_attributes_from_gpu for similar logic */ - GPUVertAttrLayers gpu_attrs = {{{0}}}; DRW_MeshCDMask cd_used; mesh_cd_layers_type_clear(&cd_used); for (int i = 0; i < gpumat_array_len; i++) { GPUMaterial *gpumat = gpumat_array[i]; if (gpumat) { + GPUVertAttrLayers gpu_attrs; GPU_material_vertex_attrs(gpumat, &gpu_attrs); for (int j = 0; j < gpu_attrs.totlayer; j++) { const char *name = gpu_attrs.layer[j].name; |