Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_cache_impl_mesh.c
| Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | ||||||||||
| #include "BKE_editmesh.h" | #include "BKE_editmesh.h" | |||||||||
| #include "BKE_editmesh_cache.h" | #include "BKE_editmesh_cache.h" | |||||||||
| #include "BKE_editmesh_tangent.h" | #include "BKE_editmesh_tangent.h" | |||||||||
| #include "BKE_mesh.h" | #include "BKE_mesh.h" | |||||||||
| #include "BKE_mesh_runtime.h" | #include "BKE_mesh_runtime.h" | |||||||||
| #include "BKE_mesh_tangent.h" | #include "BKE_mesh_tangent.h" | |||||||||
| #include "BKE_modifier.h" | #include "BKE_modifier.h" | |||||||||
| #include "BKE_object_deform.h" | #include "BKE_object_deform.h" | |||||||||
| #include "BKE_paint.h" | ||||||||||
| #include "BKE_pbvh.h" | ||||||||||
| #include "atomic_ops.h" | #include "atomic_ops.h" | |||||||||
| #include "bmesh.h" | #include "bmesh.h" | |||||||||
| #include "GPU_batch.h" | #include "GPU_batch.h" | |||||||||
| #include "GPU_material.h" | #include "GPU_material.h" | |||||||||
| ▲ Show 20 Lines • Show All 1,116 Lines • ▼ Show 20 Lines | void DRW_mesh_batch_cache_create_requested(struct TaskGraph *task_graph, | |||||||||
| BLI_assert(task_graph); | BLI_assert(task_graph); | |||||||||
| const ToolSettings *ts = NULL; | const ToolSettings *ts = NULL; | |||||||||
| if (scene) { | if (scene) { | |||||||||
| ts = scene->toolsettings; | ts = scene->toolsettings; | |||||||||
| } | } | |||||||||
| MeshBatchCache *cache = mesh_batch_cache_get(me); | MeshBatchCache *cache = mesh_batch_cache_get(me); | |||||||||
| bool cd_uv_update = false; | bool cd_uv_update = false; | |||||||||
| /* TODO(pablodp606): This always updates the sculpt normal on each redraw both for PBVH and | ||||||||||
sergeyUnsubmitted Not Done Inline Actions
sergey: | ||||||||||
| * regular drawing. This makes tools that sample the surface per step get wrong normals until a | ||||||||||
| * redraw happens. Normal updates should be part of the brush loop and only run during the stroke | ||||||||||
| * when the brush needs to sample the surface. The drawing code should only update the normals | ||||||||||
| * per redraw when smooth shading is enabled. */ | ||||||||||
| /* This also adds a entire PBVH tree traversal per redraw even when the stroke is not active, | ||||||||||
| * which is bad for performance. */ | ||||||||||
sergeyUnsubmitted Not Done Inline Actions
sergey: | ||||||||||
| const bool do_update_sculpt_normals = ob->sculpt && ob->sculpt->pbvh; | ||||||||||
| if (do_update_sculpt_normals) { | ||||||||||
| Mesh *mesh = ob->data; | ||||||||||
| BKE_pbvh_update_normals(ob->sculpt->pbvh, mesh->runtime.subdiv_ccg); | ||||||||||
| } | ||||||||||
| /* Early out */ | /* Early out */ | |||||||||
| if (cache->batch_requested == 0) { | if (cache->batch_requested == 0) { | |||||||||
| #ifdef DEBUG | #ifdef DEBUG | |||||||||
| drw_mesh_batch_cache_check_available(task_graph, me); | drw_mesh_batch_cache_check_available(task_graph, me); | |||||||||
| #endif | #endif | |||||||||
| return; | return; | |||||||||
| } | } | |||||||||
| ▲ Show 20 Lines • Show All 382 Lines • Show Last 20 Lines | ||||||||||