Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_cache_impl_mesh.c
| Show First 20 Lines • Show All 726 Lines • ▼ Show 20 Lines | |||||
| GPUBatch *DRW_mesh_batch_cache_get_loose_edges(Mesh *me) | GPUBatch *DRW_mesh_batch_cache_get_loose_edges(Mesh *me) | ||||
| { | { | ||||
| MeshBatchCache *cache = mesh_batch_cache_get(me); | MeshBatchCache *cache = mesh_batch_cache_get(me); | ||||
| mesh_batch_cache_add_request(cache, MBC_LOOSE_EDGES); | mesh_batch_cache_add_request(cache, MBC_LOOSE_EDGES); | ||||
| if (cache->no_loose_wire) { | if (cache->no_loose_wire) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| else { | else { | ||||
| /* `ibo.lines` only contains loose lines when created for `batch.loose_edges`. It can be the | |||||
| * case that the current `ibo.lines` contains all lines of the mesh. Just to be safe we | |||||
| * discard the `ibo.lines`. */ | |||||
| if (cache->batch.loose_edges == NULL) { | |||||
| GPU_INDEXBUF_DISCARD_SAFE(cache->final.ibo.lines); | |||||
| } | |||||
| return DRW_batch_request(&cache->batch.loose_edges); | return DRW_batch_request(&cache->batch.loose_edges); | ||||
| } | } | ||||
| } | } | ||||
| GPUBatch *DRW_mesh_batch_cache_get_surface_weights(Mesh *me) | GPUBatch *DRW_mesh_batch_cache_get_surface_weights(Mesh *me) | ||||
| { | { | ||||
| MeshBatchCache *cache = mesh_batch_cache_get(me); | MeshBatchCache *cache = mesh_batch_cache_get(me); | ||||
| mesh_batch_cache_add_request(cache, MBC_SURFACE_WEIGHTS); | mesh_batch_cache_add_request(cache, MBC_SURFACE_WEIGHTS); | ||||
| ▲ Show 20 Lines • Show All 697 Lines • Show Last 20 Lines | |||||