|
Blender
V2.93
|
Mesh API for render engines. More...
#include "MEM_guardedalloc.h"#include "BLI_alloca.h"#include "BLI_bitmap.h"#include "BLI_buffer.h"#include "BLI_edgehash.h"#include "BLI_listbase.h"#include "BLI_math_bits.h"#include "BLI_math_vector.h"#include "BLI_string.h"#include "BLI_task.h"#include "BLI_utildefines.h"#include "DNA_mesh_types.h"#include "DNA_meshdata_types.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "BKE_customdata.h"#include "BKE_deform.h"#include "BKE_editmesh.h"#include "BKE_editmesh_cache.h"#include "BKE_editmesh_tangent.h"#include "BKE_mesh.h"#include "BKE_mesh_runtime.h"#include "BKE_mesh_tangent.h"#include "BKE_modifier.h"#include "BKE_object_deform.h"#include "BKE_paint.h"#include "BKE_pbvh.h"#include "atomic_ops.h"#include "bmesh.h"#include "GPU_batch.h"#include "GPU_material.h"#include "DRW_render.h"#include "ED_mesh.h"#include "ED_uvedit.h"#include "draw_cache_extract.h"#include "draw_cache_inline.h"#include "draw_cache_impl.h"Go to the source code of this file.
Mesh API for render engines.
Definition in file draw_cache_impl_mesh.c.
| void DRW_mesh_batch_cache_create_requested | ( | struct TaskGraph * | task_graph, |
| Object * | ob, | ||
| Mesh * | me, | ||
| const Scene * | scene, | ||
| const bool | is_paint_mode, | ||
| const bool | use_hide | ||
| ) |
TODO: The code and data structure is ready to support modified UV display but the selection code for UVs needs to support it first. So for now, only display the cage in all cases.
Definition at line 1188 of file draw_cache_impl_mesh.c.
References MeshBatchCache::all_edges, MeshBatchCache::all_verts, MeshBatchCache::batch, MeshBatchCache::batch_ready, MeshBatchCache::batch_requested, BKE_modifiers_uses_subsurf_facedots(), BKE_pbvh_update_normals(), BLI_assert, BLI_task_graph_work_and_wait(), MeshBatchCache::cage, MeshBatchCache::cd_needed, CD_ORCO, MeshBatchCache::cd_used, MeshBatchCache::cd_used_over_time, CustomData_get_layer(), Object::data, DRW_batch_requested(), DRW_ibo_request(), drw_mesh_weight_state_clear(), drw_mesh_weight_state_copy(), drw_mesh_weight_state_extract(), DRW_object_is_in_edit_mode(), DRW_vbo_request(), MeshBatchCache::edge_detection, MeshBufferCache::edge_fac, MeshBufferCache::edge_idx, MeshBufferCache::edit_data, MeshBatchCache::edit_edges, MeshBatchCache::edit_fdots, MeshBatchCache::edit_lnor, Mesh::edit_mesh, MeshBatchCache::edit_mesh_analysis, MeshBatchCache::edit_selection_edges, MeshBatchCache::edit_selection_faces, MeshBatchCache::edit_selection_fdots, MeshBatchCache::edit_selection_verts, MeshBatchCache::edit_skin_roots, MeshBatchCache::edit_triangles, MeshBatchCache::edit_vertices, MeshBatchCache::edit_vnor, MeshBufferCache::edituv_data, MeshBatchCache::edituv_edges, MeshBatchCache::edituv_faces, MeshBatchCache::edituv_faces_stretch_angle, MeshBatchCache::edituv_faces_stretch_area, MeshBufferCache::edituv_fdots, MeshBatchCache::edituv_fdots, MeshBufferCache::edituv_lines, MeshBufferCache::edituv_points, MeshBufferCache::edituv_stretch_angle, MeshBufferCache::edituv_stretch_area, MeshBufferCache::edituv_tris, MeshBatchCache::edituv_verts, MeshBufferCache::fdot_idx, MeshBufferCache::fdots, MeshBufferCache::fdots_edituv_data, MeshBufferCache::fdots_nor, MeshBufferCache::fdots_pos, MeshBufferCache::fdots_uv, MeshBatchCache::final, FOREACH_MESH_BUFFER_CACHE, GPU_BATCH_CLEAR_SAFE, GPU_INDEXBUF_DISCARD_SAFE, GPU_PRIM_LINES, GPU_PRIM_LINES_ADJ, GPU_PRIM_POINTS, GPU_PRIM_TRIS, GPU_VERTBUF_DISCARD_SAFE, MeshBufferCache::ibo, if(), Mesh_Runtime::is_original, MeshBatchCache::is_uvsyncsel, MeshBufferCache::lines, MeshBufferCache::lines_adjacency, MeshBufferCache::lines_loose, MeshBufferCache::lines_paint_mask, MeshBufferCache::lnor, MeshBatchCache::loose_edges, MeshBatchCache::mat_len, MBC_EDITUV, MBC_EDITUV_EDGES, MBC_EDITUV_FACES, MBC_EDITUV_FACES_STRETCH_ANGLE, MBC_EDITUV_FACES_STRETCH_AREA, MBC_EDITUV_VERTS, MBC_SURFACE, MBC_SURFACE_WEIGHTS, MBC_WIRE_LOOPS_UVS, mesh, MeshBufferCache::mesh_analysis, mesh_batch_cache_check_vertex_group(), mesh_batch_cache_get(), mesh_buffer_cache_create_requested(), mesh_cd_layers_type_clear(), mesh_cd_layers_type_merge(), mesh_cd_layers_type_overlap(), BMEditMesh::mesh_eval_cage, BMEditMesh::mesh_eval_final, Object::mode, NULL, OB_MESH, OB_MODE_EDIT, Object::obmat, DRW_MeshCDMask::orco, MeshBufferCache::orco, SculptSession::pbvh, MeshBufferCache::points, MeshBufferCache::poly_idx, MeshBufferCache::pos_nor, Mesh::runtime, scene, Object::sculpt, MeshBufferCache::sculpt_data, DRW_MeshCDMask::sculpt_overlays, MeshBatchCache::sculpt_overlays, DRW_MeshCDMask::sculpt_vcol, MeshBufferCache::skin_roots, Mesh_Runtime::subdiv_ccg, MeshBatchCache::surface, MeshBatchCache::surface_per_mat, MeshBatchCache::surface_weights, DRW_MeshCDMask::tan, MeshBufferCache::tan, DRW_MeshCDMask::tan_orco, Scene::toolsettings, MeshBufferCache::tris, MeshBufferCache::tris_per_mat, Object::type, DRW_MeshCDMask::uv, MeshBufferCache::uv, MeshBatchCache::uv_cage, ToolSettings::uv_flag, UV_SYNC_SELECTION, MeshBufferCache::vbo, DRW_MeshCDMask::vcol, MeshBufferCache::vcol, MeshBufferCache::vert_idx, MeshBatchCache::weight_state, MeshBufferCache::weights, MeshBatchCache::wire_edges, MeshBatchCache::wire_loops, and MeshBatchCache::wire_loops_uvs.
| void DRW_mesh_batch_cache_dirty_tag | ( | Mesh * | me, |
| eMeshBatchDirtyMode | mode | ||
| ) |
Definition at line 631 of file draw_cache_impl_mesh.c.
References MeshBatchCache::all_edges, MeshBatchCache::all_verts, MeshBatchCache::batch, Mesh_Runtime::batch_cache, MeshBatchCache::batch_ready, BKE_MESH_BATCH_DIRTY_ALL, BKE_MESH_BATCH_DIRTY_SELECT, BKE_MESH_BATCH_DIRTY_SELECT_PAINT, BKE_MESH_BATCH_DIRTY_SHADING, BKE_MESH_BATCH_DIRTY_UVEDIT_ALL, BKE_MESH_BATCH_DIRTY_UVEDIT_SELECT, BLI_assert, MeshBatchCache::edge_detection, MeshBatchCache::edit_edges, MeshBatchCache::edit_fdots, MeshBatchCache::edit_lnor, MeshBatchCache::edit_mesh_analysis, MeshBatchCache::edit_selection_edges, MeshBatchCache::edit_selection_faces, MeshBatchCache::edit_selection_fdots, MeshBatchCache::edit_selection_verts, MeshBatchCache::edit_triangles, MeshBatchCache::edit_vertices, MeshBatchCache::edituv_edges, MeshBatchCache::edituv_faces, MeshBatchCache::edituv_faces_stretch_angle, MeshBatchCache::edituv_faces_stretch_area, MeshBatchCache::edituv_fdots, MeshBatchCache::edituv_verts, FOREACH_MESH_BUFFER_CACHE, GPU_BATCH_DISCARD_SAFE, GPU_INDEXBUF_DISCARD_SAFE, GPU_VERTBUF_DISCARD_SAFE, MeshBatchCache::is_dirty, MeshBatchCache::loose_edges, MBC_EDIT_EDGES, MBC_EDIT_FACEDOTS, MBC_EDIT_MESH_ANALYSIS, MBC_EDIT_SELECTION_EDGES, MBC_EDIT_SELECTION_FACEDOTS, MBC_EDIT_SELECTION_FACES, MBC_EDIT_SELECTION_VERTS, MBC_EDIT_TRIANGLES, MBC_EDIT_VERTICES, MBC_EDITUV, MBC_SURFACE, MBC_WIRE_EDGES, MBC_WIRE_LOOPS, mesh_batch_cache_discard_shaded_tri(), mesh_batch_cache_discard_surface_batches(), mesh_batch_cache_discard_uvedit(), mesh_batch_cache_discard_uvedit_select(), NULL, Mesh::runtime, MeshBatchCache::surface, MeshBatchCache::surface_weights, MeshBatchCache::wire_edges, and MeshBatchCache::wire_loops.
Referenced by DRW_engines_register().
| void DRW_mesh_batch_cache_free | ( | Mesh * | me | ) |
Definition at line 746 of file draw_cache_impl_mesh.c.
References Mesh_Runtime::batch_cache, MEM_SAFE_FREE, mesh_batch_cache_clear(), and Mesh::runtime.
Referenced by DRW_engines_register().
| void DRW_mesh_batch_cache_free_old | ( | Mesh * | me, |
| int | ctime | ||
| ) |
Definition at line 1134 of file draw_cache_impl_mesh.c.
References Mesh_Runtime::batch_cache, MeshBatchCache::cd_used, MeshBatchCache::cd_used_over_time, MeshBatchCache::lastmatch, mesh_batch_cache_discard_shaded_tri(), mesh_cd_layers_type_clear(), mesh_cd_layers_type_equal(), NULL, and Mesh::runtime.
Referenced by DRW_batch_cache_free_old().
Definition at line 802 of file draw_cache_impl_mesh.c.
References MeshBatchCache::all_edges, MeshBatchCache::batch, DRW_batch_request(), MBC_ALL_EDGES, mesh_batch_cache_add_request(), and mesh_batch_cache_get().
Referenced by DRW_cache_mesh_all_edges_get().
Definition at line 795 of file draw_cache_impl_mesh.c.
References MeshBatchCache::all_verts, MeshBatchCache::batch, DRW_batch_request(), MBC_ALL_VERTS, mesh_batch_cache_add_request(), and mesh_batch_cache_get().
Referenced by DRW_cache_mesh_all_verts_get().
Definition at line 834 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MeshBatchCache::edge_detection, MeshBatchCache::is_manifold, MBC_EDGE_DETECTION, mesh_batch_cache_add_request(), and mesh_batch_cache_get().
Referenced by DRW_cache_curve_edge_detection_get(), DRW_cache_mesh_edge_detection_get(), DRW_cache_surf_edge_detection_get(), and DRW_cache_text_edge_detection_get().
Definition at line 1013 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MeshBatchCache::edit_selection_edges, MBC_EDIT_SELECTION_EDGES, mesh_batch_cache_add_request(), and mesh_batch_cache_get().
Referenced by draw_select_id_edit_mesh(), draw_select_id_mesh(), and select_cache_populate().
Definition at line 951 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MeshBatchCache::edit_edges, MBC_EDIT_EDGES, mesh_batch_cache_add_request(), and mesh_batch_cache_get().
Referenced by overlay_edit_mesh_add_ob_to_pass().
Definition at line 979 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MeshBatchCache::edit_fdots, MBC_EDIT_FACEDOTS, mesh_batch_cache_add_request(), and mesh_batch_cache_get().
Referenced by overlay_edit_mesh_add_ob_to_pass(), and OVERLAY_edit_mesh_cache_populate().
Definition at line 972 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MeshBatchCache::edit_lnor, MBC_EDIT_LNOR, mesh_batch_cache_add_request(), and mesh_batch_cache_get().
Referenced by OVERLAY_edit_mesh_cache_populate().
Definition at line 853 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MeshBatchCache::edit_mesh_analysis, MBC_EDIT_MESH_ANALYSIS, mesh_batch_cache_add_request(), and mesh_batch_cache_get().
Referenced by DRW_cache_mesh_surface_mesh_analysis_get().
Definition at line 986 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MeshBatchCache::edit_skin_roots, MBC_SKIN_ROOTS, mesh_batch_cache_add_request(), and mesh_batch_cache_get().
Referenced by overlay_edit_mesh_add_ob_to_pass().
Definition at line 944 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MeshBatchCache::edit_triangles, MBC_EDIT_TRIANGLES, mesh_batch_cache_add_request(), and mesh_batch_cache_get().
Referenced by DRW_draw_depth_object(), and overlay_edit_mesh_add_ob_to_pass().
Definition at line 958 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MeshBatchCache::edit_vertices, MBC_EDIT_VERTICES, mesh_batch_cache_add_request(), and mesh_batch_cache_get().
Referenced by overlay_edit_mesh_add_ob_to_pass().
Definition at line 965 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MeshBatchCache::edit_vnor, MBC_EDIT_VNOR, mesh_batch_cache_add_request(), and mesh_batch_cache_get().
Referenced by OVERLAY_edit_mesh_cache_populate().
Definition at line 1085 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MeshBatchCache::edituv_edges, edituv_request_active_uv(), MBC_EDITUV_EDGES, mesh_batch_cache_add_request(), and mesh_batch_cache_get().
Referenced by overlay_edit_uv_cache_populate().
Definition at line 1101 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MeshBatchCache::edituv_fdots, edituv_request_active_uv(), MBC_EDITUV_FACEDOTS, mesh_batch_cache_add_request(), and mesh_batch_cache_get().
Referenced by overlay_edit_uv_cache_populate().
Definition at line 1077 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MeshBatchCache::edituv_faces, edituv_request_active_uv(), MBC_EDITUV_FACES, mesh_batch_cache_add_request(), and mesh_batch_cache_get().
Referenced by overlay_edit_uv_cache_populate().
Definition at line 1069 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MeshBatchCache::edituv_faces_stretch_angle, edituv_request_active_uv(), MBC_EDITUV_FACES_STRETCH_ANGLE, mesh_batch_cache_add_request(), and mesh_batch_cache_get().
Referenced by overlay_edit_uv_cache_populate().
| GPUBatch* DRW_mesh_batch_cache_get_edituv_faces_stretch_area | ( | Mesh * | me, |
| float ** | tot_area, | ||
| float ** | tot_uv_area | ||
| ) |
Definition at line 1052 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MeshBatchCache::edituv_faces_stretch_area, edituv_request_active_uv(), MBC_EDITUV_FACES_STRETCH_AREA, mesh_batch_cache_add_request(), mesh_batch_cache_get(), NULL, MeshBatchCache::tot_area, and MeshBatchCache::tot_uv_area.
Referenced by overlay_edit_uv_cache_populate().
Definition at line 1093 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), edituv_request_active_uv(), MeshBatchCache::edituv_verts, MBC_EDITUV_VERTS, mesh_batch_cache_add_request(), and mesh_batch_cache_get().
Referenced by overlay_edit_uv_cache_populate().
Definition at line 1006 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MeshBatchCache::edit_selection_fdots, MBC_EDIT_SELECTION_FACEDOTS, mesh_batch_cache_add_request(), and mesh_batch_cache_get().
Referenced by draw_select_id_edit_mesh().
Definition at line 816 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MeshBatchCache::loose_edges, MBC_LOOSE_EDGES, mesh_batch_cache_add_request(), mesh_batch_cache_get(), MeshBatchCache::no_loose_wire, and NULL.
Referenced by DRW_cache_curve_edge_wire_get(), DRW_cache_curve_loose_edges_get(), DRW_cache_mesh_loose_edges_get(), DRW_cache_surf_edge_wire_get(), DRW_cache_surf_loose_edges_get(), DRW_cache_text_edge_wire_get(), and DRW_cache_text_loose_edges_get().
Definition at line 911 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, MeshBatchCache::cd_needed, DRW_batch_request(), MBC_SCULPT_OVERLAYS, mesh_batch_cache_add_request(), mesh_batch_cache_get(), DRW_MeshCDMask::sculpt_overlays, and MeshBatchCache::sculpt_overlays.
Referenced by OVERLAY_sculpt_cache_populate().
Definition at line 809 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, mesh_batch_cache_get(), mesh_batch_cache_request_surface_batches(), and MeshBatchCache::surface.
Referenced by draw_select_id_edit_mesh(), DRW_cache_curve_surface_get(), DRW_cache_mesh_surface_get(), DRW_cache_surf_surface_get(), DRW_cache_text_surface_get(), DRW_draw_depth_object(), and select_cache_populate().
Definition at line 1117 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MBC_WIRE_LOOPS, mesh_batch_cache_add_request(), mesh_batch_cache_get(), texpaint_request_active_uv(), and MeshBatchCache::wire_loops.
Referenced by DRW_cache_mesh_surface_edges_get().
Definition at line 898 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, mesh_batch_cache_get(), mesh_batch_cache_request_surface_batches(), sculpt_request_active_vcol(), and MeshBatchCache::surface.
Referenced by DRW_cache_mesh_surface_sculptcolors_get().
| GPUBatch** DRW_mesh_batch_cache_get_surface_shaded | ( | Mesh * | me, |
| struct GPUMaterial ** | gpumat_array, | ||
| uint | gpumat_array_len | ||
| ) |
Definition at line 860 of file draw_cache_impl_mesh.c.
References BLI_assert, MeshBatchCache::cd_needed, MeshBatchCache::mat_len, mesh_batch_cache_get(), mesh_batch_cache_request_surface_batches(), mesh_cd_calc_used_gpu_layers(), mesh_cd_layers_type_merge(), and MeshBatchCache::surface_per_mat.
Referenced by DRW_cache_curve_surface_shaded_get(), DRW_cache_mesh_surface_shaded_get(), DRW_cache_surf_surface_shaded_get(), and DRW_cache_text_surface_shaded_get().
Definition at line 874 of file draw_cache_impl_mesh.c.
References mesh_batch_cache_get(), mesh_batch_cache_request_surface_batches(), MeshBatchCache::surface_per_mat, and texpaint_request_active_uv().
Referenced by DRW_cache_mesh_surface_texpaint_get().
Definition at line 882 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, mesh_batch_cache_get(), mesh_batch_cache_request_surface_batches(), MeshBatchCache::surface, and texpaint_request_active_uv().
Referenced by DRW_cache_mesh_surface_texpaint_single_get().
Definition at line 890 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, mesh_batch_cache_get(), mesh_batch_cache_request_surface_batches(), MeshBatchCache::surface, and texpaint_request_active_vcol().
Referenced by DRW_cache_mesh_surface_vertpaint_get().
Definition at line 827 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MBC_SURFACE_WEIGHTS, mesh_batch_cache_add_request(), mesh_batch_cache_get(), and MeshBatchCache::surface_weights.
Referenced by DRW_cache_mesh_surface_weights_get().
Definition at line 999 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MeshBatchCache::edit_selection_faces, MBC_EDIT_SELECTION_FACES, mesh_batch_cache_add_request(), and mesh_batch_cache_get().
Referenced by draw_select_id_edit_mesh(), draw_select_id_mesh(), and select_cache_populate().
Definition at line 1109 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), edituv_request_active_uv(), MBC_WIRE_LOOPS_UVS, mesh_batch_cache_add_request(), mesh_batch_cache_get(), and MeshBatchCache::wire_loops_uvs.
Referenced by overlay_edit_uv_cache_populate().
Definition at line 1020 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MeshBatchCache::edit_selection_verts, MBC_EDIT_SELECTION_VERTS, mesh_batch_cache_add_request(), and mesh_batch_cache_get().
Referenced by draw_select_id_edit_mesh(), draw_select_id_mesh(), and select_cache_populate().
Definition at line 846 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MBC_WIRE_EDGES, mesh_batch_cache_add_request(), mesh_batch_cache_get(), and MeshBatchCache::wire_edges.
Referenced by DRW_cache_curve_face_wireframe_get(), DRW_cache_mesh_face_wireframe_get(), DRW_cache_surf_face_wireframe_get(), and DRW_cache_text_face_wireframe_get().
| GPUVertBuf* DRW_mesh_batch_cache_pos_vertbuf_get | ( | Mesh * | me | ) |
Definition at line 928 of file draw_cache_impl_mesh.c.
References DRW_vbo_request(), MeshBatchCache::final, mesh_batch_cache_get(), mesh_batch_cache_request_surface_batches(), NULL, MeshBufferCache::pos_nor, and MeshBufferCache::vbo.
Referenced by DRW_cache_object_pos_vertbuf_get().
| void DRW_mesh_batch_cache_validate | ( | Mesh * | me | ) |
Definition at line 511 of file draw_cache_impl_mesh.c.
References mesh_batch_cache_clear(), mesh_batch_cache_init(), and mesh_batch_cache_valid().
Referenced by drw_batch_cache_validate(), and OVERLAY_edit_uv_cache_init().
|
static |
Definition at line 358 of file draw_cache_impl_mesh.c.
References size().
Referenced by drw_mesh_weight_state_compare().
| int DRW_mesh_material_count_get | ( | Mesh * | me | ) |
Definition at line 906 of file draw_cache_impl_mesh.c.
References mesh_render_mat_len_get().
Referenced by DRW_cache_object_material_count_get().
|
static |
Reset the selection structure, deallocating heap memory as appropriate.
Definition at line 326 of file draw_cache_impl_mesh.c.
References DRW_MeshWeightState::defgroup_active, DRW_MeshWeightState::defgroup_locked, DRW_MeshWeightState::defgroup_sel, DRW_MeshWeightState::defgroup_unlocked, and MEM_SAFE_FREE.
Referenced by DRW_mesh_batch_cache_create_requested(), mesh_batch_cache_check_vertex_group(), mesh_batch_cache_clear(), and mesh_batch_cache_init().
|
static |
Compare two selection structures.
Definition at line 365 of file draw_cache_impl_mesh.c.
References Freestyle::a, DRW_MeshWeightState::alert_mode, DRW_MeshWeightState::defgroup_active, DRW_MeshWeightState::defgroup_len, DRW_MeshWeightState::defgroup_locked, DRW_MeshWeightState::defgroup_sel, DRW_MeshWeightState::defgroup_sel_count, DRW_MeshWeightState::defgroup_unlocked, drw_mesh_flags_equal(), and DRW_MeshWeightState::flags.
Referenced by mesh_batch_cache_check_vertex_group().
|
static |
Copy selection data from one structure to another, including heap memory.
Definition at line 338 of file draw_cache_impl_mesh.c.
References DRW_MeshWeightState::defgroup_locked, DRW_MeshWeightState::defgroup_sel, DRW_MeshWeightState::defgroup_unlocked, MEM_dupallocN, and MEM_SAFE_FREE.
Referenced by DRW_mesh_batch_cache_create_requested().
|
static |
Definition at line 376 of file draw_cache_impl_mesh.c.
References Object::actdef, DRW_MeshWeightState::alert_mode, ToolSettings::auto_normalize, BKE_object_defgroup_check_lock_relative(), BKE_object_defgroup_check_lock_relative_multi(), BKE_object_defgroup_lock_flags_get(), BKE_object_defgroup_mirror_selection(), BKE_object_defgroup_selected_get(), BKE_object_defgroup_split_locked_validmap(), BKE_object_defgroup_validmap_get(), BLI_listbase_count(), Object::defbase, DRW_MeshWeightState::defgroup_active, DRW_MeshWeightState::defgroup_len, DRW_MeshWeightState::defgroup_locked, DRW_MeshWeightState::defgroup_sel, DRW_MeshWeightState::defgroup_sel_count, DRW_MeshWeightState::defgroup_unlocked, DRW_MESH_WEIGHT_STATE_AUTO_NORMALIZE, DRW_MESH_WEIGHT_STATE_LOCK_RELATIVE, DRW_MESH_WEIGHT_STATE_MULTIPAINT, DRW_MeshWeightState::flags, ME_USING_MIRROR_X_VERTEX_GROUPS, MEM_SAFE_FREE, ToolSettings::multipaint, ToolSettings::weightuser, and ToolSettings::wpaint_lock_relative.
Referenced by DRW_mesh_batch_cache_create_requested().
| BLI_INLINE const Mesh* editmesh_final_or_this | ( | const Mesh * | me | ) |
Definition at line 100 of file draw_cache_impl_mesh.c.
References Mesh::edit_mesh, and BMEditMesh::mesh_eval_final.
Referenced by mesh_cd_calc_active_mask_uv_layer(), mesh_cd_calc_active_mloopcol_layer(), mesh_cd_calc_active_uv_layer(), mesh_cd_calc_active_vcol_layer(), and mesh_cd_calc_used_gpu_layers().
|
static |
Definition at line 1033 of file draw_cache_impl_mesh.c.
References BLI_assert, MeshBatchCache::cd_needed, DRW_MeshCDMask::edit_uv, mesh_cd_calc_active_mask_uv_layer(), mesh_cd_calc_active_uv_layer(), mesh_cd_calc_edit_uv_layer(), mesh_cd_layers_type_clear(), and mesh_cd_layers_type_merge().
Referenced by DRW_mesh_batch_cache_get_edituv_edges(), DRW_mesh_batch_cache_get_edituv_facedots(), DRW_mesh_batch_cache_get_edituv_faces(), DRW_mesh_batch_cache_get_edituv_faces_stretch_angle(), DRW_mesh_batch_cache_get_edituv_faces_stretch_area(), DRW_mesh_batch_cache_get_edituv_verts(), and DRW_mesh_batch_cache_get_uv_edges().
| BLI_INLINE void mesh_batch_cache_add_request | ( | MeshBatchCache * | cache, |
| DRWBatchFlag | new_flag | ||
| ) |
Definition at line 449 of file draw_cache_impl_mesh.c.
References atomic_fetch_and_or_uint32(), and MeshBatchCache::batch_requested.
Referenced by DRW_mesh_batch_cache_get_all_edges(), DRW_mesh_batch_cache_get_all_verts(), DRW_mesh_batch_cache_get_edge_detection(), DRW_mesh_batch_cache_get_edges_with_select_id(), DRW_mesh_batch_cache_get_edit_edges(), DRW_mesh_batch_cache_get_edit_facedots(), DRW_mesh_batch_cache_get_edit_lnors(), DRW_mesh_batch_cache_get_edit_mesh_analysis(), DRW_mesh_batch_cache_get_edit_skin_roots(), DRW_mesh_batch_cache_get_edit_triangles(), DRW_mesh_batch_cache_get_edit_vertices(), DRW_mesh_batch_cache_get_edit_vnors(), DRW_mesh_batch_cache_get_edituv_edges(), DRW_mesh_batch_cache_get_edituv_facedots(), DRW_mesh_batch_cache_get_edituv_faces(), DRW_mesh_batch_cache_get_edituv_faces_stretch_angle(), DRW_mesh_batch_cache_get_edituv_faces_stretch_area(), DRW_mesh_batch_cache_get_edituv_verts(), DRW_mesh_batch_cache_get_facedots_with_select_id(), DRW_mesh_batch_cache_get_loose_edges(), DRW_mesh_batch_cache_get_sculpt_overlays(), DRW_mesh_batch_cache_get_surface_edges(), DRW_mesh_batch_cache_get_surface_weights(), DRW_mesh_batch_cache_get_triangles_with_select_id(), DRW_mesh_batch_cache_get_uv_edges(), DRW_mesh_batch_cache_get_verts_with_select_id(), DRW_mesh_batch_cache_get_wireframes_face(), and mesh_batch_cache_request_surface_batches().
|
static |
Definition at line 524 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, MeshBatchCache::batch_ready, drw_mesh_weight_state_clear(), drw_mesh_weight_state_compare(), FOREACH_MESH_BUFFER_CACHE, GPU_BATCH_CLEAR_SAFE, GPU_VERTBUF_DISCARD_SAFE, MBC_SURFACE_WEIGHTS, MeshBatchCache::surface_weights, and MeshBatchCache::weight_state.
Referenced by DRW_mesh_batch_cache_create_requested().
|
static |
Definition at line 710 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, batch, Mesh_Runtime::batch_cache, MeshBatchCache::batch_ready, drw_mesh_weight_state_clear(), MeshBatchCache::final, FOREACH_MESH_BUFFER_CACHE, GPU_BATCH_DISCARD_SAFE, GPU_INDEXBUF_DISCARD_SAFE, GPU_VERTBUF_DISCARD_SAFE, GPUBatch, MeshBatchCache::mat_len, MEM_SAFE_FREE, mesh_batch_cache_discard_shaded_tri(), mesh_batch_cache_discard_uvedit(), Mesh::runtime, MeshBatchCache::surface_per_mat, MeshBufferCache::tris_per_mat, and MeshBatchCache::weight_state.
Referenced by DRW_mesh_batch_cache_free(), and DRW_mesh_batch_cache_validate().
|
static |
Definition at line 557 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, MeshBatchCache::cd_used, MeshBatchCache::edituv_edges, MeshBatchCache::edituv_faces, MeshBatchCache::edituv_faces_stretch_angle, MeshBatchCache::edituv_faces_stretch_area, MeshBatchCache::edituv_verts, FOREACH_MESH_BUFFER_CACHE, GPU_BATCH_DISCARD_SAFE, GPU_VERTBUF_DISCARD_SAFE, mesh_batch_cache_discard_surface_batches(), and mesh_cd_layers_type_clear().
Referenced by DRW_mesh_batch_cache_dirty_tag(), DRW_mesh_batch_cache_free_old(), and mesh_batch_cache_clear().
|
static |
Definition at line 548 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, MeshBatchCache::batch_ready, GPU_BATCH_DISCARD_SAFE, MeshBatchCache::mat_len, MBC_SURFACE, MeshBatchCache::surface, and MeshBatchCache::surface_per_mat.
Referenced by DRW_mesh_batch_cache_dirty_tag(), mesh_batch_cache_discard_shaded_tri(), and mesh_batch_cache_discard_uvedit().
|
static |
Definition at line 576 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, MeshBatchCache::batch_ready, MeshBatchCache::cd_used, DRW_MeshCDMask::edit_uv, MeshBatchCache::edituv_edges, MeshBatchCache::edituv_faces, MeshBatchCache::edituv_faces_stretch_angle, MeshBatchCache::edituv_faces_stretch_area, MeshBatchCache::edituv_fdots, MeshBatchCache::edituv_verts, FOREACH_MESH_BUFFER_CACHE, GPU_BATCH_DISCARD_SAFE, GPU_INDEXBUF_DISCARD_SAFE, GPU_VERTBUF_DISCARD_SAFE, MBC_EDITUV, mesh_batch_cache_discard_surface_batches(), MeshBatchCache::tot_area, MeshBatchCache::tot_uv_area, DRW_MeshCDMask::uv, and MeshBatchCache::wire_loops_uvs.
Referenced by DRW_mesh_batch_cache_dirty_tag(), and mesh_batch_cache_clear().
|
static |
Definition at line 611 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, MeshBatchCache::batch_ready, MeshBatchCache::edituv_edges, MeshBatchCache::edituv_faces, MeshBatchCache::edituv_faces_stretch_angle, MeshBatchCache::edituv_faces_stretch_area, MeshBatchCache::edituv_fdots, MeshBatchCache::edituv_verts, FOREACH_MESH_BUFFER_CACHE, GPU_BATCH_DISCARD_SAFE, GPU_INDEXBUF_DISCARD_SAFE, GPU_VERTBUF_DISCARD_SAFE, MBC_EDITUV, and MeshBatchCache::wire_loops_uvs.
Referenced by DRW_mesh_batch_cache_dirty_tag().
|
static |
Definition at line 519 of file draw_cache_impl_mesh.c.
References Mesh_Runtime::batch_cache, and Mesh::runtime.
Referenced by DRW_mesh_batch_cache_create_requested(), DRW_mesh_batch_cache_get_all_edges(), DRW_mesh_batch_cache_get_all_verts(), DRW_mesh_batch_cache_get_edge_detection(), DRW_mesh_batch_cache_get_edges_with_select_id(), DRW_mesh_batch_cache_get_edit_edges(), DRW_mesh_batch_cache_get_edit_facedots(), DRW_mesh_batch_cache_get_edit_lnors(), DRW_mesh_batch_cache_get_edit_mesh_analysis(), DRW_mesh_batch_cache_get_edit_skin_roots(), DRW_mesh_batch_cache_get_edit_triangles(), DRW_mesh_batch_cache_get_edit_vertices(), DRW_mesh_batch_cache_get_edit_vnors(), DRW_mesh_batch_cache_get_edituv_edges(), DRW_mesh_batch_cache_get_edituv_facedots(), DRW_mesh_batch_cache_get_edituv_faces(), DRW_mesh_batch_cache_get_edituv_faces_stretch_angle(), DRW_mesh_batch_cache_get_edituv_faces_stretch_area(), DRW_mesh_batch_cache_get_edituv_verts(), DRW_mesh_batch_cache_get_facedots_with_select_id(), DRW_mesh_batch_cache_get_loose_edges(), DRW_mesh_batch_cache_get_sculpt_overlays(), DRW_mesh_batch_cache_get_surface(), DRW_mesh_batch_cache_get_surface_edges(), DRW_mesh_batch_cache_get_surface_sculpt(), DRW_mesh_batch_cache_get_surface_shaded(), DRW_mesh_batch_cache_get_surface_texpaint(), DRW_mesh_batch_cache_get_surface_texpaint_single(), DRW_mesh_batch_cache_get_surface_vertpaint(), DRW_mesh_batch_cache_get_surface_weights(), DRW_mesh_batch_cache_get_triangles_with_select_id(), DRW_mesh_batch_cache_get_uv_edges(), DRW_mesh_batch_cache_get_verts_with_select_id(), DRW_mesh_batch_cache_get_wireframes_face(), and DRW_mesh_batch_cache_pos_vertbuf_get().
|
static |
Definition at line 479 of file draw_cache_impl_mesh.c.
References Mesh_Runtime::batch_cache, MeshBatchCache::batch_ready, MeshBatchCache::batch_requested, drw_mesh_weight_state_clear(), Mesh::edit_mesh, MeshBatchCache::final, MeshBatchCache::is_dirty, MeshBatchCache::is_editmode, MeshBatchCache::mat_len, MEM_callocN, mesh_render_mat_len_get(), NULL, Mesh::runtime, MeshBatchCache::surface_per_mat, MeshBufferCache::tris_per_mat, and MeshBatchCache::weight_state.
Referenced by DRW_mesh_batch_cache_validate().
|
static |
Definition at line 539 of file draw_cache_impl_mesh.c.
References MeshBatchCache::batch, DRW_batch_request(), MeshBatchCache::mat_len, MBC_SURFACE, mesh_batch_cache_add_request(), MeshBatchCache::surface, and MeshBatchCache::surface_per_mat.
Referenced by DRW_mesh_batch_cache_get_surface(), DRW_mesh_batch_cache_get_surface_sculpt(), DRW_mesh_batch_cache_get_surface_shaded(), DRW_mesh_batch_cache_get_surface_texpaint(), DRW_mesh_batch_cache_get_surface_texpaint_single(), DRW_mesh_batch_cache_get_surface_vertpaint(), and DRW_mesh_batch_cache_pos_vertbuf_get().
|
static |
Definition at line 456 of file draw_cache_impl_mesh.c.
References Mesh_Runtime::batch_cache, Mesh::edit_mesh, MeshBatchCache::is_dirty, MeshBatchCache::is_editmode, MeshBatchCache::mat_len, mesh_render_mat_len_get(), NULL, and Mesh::runtime.
Referenced by DRW_mesh_batch_cache_validate().
|
static |
Definition at line 150 of file draw_cache_impl_mesh.c.
References CD_MLOOPUV, CustomData_get_stencil_layer(), editmesh_final_or_this(), mesh_cd_ldata_get_from_mesh(), and DRW_MeshCDMask::uv.
Referenced by edituv_request_active_uv(), and texpaint_request_active_uv().
|
static |
Definition at line 171 of file draw_cache_impl_mesh.c.
References CD_MLOOPCOL, CustomData_get_active_layer(), editmesh_final_or_this(), mesh_cd_ldata_get_from_mesh(), and DRW_MeshCDMask::vcol.
Referenced by texpaint_request_active_vcol().
|
static |
Definition at line 140 of file draw_cache_impl_mesh.c.
References CD_MLOOPUV, CustomData_get_active_layer(), editmesh_final_or_this(), mesh_cd_ldata_get_from_mesh(), and DRW_MeshCDMask::uv.
Referenced by edituv_request_active_uv(), and texpaint_request_active_uv().
|
static |
Definition at line 160 of file draw_cache_impl_mesh.c.
References CD_PROP_COLOR, CustomData_get_active_layer(), editmesh_final_or_this(), mesh_cd_vdata_get_from_mesh(), and DRW_MeshCDMask::sculpt_vcol.
Referenced by sculpt_request_active_vcol().
|
static |
Definition at line 105 of file draw_cache_impl_mesh.c.
References DRW_MeshCDMask::edit_uv.
Referenced by edituv_request_active_uv().
|
static |
Definition at line 182 of file draw_cache_impl_mesh.c.
References CD_AUTO_FROM_NAME, CD_MCOL, CD_MLOOPCOL, CD_MLOOPUV, CD_MTFACE, CD_ORCO, CD_PROP_COLOR, CD_TANGENT, CustomData_get_named_layer(), CustomData_get_render_layer(), editmesh_final_or_this(), GPU_material_attributes(), LISTBASE_FOREACH, mesh_cd_layers_type_clear(), mesh_cd_ldata_get_from_mesh(), mesh_cd_vdata_get_from_mesh(), DRW_MeshCDMask::orco, DRW_MeshCDMask::sculpt_vcol, DRW_MeshCDMask::tan, DRW_MeshCDMask::tan_orco, type, DRW_MeshCDMask::uv, and DRW_MeshCDMask::vcol.
Referenced by DRW_mesh_batch_cache_get_surface_shaded().
| BLI_INLINE void mesh_cd_layers_type_clear | ( | DRW_MeshCDMask * | a | ) |
Definition at line 95 of file draw_cache_impl_mesh.c.
References Freestyle::a.
Referenced by DRW_mesh_batch_cache_create_requested(), DRW_mesh_batch_cache_free_old(), edituv_request_active_uv(), mesh_batch_cache_discard_shaded_tri(), mesh_cd_calc_used_gpu_layers(), sculpt_request_active_vcol(), texpaint_request_active_uv(), and texpaint_request_active_vcol().
| BLI_INLINE bool mesh_cd_layers_type_equal | ( | DRW_MeshCDMask | a, |
| DRW_MeshCDMask | b | ||
| ) |
Definition at line 82 of file draw_cache_impl_mesh.c.
References Freestyle::a.
Referenced by DRW_mesh_batch_cache_free_old().
| BLI_INLINE void mesh_cd_layers_type_merge | ( | DRW_MeshCDMask * | a, |
| DRW_MeshCDMask | b | ||
| ) |
Definition at line 87 of file draw_cache_impl_mesh.c.
References Freestyle::a, and atomic_fetch_and_or_uint32().
Referenced by DRW_mesh_batch_cache_create_requested(), DRW_mesh_batch_cache_get_surface_shaded(), edituv_request_active_uv(), sculpt_request_active_vcol(), texpaint_request_active_uv(), and texpaint_request_active_vcol().
| BLI_INLINE bool mesh_cd_layers_type_overlap | ( | DRW_MeshCDMask | a, |
| DRW_MeshCDMask | b | ||
| ) |
Definition at line 77 of file draw_cache_impl_mesh.c.
References Freestyle::a.
Referenced by DRW_mesh_batch_cache_create_requested().
| BLI_INLINE const CustomData* mesh_cd_ldata_get_from_mesh | ( | const Mesh * | me | ) |
Definition at line 110 of file draw_cache_impl_mesh.c.
References BLI_assert, BMEditMesh::bm, Mesh::edit_mesh, BMesh::ldata, Mesh::ldata, ME_WRAPPER_TYPE_BMESH, ME_WRAPPER_TYPE_MDATA, Mesh::runtime, and Mesh_Runtime::wrapper_type.
Referenced by mesh_cd_calc_active_mask_uv_layer(), mesh_cd_calc_active_mloopcol_layer(), mesh_cd_calc_active_uv_layer(), and mesh_cd_calc_used_gpu_layers().
| BLI_INLINE const CustomData* mesh_cd_vdata_get_from_mesh | ( | const Mesh * | me | ) |
Definition at line 125 of file draw_cache_impl_mesh.c.
References BLI_assert, BMEditMesh::bm, Mesh::edit_mesh, ME_WRAPPER_TYPE_BMESH, ME_WRAPPER_TYPE_MDATA, Mesh::runtime, BMesh::vdata, and Mesh_Runtime::wrapper_type.
Referenced by mesh_cd_calc_active_vcol_layer(), and mesh_cd_calc_used_gpu_layers().
|
static |
Definition at line 783 of file draw_cache_impl_mesh.c.
References BLI_assert, MeshBatchCache::cd_needed, mesh_cd_calc_active_vcol_layer(), mesh_cd_layers_type_clear(), mesh_cd_layers_type_merge(), and DRW_MeshCDMask::sculpt_vcol.
Referenced by DRW_mesh_batch_cache_get_surface_sculpt().
|
static |
Definition at line 758 of file draw_cache_impl_mesh.c.
References BLI_assert, MeshBatchCache::cd_needed, mesh_cd_calc_active_mask_uv_layer(), mesh_cd_calc_active_uv_layer(), mesh_cd_layers_type_clear(), mesh_cd_layers_type_merge(), and DRW_MeshCDMask::uv.
Referenced by DRW_mesh_batch_cache_get_surface_edges(), DRW_mesh_batch_cache_get_surface_texpaint(), and DRW_mesh_batch_cache_get_surface_texpaint_single().
|
static |
Definition at line 771 of file draw_cache_impl_mesh.c.
References BLI_assert, MeshBatchCache::cd_needed, mesh_cd_calc_active_mloopcol_layer(), mesh_cd_layers_type_clear(), mesh_cd_layers_type_merge(), and DRW_MeshCDMask::vcol.
Referenced by DRW_mesh_batch_cache_get_surface_vertpaint().