Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_cache_impl_mesh.c
| Show First 20 Lines • Show All 1,919 Lines • ▼ Show 20 Lines | typedef enum DRWBatchFlag { | ||||
| MBC_EDIT_SELECTION_FACES = (1 << 16), | MBC_EDIT_SELECTION_FACES = (1 << 16), | ||||
| MBC_EDIT_SELECTION_FACEDOTS = (1 << 17), | MBC_EDIT_SELECTION_FACEDOTS = (1 << 17), | ||||
| MBC_ALL_VERTS = (1 << 18), | MBC_ALL_VERTS = (1 << 18), | ||||
| MBC_ALL_EDGES = (1 << 19), | MBC_ALL_EDGES = (1 << 19), | ||||
| MBC_LOOSE_EDGES = (1 << 20), | MBC_LOOSE_EDGES = (1 << 20), | ||||
| MBC_EDGE_DETECTION = (1 << 21), | MBC_EDGE_DETECTION = (1 << 21), | ||||
| MBC_WIRE_EDGES = (1 << 22), | MBC_WIRE_EDGES = (1 << 22), | ||||
| MBC_WIRE_LOOPS = (1 << 23), | MBC_WIRE_LOOPS = (1 << 23), | ||||
| MBC_WIRE_LOOPS_UVS = (1 << 24), | MBC_WIRE_LOOPS_TPAINT = (1 << 24), | ||||
| MBC_SURF_PER_MAT = (1 << 25), | MBC_WIRE_LOOPS_UVS = (1 << 25), | ||||
| MBC_SURF_PER_MAT = (1 << 26), | |||||
| } DRWBatchFlag; | } DRWBatchFlag; | ||||
| #define MBC_EDITUV \ | #define MBC_EDITUV \ | ||||
| (MBC_EDITUV_FACES_STRECH_AREA | MBC_EDITUV_FACES_STRECH_ANGLE | MBC_EDITUV_FACES | \ | (MBC_EDITUV_FACES_STRECH_AREA | MBC_EDITUV_FACES_STRECH_ANGLE | MBC_EDITUV_FACES | \ | ||||
| MBC_EDITUV_EDGES | MBC_EDITUV_VERTS | MBC_EDITUV_FACEDOTS) | MBC_EDITUV_EDGES | MBC_EDITUV_VERTS | MBC_EDITUV_FACEDOTS) | ||||
| typedef struct MeshBatchCache { | typedef struct MeshBatchCache { | ||||
| /* In order buffers: All verts only specified once | /* In order buffers: All verts only specified once | ||||
| ▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | struct { | ||||
| /* Indices to verts. */ | /* Indices to verts. */ | ||||
| GPUIndexBuf *surf_tris; | GPUIndexBuf *surf_tris; | ||||
| GPUIndexBuf *edges_lines; | GPUIndexBuf *edges_lines; | ||||
| GPUIndexBuf *edges_adj_lines; | GPUIndexBuf *edges_adj_lines; | ||||
| GPUIndexBuf *loose_edges_lines; | GPUIndexBuf *loose_edges_lines; | ||||
| /* Indices to vloops. */ | /* Indices to vloops. */ | ||||
| GPUIndexBuf *loops_tris; | GPUIndexBuf *loops_tris; | ||||
| GPUIndexBuf *loops_lines; | GPUIndexBuf *loops_lines; | ||||
| GPUIndexBuf *loops_lines_tpaint; | |||||
| GPUIndexBuf *loops_line_strips; | GPUIndexBuf *loops_line_strips; | ||||
| /* Edit mode. */ | /* Edit mode. */ | ||||
| GPUIndexBuf *edit_loops_points; /* verts */ | GPUIndexBuf *edit_loops_points; /* verts */ | ||||
| GPUIndexBuf *edit_loops_lines; /* edges */ | GPUIndexBuf *edit_loops_lines; /* edges */ | ||||
| GPUIndexBuf *edit_loops_tris; /* faces */ | GPUIndexBuf *edit_loops_tris; /* faces */ | ||||
| /* Edit UVs */ | /* Edit UVs */ | ||||
| GPUIndexBuf *edituv_loops_points; /* verts */ | GPUIndexBuf *edituv_loops_points; /* verts */ | ||||
| GPUIndexBuf *edituv_loops_line_strips; /* edges */ | GPUIndexBuf *edituv_loops_line_strips; /* edges */ | ||||
| Show All 23 Lines | struct { | ||||
| GPUBatch *edit_selection_edges; | GPUBatch *edit_selection_edges; | ||||
| GPUBatch *edit_selection_faces; | GPUBatch *edit_selection_faces; | ||||
| GPUBatch *edit_selection_facedots; | GPUBatch *edit_selection_facedots; | ||||
| /* Common display / Other */ | /* Common display / Other */ | ||||
| GPUBatch *all_verts; | GPUBatch *all_verts; | ||||
| GPUBatch *all_edges; | GPUBatch *all_edges; | ||||
| GPUBatch *loose_edges; | GPUBatch *loose_edges; | ||||
| GPUBatch *edge_detection; | GPUBatch *edge_detection; | ||||
| GPUBatch *wire_edges; /* Individual edges with face normals. */ | GPUBatch *wire_edges; /* Individual edges with face normals. */ | ||||
| GPUBatch *wire_loops; /* Loops around faces. */ | GPUBatch *wire_loops; /* Loops around faces. */ | ||||
| GPUBatch *wire_loops_tpaint; /* Loops around faces, no edges between selected faces */ | |||||
| GPUBatch *wire_loops_uvs; /* Same as wire_loops but only has uvs. */ | GPUBatch *wire_loops_uvs; /* Same as wire_loops but only has uvs. */ | ||||
| } batch; | } batch; | ||||
| GPUIndexBuf **surf_per_mat_tris; | GPUIndexBuf **surf_per_mat_tris; | ||||
| GPUBatch **surf_per_mat; | GPUBatch **surf_per_mat; | ||||
| /* arrays of bool uniform names (and value) that will be use to | /* arrays of bool uniform names (and value) that will be use to | ||||
| * set srgb conversion for auto attributes.*/ | * set srgb conversion for auto attributes.*/ | ||||
| char *auto_layer_names; | char *auto_layer_names; | ||||
| ▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | case BKE_MESH_BATCH_DIRTY_SELECT: | ||||
| MBC_EDIT_FACEDOTS | MBC_EDIT_SELECTION_FACEDOTS | | MBC_EDIT_FACEDOTS | MBC_EDIT_SELECTION_FACEDOTS | | ||||
| MBC_EDIT_MESH_ANALYSIS); | MBC_EDIT_MESH_ANALYSIS); | ||||
| /* Because visible UVs depends on edit mode selection, discard everything. */ | /* Because visible UVs depends on edit mode selection, discard everything. */ | ||||
| mesh_batch_cache_discard_uvedit(cache); | mesh_batch_cache_discard_uvedit(cache); | ||||
| break; | break; | ||||
| case BKE_MESH_BATCH_DIRTY_SELECT_PAINT: | case BKE_MESH_BATCH_DIRTY_SELECT_PAINT: | ||||
| /* Paint mode selection flag is packed inside the nor attrib. | /* Paint mode selection flag is packed inside the nor attrib. | ||||
| * Note that it can be slow if auto smooth is enabled. (see T63946) */ | * Note that it can be slow if auto smooth is enabled. (see T63946) */ | ||||
| GPU_INDEXBUF_DISCARD_SAFE(cache->ibo.loops_lines_tpaint); | |||||
| GPU_VERTBUF_DISCARD_SAFE(cache->ordered.loop_pos_nor); | GPU_VERTBUF_DISCARD_SAFE(cache->ordered.loop_pos_nor); | ||||
| GPU_BATCH_DISCARD_SAFE(cache->batch.surface); | GPU_BATCH_DISCARD_SAFE(cache->batch.surface); | ||||
| GPU_BATCH_DISCARD_SAFE(cache->batch.wire_loops); | GPU_BATCH_DISCARD_SAFE(cache->batch.wire_loops); | ||||
| GPU_BATCH_DISCARD_SAFE(cache->batch.wire_loops_tpaint); | |||||
| if (cache->surf_per_mat) { | if (cache->surf_per_mat) { | ||||
| for (int i = 0; i < cache->mat_len; i++) { | for (int i = 0; i < cache->mat_len; i++) { | ||||
| GPU_BATCH_DISCARD_SAFE(cache->surf_per_mat[i]); | GPU_BATCH_DISCARD_SAFE(cache->surf_per_mat[i]); | ||||
| } | } | ||||
| } | } | ||||
| cache->batch_ready &= ~(MBC_SURFACE | MBC_WIRE_LOOPS | MBC_SURF_PER_MAT); | cache->batch_ready &= ~(MBC_SURFACE | MBC_WIRE_LOOPS | MBC_WIRE_LOOPS_TPAINT | | ||||
| MBC_SURF_PER_MAT); | |||||
| break; | break; | ||||
| case BKE_MESH_BATCH_DIRTY_ALL: | case BKE_MESH_BATCH_DIRTY_ALL: | ||||
| cache->is_dirty = true; | cache->is_dirty = true; | ||||
| break; | break; | ||||
| case BKE_MESH_BATCH_DIRTY_SHADING: | case BKE_MESH_BATCH_DIRTY_SHADING: | ||||
| mesh_batch_cache_discard_shaded_tri(cache); | mesh_batch_cache_discard_shaded_tri(cache); | ||||
| mesh_batch_cache_discard_uvedit(cache); | mesh_batch_cache_discard_uvedit(cache); | ||||
| break; | break; | ||||
| ▲ Show 20 Lines • Show All 1,544 Lines • ▼ Show 20 Lines | static void mesh_create_loops_lines(MeshRenderData *rdata, GPUIndexBuf *ibo, const bool use_hide) | ||||
| else { | else { | ||||
| /* Implement ... eventually if needed. */ | /* Implement ... eventually if needed. */ | ||||
| BLI_assert(0); | BLI_assert(0); | ||||
| } | } | ||||
| GPU_indexbuf_build_in_place(&elb, ibo); | GPU_indexbuf_build_in_place(&elb, ibo); | ||||
| } | } | ||||
| static void mesh_create_loops_lines_tpaint(MeshRenderData *rdata, GPUIndexBuf *ibo) | |||||
| { | |||||
| const int loop_len = mesh_render_data_loops_len_get(rdata); | |||||
| const int poly_len = mesh_render_data_polys_len_get(rdata); | |||||
| GPUIndexBufBuilder elb; | |||||
| GPU_indexbuf_init(&elb, GPU_PRIM_LINES, loop_len, loop_len); | |||||
| if (rdata->mapped.use == false) { | |||||
| if (rdata->edit_bmesh) { | |||||
| /* Texture painting does not use the edit_bmesh */ | |||||
| } | |||||
| else { | |||||
| /* contains all edges where at least one face has been selected */ | |||||
| EdgeHash *single_hash = BLI_edgehash_new(__func__); | |||||
| /* contains all edges where at least two face have been selected */ | |||||
| EdgeHash *double_hash = BLI_edgehash_new(__func__); | |||||
brecht: It's more efficient to have a single hash with the value being the number of selected faces. | |||||
| /* Fill the EdgeHash tables. */ | |||||
| for (int poly = 0; poly < poly_len; poly++) { | |||||
| const MPoly *mpoly = &rdata->mpoly[poly]; | |||||
| /* Do not check faces that are hidden and faces that aren't selected */ | |||||
| if (mpoly->flag & ME_HIDE || ((mpoly->flag & ME_FACE_SEL) == 0)) { | |||||
| continue; | |||||
| } | |||||
Done Inline ActionsPostprocess edgehash to optimize the inner loop lookups. jbakker: Postprocess edgehash to optimize the inner loop lookups. | |||||
Done Inline ActionsPerhaps we can do this later jbakker: Perhaps we can do this later | |||||
| for (int loop_index = 0; loop_index < mpoly->totloop; loop_index++) { | |||||
Done Inline ActionsI am not sure how we could use the EdgeHashIterator as we need the vertex loop index in the index buffer. jbakker: I am not sure how we could use the EdgeHashIterator as we need the vertex loop index in the… | |||||
| const MLoop *mloop = &rdata->mloop[mpoly->loopstart + loop_index]; | |||||
| const MEdge *edge = (MEdge *)rdata->medge + mloop->e; | |||||
| const int v1 = edge->v1; | |||||
| const int v2 = edge->v2; | |||||
| if (!BLI_edgehash_reinsert(single_hash, v1, v2, NULL)) { | |||||
| BLI_edgehash_reinsert(double_hash, v1, v2, NULL); | |||||
| } | |||||
| } | |||||
| } | |||||
| for (int poly = 0; poly < poly_len; poly++) { | |||||
| const MPoly *mpoly = &rdata->mpoly[poly]; | |||||
Done Inline ActionsIt would be more efficient to iterator over the hash. brecht: It would be more efficient to iterator over the hash. | |||||
| if (!(mpoly->flag & ME_HIDE)) { | |||||
| for (int loop_index = 0; loop_index < mpoly->totloop; loop_index++) { | |||||
| const MLoop *mloop = &rdata->mloop[mpoly->loopstart + loop_index]; | |||||
| const MEdge *edge = (MEdge *)rdata->medge + mloop->e; | |||||
| int v1 = mpoly->loopstart + loop_index; | |||||
| int v2 = mpoly->loopstart + (loop_index + 1) % mpoly->totloop; | |||||
| if (!BLI_edgehash_haskey(double_hash, edge->v1, edge->v2)) { | |||||
| GPU_indexbuf_add_line_verts(&elb, v1, v2); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| BLI_edgehash_free(single_hash, NULL); | |||||
| BLI_edgehash_free(double_hash, NULL); | |||||
| } | |||||
| } | |||||
| else { | |||||
| /* Implement ... eventually if needed. */ | |||||
| BLI_assert(0); | |||||
| } | |||||
Done Inline ActionsWhich case is this? Can we add an explanation why this is not needed now? brecht: Which case is this? Can we add an explanation why this is not needed now? | |||||
Done Inline ActionsWas copy paste mistake, will remove the if statement to use mapped data jbakker: Was copy paste mistake, will remove the if statement to use mapped data | |||||
| GPU_indexbuf_build_in_place(&elb, ibo); | |||||
| } | |||||
| static void mesh_create_loops_line_strips(MeshRenderData *rdata, | static void mesh_create_loops_line_strips(MeshRenderData *rdata, | ||||
| GPUIndexBuf *ibo, | GPUIndexBuf *ibo, | ||||
| const bool use_hide) | const bool use_hide) | ||||
| { | { | ||||
| const int loop_len = mesh_render_data_loops_len_get(rdata); | const int loop_len = mesh_render_data_loops_len_get(rdata); | ||||
| const int poly_len = mesh_render_data_polys_len_get(rdata); | const int poly_len = mesh_render_data_polys_len_get(rdata); | ||||
| GPUIndexBufBuilder elb; | GPUIndexBufBuilder elb; | ||||
| ▲ Show 20 Lines • Show All 725 Lines • ▼ Show 20 Lines | |||||
| GPUBatch *DRW_mesh_batch_cache_get_surface_edges(Mesh *me) | GPUBatch *DRW_mesh_batch_cache_get_surface_edges(Mesh *me) | ||||
| { | { | ||||
| MeshBatchCache *cache = mesh_batch_cache_get(me); | MeshBatchCache *cache = mesh_batch_cache_get(me); | ||||
| mesh_batch_cache_add_request(cache, MBC_WIRE_LOOPS); | mesh_batch_cache_add_request(cache, MBC_WIRE_LOOPS); | ||||
| return DRW_batch_request(&cache->batch.wire_loops); | return DRW_batch_request(&cache->batch.wire_loops); | ||||
| } | } | ||||
| GPUBatch *DRW_mesh_batch_cache_get_surface_texture_paint_edges(Mesh *me) | |||||
| { | |||||
| MeshBatchCache *cache = mesh_batch_cache_get(me); | |||||
| mesh_batch_cache_add_request(cache, MBC_WIRE_LOOPS_TPAINT); | |||||
| return DRW_batch_request(&cache->batch.wire_loops_tpaint); | |||||
| } | |||||
| /* Compute 3D & 2D areas and their sum. */ | /* Compute 3D & 2D areas and their sum. */ | ||||
| BLI_INLINE void edit_uv_preprocess_stretch_area(BMFace *efa, | BLI_INLINE void edit_uv_preprocess_stretch_area(BMFace *efa, | ||||
| const int cd_loop_uv_offset, | const int cd_loop_uv_offset, | ||||
| uint fidx, | uint fidx, | ||||
| float *totarea, | float *totarea, | ||||
| float *totuvarea, | float *totuvarea, | ||||
| float (*faces_areas)[2]) | float (*faces_areas)[2]) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 504 Lines • ▼ Show 20 Lines | if (DRW_batch_requested(cache->batch.surface_weights, GPU_PRIM_TRIS)) { | ||||
| DRW_ibo_request(cache->batch.surface_weights, &cache->ibo.surf_tris); | DRW_ibo_request(cache->batch.surface_weights, &cache->ibo.surf_tris); | ||||
| DRW_vbo_request(cache->batch.surface_weights, &cache->ordered.pos_nor); | DRW_vbo_request(cache->batch.surface_weights, &cache->ordered.pos_nor); | ||||
| DRW_vbo_request(cache->batch.surface_weights, &cache->ordered.weights); | DRW_vbo_request(cache->batch.surface_weights, &cache->ordered.weights); | ||||
| } | } | ||||
| if (DRW_batch_requested(cache->batch.wire_loops, GPU_PRIM_LINE_STRIP)) { | if (DRW_batch_requested(cache->batch.wire_loops, GPU_PRIM_LINE_STRIP)) { | ||||
| DRW_ibo_request(cache->batch.wire_loops, &cache->ibo.loops_line_strips); | DRW_ibo_request(cache->batch.wire_loops, &cache->ibo.loops_line_strips); | ||||
| DRW_vbo_request(cache->batch.wire_loops, &cache->ordered.loop_pos_nor); | DRW_vbo_request(cache->batch.wire_loops, &cache->ordered.loop_pos_nor); | ||||
| } | } | ||||
| if (DRW_batch_requested(cache->batch.wire_loops_tpaint, GPU_PRIM_LINES)) { | |||||
| DRW_ibo_request(cache->batch.wire_loops_tpaint, &cache->ibo.loops_lines_tpaint); | |||||
| DRW_vbo_request(cache->batch.wire_loops_tpaint, &cache->ordered.loop_pos_nor); | |||||
| } | |||||
| if (DRW_batch_requested(cache->batch.wire_edges, GPU_PRIM_LINES)) { | if (DRW_batch_requested(cache->batch.wire_edges, GPU_PRIM_LINES)) { | ||||
| DRW_ibo_request(cache->batch.wire_edges, &cache->ibo.loops_lines); | DRW_ibo_request(cache->batch.wire_edges, &cache->ibo.loops_lines); | ||||
| DRW_vbo_request(cache->batch.wire_edges, &cache->ordered.loop_pos_nor); | DRW_vbo_request(cache->batch.wire_edges, &cache->ordered.loop_pos_nor); | ||||
| DRW_vbo_request(cache->batch.wire_edges, &cache->ordered.loop_edge_fac); | DRW_vbo_request(cache->batch.wire_edges, &cache->ordered.loop_edge_fac); | ||||
| } | } | ||||
| if (DRW_batch_requested(cache->batch.wire_loops_uvs, GPU_PRIM_LINE_STRIP)) { | if (DRW_batch_requested(cache->batch.wire_loops_uvs, GPU_PRIM_LINE_STRIP)) { | ||||
| DRW_ibo_request(cache->batch.wire_loops_uvs, &cache->ibo.loops_line_strips); | DRW_ibo_request(cache->batch.wire_loops_uvs, &cache->ibo.loops_line_strips); | ||||
| /* For paint overlay. Active layer should have been queried. */ | /* For paint overlay. Active layer should have been queried. */ | ||||
| ▲ Show 20 Lines • Show All 134 Lines • ▼ Show 20 Lines | DRW_ADD_FLAG_FROM_VBO_REQUEST( | ||||
| mr_flag, cache->ordered.loop_edge_fac, MR_DATATYPE_VERT_LOOP_POLY | MR_DATATYPE_EDGE); | mr_flag, cache->ordered.loop_edge_fac, MR_DATATYPE_VERT_LOOP_POLY | MR_DATATYPE_EDGE); | ||||
| DRW_ADD_FLAG_FROM_IBO_REQUEST( | DRW_ADD_FLAG_FROM_IBO_REQUEST( | ||||
| mr_flag, cache->ibo.surf_tris, MR_DATATYPE_VERT_LOOP_POLY | MR_DATATYPE_LOOPTRI); | mr_flag, cache->ibo.surf_tris, MR_DATATYPE_VERT_LOOP_POLY | MR_DATATYPE_LOOPTRI); | ||||
| DRW_ADD_FLAG_FROM_IBO_REQUEST( | DRW_ADD_FLAG_FROM_IBO_REQUEST( | ||||
| mr_flag, cache->ibo.loops_tris, MR_DATATYPE_LOOP | MR_DATATYPE_POLY | MR_DATATYPE_LOOPTRI); | mr_flag, cache->ibo.loops_tris, MR_DATATYPE_LOOP | MR_DATATYPE_POLY | MR_DATATYPE_LOOPTRI); | ||||
| DRW_ADD_FLAG_FROM_IBO_REQUEST( | DRW_ADD_FLAG_FROM_IBO_REQUEST( | ||||
| mr_flag, cache->ibo.loops_lines, MR_DATATYPE_LOOP | MR_DATATYPE_EDGE | MR_DATATYPE_POLY); | mr_flag, cache->ibo.loops_lines, MR_DATATYPE_LOOP | MR_DATATYPE_EDGE | MR_DATATYPE_POLY); | ||||
| DRW_ADD_FLAG_FROM_IBO_REQUEST(mr_flag, | |||||
| cache->ibo.loops_lines_tpaint, | |||||
| MR_DATATYPE_LOOP | MR_DATATYPE_EDGE | MR_DATATYPE_POLY); | |||||
| DRW_ADD_FLAG_FROM_IBO_REQUEST( | DRW_ADD_FLAG_FROM_IBO_REQUEST( | ||||
| mr_flag, cache->ibo.loops_line_strips, MR_DATATYPE_LOOP | MR_DATATYPE_POLY); | mr_flag, cache->ibo.loops_line_strips, MR_DATATYPE_LOOP | MR_DATATYPE_POLY); | ||||
| DRW_ADD_FLAG_FROM_IBO_REQUEST( | DRW_ADD_FLAG_FROM_IBO_REQUEST( | ||||
| mr_flag, cache->ibo.edges_lines, MR_DATATYPE_VERT | MR_DATATYPE_EDGE); | mr_flag, cache->ibo.edges_lines, MR_DATATYPE_VERT | MR_DATATYPE_EDGE); | ||||
| DRW_ADD_FLAG_FROM_IBO_REQUEST( | DRW_ADD_FLAG_FROM_IBO_REQUEST( | ||||
| mr_flag, cache->ibo.edges_adj_lines, MR_DATATYPE_VERT_LOOP_POLY | MR_DATATYPE_LOOPTRI); | mr_flag, cache->ibo.edges_adj_lines, MR_DATATYPE_VERT_LOOP_POLY | MR_DATATYPE_LOOPTRI); | ||||
| DRW_ADD_FLAG_FROM_IBO_REQUEST( | DRW_ADD_FLAG_FROM_IBO_REQUEST( | ||||
| mr_flag, cache->ibo.loose_edges_lines, MR_DATATYPE_VERT | MR_DATATYPE_EDGE); | mr_flag, cache->ibo.loose_edges_lines, MR_DATATYPE_VERT | MR_DATATYPE_EDGE); | ||||
| ▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | mesh_create_loose_edges_lines( | ||||
| rdata, cache->ibo.loose_edges_lines, &cache->no_loose_wire, use_hide); | rdata, cache->ibo.loose_edges_lines, &cache->no_loose_wire, use_hide); | ||||
| } | } | ||||
| if (DRW_ibo_requested(cache->ibo.surf_tris)) { | if (DRW_ibo_requested(cache->ibo.surf_tris)) { | ||||
| mesh_create_surf_tris(rdata, cache->ibo.surf_tris, use_hide); | mesh_create_surf_tris(rdata, cache->ibo.surf_tris, use_hide); | ||||
| } | } | ||||
| if (DRW_ibo_requested(cache->ibo.loops_lines)) { | if (DRW_ibo_requested(cache->ibo.loops_lines)) { | ||||
| mesh_create_loops_lines(rdata, cache->ibo.loops_lines, use_hide); | mesh_create_loops_lines(rdata, cache->ibo.loops_lines, use_hide); | ||||
| } | } | ||||
| if (DRW_ibo_requested(cache->ibo.loops_lines_tpaint)) { | |||||
| mesh_create_loops_lines_tpaint(rdata, cache->ibo.loops_lines_tpaint); | |||||
| } | |||||
| if (DRW_ibo_requested(cache->ibo.loops_line_strips)) { | if (DRW_ibo_requested(cache->ibo.loops_line_strips)) { | ||||
| mesh_create_loops_line_strips(rdata, cache->ibo.loops_line_strips, use_hide); | mesh_create_loops_line_strips(rdata, cache->ibo.loops_line_strips, use_hide); | ||||
| } | } | ||||
| if (DRW_ibo_requested(cache->ibo.loops_tris)) { | if (DRW_ibo_requested(cache->ibo.loops_tris)) { | ||||
| mesh_create_loops_tris(rdata, &cache->ibo.loops_tris, 1, use_hide); | mesh_create_loops_tris(rdata, &cache->ibo.loops_tris, 1, use_hide); | ||||
| } | } | ||||
| if (DRW_ibo_requested(cache->surf_per_mat_tris[0])) { | if (DRW_ibo_requested(cache->surf_per_mat_tris[0])) { | ||||
| mesh_create_loops_tris(rdata, cache->surf_per_mat_tris, cache->mat_len, use_hide); | mesh_create_loops_tris(rdata, cache->surf_per_mat_tris, cache->mat_len, use_hide); | ||||
| ▲ Show 20 Lines • Show All 90 Lines • Show Last 20 Lines | |||||
It's more efficient to have a single hash with the value being the number of selected faces.