Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_cache_extract_mesh.c
| Show First 20 Lines • Show All 641 Lines • ▼ Show 20 Lines | static void extract_lines_finish(const MeshRenderData *mr, void *ibo, void *elb) | ||||
| if (mr->use_final_mesh && mr->cache->batch.loose_edges) { | if (mr->use_final_mesh && mr->cache->batch.loose_edges) { | ||||
| BLI_assert(mr->cache->batch.loose_edges->elem == ibo); | BLI_assert(mr->cache->batch.loose_edges->elem == ibo); | ||||
| /* Multiply by 2 because these are edges indices. */ | /* Multiply by 2 because these are edges indices. */ | ||||
| int start = mr->edge_len * 2; | int start = mr->edge_len * 2; | ||||
| int len = mr->edge_loose_len * 2; | int len = mr->edge_loose_len * 2; | ||||
| GPUIndexBuf *sub_ibo = GPU_indexbuf_create_subrange(ibo, start, len); | GPUIndexBuf *sub_ibo = GPU_indexbuf_create_subrange(ibo, start, len); | ||||
| /* WARNING: We modify the GPUBatch here! */ | /* WARNING: We modify the GPUBatch here! */ | ||||
| GPU_batch_elembuf_set(mr->cache->batch.loose_edges, sub_ibo, true); | GPU_batch_elembuf_set(mr->cache->batch.loose_edges, sub_ibo, true); | ||||
| mr->cache->no_loose_wire = (len == 0); | |||||
| } | } | ||||
| } | } | ||||
| static const MeshExtract extract_lines = { | static const MeshExtract extract_lines = { | ||||
| extract_lines_init, | extract_lines_init, | ||||
| NULL, | NULL, | ||||
| NULL, | NULL, | ||||
| extract_lines_loop_bmesh, | extract_lines_loop_bmesh, | ||||
| ▲ Show 20 Lines • Show All 3,823 Lines • Show Last 20 Lines | |||||