Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_cache_impl_mesh.c
| Show First 20 Lines • Show All 1,940 Lines • ▼ Show 20 Lines | struct { | ||||
| GPUVertBuf *pos_nor; | GPUVertBuf *pos_nor; | ||||
| GPUVertBuf *weights; | GPUVertBuf *weights; | ||||
| /* Loop data. */ | /* Loop data. */ | ||||
| GPUVertBuf *loop_pos_nor; | GPUVertBuf *loop_pos_nor; | ||||
| GPUVertBuf *loop_uv_tan; | GPUVertBuf *loop_uv_tan; | ||||
| GPUVertBuf *loop_vcol; | GPUVertBuf *loop_vcol; | ||||
| GPUVertBuf *loop_edge_fac; | GPUVertBuf *loop_edge_fac; | ||||
| GPUVertBuf *loop_orco; | GPUVertBuf *loop_orco; | ||||
| GPUVertBuf *loop_mesh_analysis; | |||||
| } ordered; | } ordered; | ||||
| /* Edit Mesh Data: | /* Edit Mesh Data: | ||||
| * Edit cage can be different from final mesh so vertex count | * Edit cage can be different from final mesh so vertex count | ||||
| * might differ. */ | * might differ. */ | ||||
| struct { | struct { | ||||
| /* TODO(fclem): Reuse ordered.loop_pos_nor and maybe even | /* TODO(fclem): Reuse ordered.loop_pos_nor and maybe even | ||||
| * ordered.loop_uv_tan when cage match final mesh. */ | * ordered.loop_uv_tan when cage match final mesh. */ | ||||
| GPUVertBuf *loop_pos_nor; | GPUVertBuf *loop_pos_nor; | ||||
| GPUVertBuf *loop_data; | GPUVertBuf *loop_data; | ||||
| GPUVertBuf *loop_lnor; | GPUVertBuf *loop_lnor; | ||||
| GPUVertBuf *facedots_pos_nor_data; | GPUVertBuf *facedots_pos_nor_data; | ||||
| GPUVertBuf *loop_mesh_analysis; | |||||
| /* UV data without modifier applied. | /* UV data without modifier applied. | ||||
| * Vertex count is always the one of the cage. */ | * Vertex count is always the one of the cage. */ | ||||
| GPUVertBuf *loop_uv; | GPUVertBuf *loop_uv; | ||||
| GPUVertBuf *loop_uv_data; | GPUVertBuf *loop_uv_data; | ||||
| GPUVertBuf *loop_stretch_angle; | GPUVertBuf *loop_stretch_angle; | ||||
| GPUVertBuf *loop_stretch_area; | GPUVertBuf *loop_stretch_area; | ||||
| GPUVertBuf *facedots_uv; | GPUVertBuf *facedots_uv; | ||||
| GPUVertBuf *facedots_uv_data; | GPUVertBuf *facedots_uv_data; | ||||
| ▲ Show 20 Lines • Show All 3,113 Lines • ▼ Show 20 Lines | if (DRW_batch_requested(cache->batch.edit_lnor, GPU_PRIM_POINTS)) { | ||||
| DRW_vbo_request(cache->batch.edit_lnor, &cache->edit.loop_lnor); | DRW_vbo_request(cache->batch.edit_lnor, &cache->edit.loop_lnor); | ||||
| } | } | ||||
| if (DRW_batch_requested(cache->batch.edit_facedots, GPU_PRIM_POINTS)) { | if (DRW_batch_requested(cache->batch.edit_facedots, GPU_PRIM_POINTS)) { | ||||
| DRW_vbo_request(cache->batch.edit_facedots, &cache->edit.facedots_pos_nor_data); | DRW_vbo_request(cache->batch.edit_facedots, &cache->edit.facedots_pos_nor_data); | ||||
| } | } | ||||
| /* Mesh Analysis */ | /* Mesh Analysis */ | ||||
| if (DRW_batch_requested(cache->batch.edit_mesh_analysis, GPU_PRIM_TRIS)) { | if (DRW_batch_requested(cache->batch.edit_mesh_analysis, GPU_PRIM_TRIS)) { | ||||
| DRW_ibo_request(cache->batch.edit_mesh_analysis, &cache->ibo.edit_loops_tris); | DRW_ibo_request(cache->batch.edit_mesh_analysis, &cache->ibo.loops_tris); | ||||
| DRW_vbo_request(cache->batch.edit_mesh_analysis, &cache->edit.loop_pos_nor); | DRW_vbo_request(cache->batch.edit_mesh_analysis, &cache->ordered.loop_pos_nor); | ||||
| DRW_vbo_request(cache->batch.edit_mesh_analysis, &cache->edit.loop_mesh_analysis); | DRW_vbo_request(cache->batch.edit_mesh_analysis, &cache->ordered.loop_mesh_analysis); | ||||
| } | } | ||||
| /* Edit UV */ | /* Edit UV */ | ||||
| if (DRW_batch_requested(cache->batch.edituv_faces, GPU_PRIM_TRI_FAN)) { | if (DRW_batch_requested(cache->batch.edituv_faces, GPU_PRIM_TRI_FAN)) { | ||||
| DRW_ibo_request(cache->batch.edituv_faces, &cache->ibo.edituv_loops_tri_fans); | DRW_ibo_request(cache->batch.edituv_faces, &cache->ibo.edituv_loops_tri_fans); | ||||
| DRW_vbo_request(cache->batch.edituv_faces, &cache->edit.loop_uv); | DRW_vbo_request(cache->batch.edituv_faces, &cache->edit.loop_uv); | ||||
| DRW_vbo_request(cache->batch.edituv_faces, &cache->edit.loop_uv_data); | DRW_vbo_request(cache->batch.edituv_faces, &cache->edit.loop_uv_data); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | DRW_ADD_FLAG_FROM_VBO_REQUEST( | ||||
| mr_edit_flag, cache->edit.loop_uv_data, combined_edit_flag | MR_DATATYPE_OVERLAY); | mr_edit_flag, cache->edit.loop_uv_data, combined_edit_flag | MR_DATATYPE_OVERLAY); | ||||
| DRW_ADD_FLAG_FROM_VBO_REQUEST( | DRW_ADD_FLAG_FROM_VBO_REQUEST( | ||||
| mr_edit_flag, cache->edit.loop_uv, combined_edituv_flag | MR_DATATYPE_OVERLAY); | mr_edit_flag, cache->edit.loop_uv, combined_edituv_flag | MR_DATATYPE_OVERLAY); | ||||
| DRW_ADD_FLAG_FROM_VBO_REQUEST( | DRW_ADD_FLAG_FROM_VBO_REQUEST( | ||||
| mr_edit_flag, cache->edit.loop_stretch_angle, combined_edit_flag | MR_DATATYPE_OVERLAY); | mr_edit_flag, cache->edit.loop_stretch_angle, combined_edit_flag | MR_DATATYPE_OVERLAY); | ||||
| DRW_ADD_FLAG_FROM_VBO_REQUEST( | DRW_ADD_FLAG_FROM_VBO_REQUEST( | ||||
| mr_edit_flag, cache->edit.loop_stretch_area, combined_edit_flag | MR_DATATYPE_OVERLAY); | mr_edit_flag, cache->edit.loop_stretch_area, combined_edit_flag | MR_DATATYPE_OVERLAY); | ||||
| DRW_ADD_FLAG_FROM_VBO_REQUEST( | DRW_ADD_FLAG_FROM_VBO_REQUEST( | ||||
| mr_edit_flag, cache->edit.loop_mesh_analysis, MR_DATATYPE_VERT_LOOP_POLY); | mr_edit_flag, cache->ordered.loop_mesh_analysis, MR_DATATYPE_VERT_LOOP_POLY); | ||||
| DRW_ADD_FLAG_FROM_VBO_REQUEST(mr_edit_flag, cache->edit.loop_vert_idx, combined_edit_flag); | DRW_ADD_FLAG_FROM_VBO_REQUEST(mr_edit_flag, cache->edit.loop_vert_idx, combined_edit_flag); | ||||
| DRW_ADD_FLAG_FROM_VBO_REQUEST(mr_edit_flag, cache->edit.loop_edge_idx, combined_edit_flag); | DRW_ADD_FLAG_FROM_VBO_REQUEST(mr_edit_flag, cache->edit.loop_edge_idx, combined_edit_flag); | ||||
| DRW_ADD_FLAG_FROM_VBO_REQUEST(mr_edit_flag, cache->edit.loop_face_idx, combined_edit_flag); | DRW_ADD_FLAG_FROM_VBO_REQUEST(mr_edit_flag, cache->edit.loop_face_idx, combined_edit_flag); | ||||
| DRW_ADD_FLAG_FROM_VBO_REQUEST(mr_edit_flag, cache->edit.facedots_idx, MR_DATATYPE_POLY); | DRW_ADD_FLAG_FROM_VBO_REQUEST(mr_edit_flag, cache->edit.facedots_idx, MR_DATATYPE_POLY); | ||||
| DRW_ADD_FLAG_FROM_VBO_REQUEST( | DRW_ADD_FLAG_FROM_VBO_REQUEST( | ||||
| mr_edit_flag, cache->edit.facedots_pos_nor_data, MR_DATATYPE_POLY | MR_DATATYPE_OVERLAY); | mr_edit_flag, cache->edit.facedots_pos_nor_data, MR_DATATYPE_POLY | MR_DATATYPE_OVERLAY); | ||||
| ▲ Show 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | #endif | ||||
| if (DRW_ibo_requested(cache->ibo.edit_loops_points) || | if (DRW_ibo_requested(cache->ibo.edit_loops_points) || | ||||
| DRW_ibo_requested(cache->ibo.edit_loops_lines)) { | DRW_ibo_requested(cache->ibo.edit_loops_lines)) { | ||||
| mesh_create_edit_loops_points_lines( | mesh_create_edit_loops_points_lines( | ||||
| rdata, cache->ibo.edit_loops_points, cache->ibo.edit_loops_lines); | rdata, cache->ibo.edit_loops_points, cache->ibo.edit_loops_lines); | ||||
| } | } | ||||
| if (DRW_ibo_requested(cache->ibo.edit_loops_tris)) { | if (DRW_ibo_requested(cache->ibo.edit_loops_tris)) { | ||||
| mesh_create_edit_loops_tris(rdata, cache->ibo.edit_loops_tris); | mesh_create_edit_loops_tris(rdata, cache->ibo.edit_loops_tris); | ||||
| } | } | ||||
| if (DRW_vbo_requested(cache->edit.loop_mesh_analysis)) { | if (DRW_vbo_requested(cache->ordered.loop_mesh_analysis)) { | ||||
| mesh_create_edit_mesh_analysis(rdata, cache->edit.loop_mesh_analysis); | mesh_create_edit_mesh_analysis(rdata, cache->ordered.loop_mesh_analysis); | ||||
| } | } | ||||
| /* UV editor */ | /* UV editor */ | ||||
| /** | /** | ||||
| * TODO: The code and data structure is ready to support modified UV display | * 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 | * but the selection code for UVs needs to support it first. So for now, only | ||||
| * display the cage in all cases. | * display the cage in all cases. | ||||
| */ | */ | ||||
| Show All 39 Lines | |||||