Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_cache_extract.hh
| Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
| /* DRW_MeshWeightState.flags */ | /* DRW_MeshWeightState.flags */ | ||||
| enum { | enum { | ||||
| DRW_MESH_WEIGHT_STATE_MULTIPAINT = (1 << 0), | DRW_MESH_WEIGHT_STATE_MULTIPAINT = (1 << 0), | ||||
| DRW_MESH_WEIGHT_STATE_AUTO_NORMALIZE = (1 << 1), | DRW_MESH_WEIGHT_STATE_AUTO_NORMALIZE = (1 << 1), | ||||
| DRW_MESH_WEIGHT_STATE_LOCK_RELATIVE = (1 << 2), | DRW_MESH_WEIGHT_STATE_LOCK_RELATIVE = (1 << 2), | ||||
| }; | }; | ||||
| struct DRW_MeshCDMask { | |||||
| uint32_t uv : 8; | |||||
| uint32_t tan : 8; | |||||
| uint32_t orco : 1; | |||||
| uint32_t tan_orco : 1; | |||||
| uint32_t sculpt_overlays : 1; | |||||
| /** | |||||
| * Edit uv layer is from the base edit mesh as modifiers could remove it. (see T68857) | |||||
| */ | |||||
| uint32_t edit_uv : 1; | |||||
| }; | |||||
| /* Keep `DRW_MeshCDMask` struct within a `uint32_t`. | |||||
| * bit-wise and atomic operations are used to compare and update the struct. | |||||
| * See `mesh_cd_layers_type_*` functions. */ | |||||
| BLI_STATIC_ASSERT(sizeof(DRW_MeshCDMask) <= sizeof(uint32_t), "DRW_MeshCDMask exceeds 32 bits") | |||||
| enum eMRIterType { | enum eMRIterType { | ||||
| MR_ITER_LOOPTRI = 1 << 0, | MR_ITER_LOOPTRI = 1 << 0, | ||||
| MR_ITER_POLY = 1 << 1, | MR_ITER_POLY = 1 << 1, | ||||
| MR_ITER_LEDGE = 1 << 2, | MR_ITER_LEDGE = 1 << 2, | ||||
| MR_ITER_LVERT = 1 << 3, | MR_ITER_LVERT = 1 << 3, | ||||
| }; | }; | ||||
| ENUM_OPERATORS(eMRIterType, MR_ITER_LVERT) | ENUM_OPERATORS(eMRIterType, MR_ITER_LVERT) | ||||
| ▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | struct { | ||||
| GPUVertBuf *fdots_edituv_data; | GPUVertBuf *fdots_edituv_data; | ||||
| GPUVertBuf *skin_roots; | GPUVertBuf *skin_roots; | ||||
| /* Selection */ | /* Selection */ | ||||
| GPUVertBuf *vert_idx; /* extend */ | GPUVertBuf *vert_idx; /* extend */ | ||||
| GPUVertBuf *edge_idx; /* extend */ | GPUVertBuf *edge_idx; /* extend */ | ||||
| GPUVertBuf *poly_idx; | GPUVertBuf *poly_idx; | ||||
| GPUVertBuf *fdot_idx; | GPUVertBuf *fdot_idx; | ||||
| GPUVertBuf *attr[GPU_MAX_ATTR]; | GPUVertBuf *attr[GPU_MAX_ATTR]; | ||||
| GPUVertBuf *attr_viewer; | |||||
| } vbo; | } vbo; | ||||
| /* Index Buffers: | /* Index Buffers: | ||||
| * Only need to be updated when topology changes. */ | * Only need to be updated when topology changes. */ | ||||
| struct { | struct { | ||||
| /* Indices to vloops. Ordered per material. */ | /* Indices to vloops. Ordered per material. */ | ||||
| GPUIndexBuf *tris; | GPUIndexBuf *tris; | ||||
| /* Loose edges last. */ | /* Loose edges last. */ | ||||
| GPUIndexBuf *lines; | GPUIndexBuf *lines; | ||||
| ▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | struct MeshBatchList { | ||||
| GPUBatch *edge_detection; | GPUBatch *edge_detection; | ||||
| /* Individual edges with face normals. */ | /* Individual edges with face normals. */ | ||||
| GPUBatch *wire_edges; | GPUBatch *wire_edges; | ||||
| /* Loops around faces. no edges between selected faces */ | /* Loops around faces. no edges between selected faces */ | ||||
| GPUBatch *wire_loops; | GPUBatch *wire_loops; | ||||
| /* Same as wire_loops but only has uvs. */ | /* Same as wire_loops but only has uvs. */ | ||||
| GPUBatch *wire_loops_uvs; | GPUBatch *wire_loops_uvs; | ||||
| GPUBatch *sculpt_overlays; | GPUBatch *sculpt_overlays; | ||||
| GPUBatch *surface_viewer_attribute; | |||||
| }; | }; | ||||
| #define MBC_BATCH_LEN (sizeof(MeshBatchList) / sizeof(void *)) | #define MBC_BATCH_LEN (sizeof(MeshBatchList) / sizeof(void *)) | ||||
| #define MBC_VBO_LEN (sizeof(MeshBufferList::vbo) / sizeof(void *)) | #define MBC_VBO_LEN (sizeof(MeshBufferList::vbo) / sizeof(void *)) | ||||
| #define MBC_IBO_LEN (sizeof(MeshBufferList::ibo) / sizeof(void *)) | #define MBC_IBO_LEN (sizeof(MeshBufferList::ibo) / sizeof(void *)) | ||||
| #define MBC_BATCH_INDEX(batch) (offsetof(MeshBatchList, batch) / sizeof(void *)) | #define MBC_BATCH_INDEX(batch) (offsetof(MeshBatchList, batch) / sizeof(void *)) | ||||
| Show All 21 Lines | enum DRWBatchFlag { | ||||
| MBC_ALL_VERTS = (1u << MBC_BATCH_INDEX(all_verts)), | MBC_ALL_VERTS = (1u << MBC_BATCH_INDEX(all_verts)), | ||||
| MBC_ALL_EDGES = (1u << MBC_BATCH_INDEX(all_edges)), | MBC_ALL_EDGES = (1u << MBC_BATCH_INDEX(all_edges)), | ||||
| MBC_LOOSE_EDGES = (1u << MBC_BATCH_INDEX(loose_edges)), | MBC_LOOSE_EDGES = (1u << MBC_BATCH_INDEX(loose_edges)), | ||||
| MBC_EDGE_DETECTION = (1u << MBC_BATCH_INDEX(edge_detection)), | MBC_EDGE_DETECTION = (1u << MBC_BATCH_INDEX(edge_detection)), | ||||
| MBC_WIRE_EDGES = (1u << MBC_BATCH_INDEX(wire_edges)), | MBC_WIRE_EDGES = (1u << MBC_BATCH_INDEX(wire_edges)), | ||||
| MBC_WIRE_LOOPS = (1u << MBC_BATCH_INDEX(wire_loops)), | MBC_WIRE_LOOPS = (1u << MBC_BATCH_INDEX(wire_loops)), | ||||
| MBC_WIRE_LOOPS_UVS = (1u << MBC_BATCH_INDEX(wire_loops_uvs)), | MBC_WIRE_LOOPS_UVS = (1u << MBC_BATCH_INDEX(wire_loops_uvs)), | ||||
| MBC_SCULPT_OVERLAYS = (1u << MBC_BATCH_INDEX(sculpt_overlays)), | MBC_SCULPT_OVERLAYS = (1u << MBC_BATCH_INDEX(sculpt_overlays)), | ||||
| MBC_VIEWER_ATTRIBUTE_OVERLAY = (1u << MBC_BATCH_INDEX(surface_viewer_attribute)), | |||||
| MBC_SURFACE_PER_MAT = (1u << MBC_BATCH_LEN), | MBC_SURFACE_PER_MAT = (1u << MBC_BATCH_LEN), | ||||
| }; | }; | ||||
| ENUM_OPERATORS(DRWBatchFlag, MBC_SURFACE_PER_MAT); | ENUM_OPERATORS(DRWBatchFlag, MBC_SURFACE_PER_MAT); | ||||
| BLI_STATIC_ASSERT(MBC_BATCH_LEN < 32, "Number of batches exceeded the limit of bit fields"); | BLI_STATIC_ASSERT(MBC_BATCH_LEN < 32, "Number of batches exceeded the limit of bit fields"); | ||||
| struct MeshExtractLooseGeom { | struct MeshExtractLooseGeom { | ||||
| int edge_len; | int edge_len; | ||||
| ▲ Show 20 Lines • Show All 105 Lines • Show Last 20 Lines | |||||