Merge branch 'blender-v3.0-release'
This commit is contained in:
commit
70a0d45b69
|
@ -591,12 +591,16 @@ static void drw_shgroup_bone_custom_wire(ArmatureDrawContext *ctx,
|
|||
const float color[4],
|
||||
Object *custom)
|
||||
{
|
||||
/* See comments in #drw_shgroup_bone_custom_solid. */
|
||||
Mesh *mesh = BKE_object_get_evaluated_mesh(custom);
|
||||
if (mesh == NULL) {
|
||||
return;
|
||||
}
|
||||
/* TODO(fclem): arg... less than ideal but we never iter on this object
|
||||
* to assure batch cache is valid. */
|
||||
drw_batch_cache_validate(custom);
|
||||
|
||||
struct GPUBatch *geom = DRW_cache_object_all_edges_get(custom);
|
||||
DRW_mesh_batch_cache_validate(mesh);
|
||||
|
||||
struct GPUBatch *geom = DRW_mesh_batch_cache_get_all_edges(mesh);
|
||||
if (geom) {
|
||||
DRWCallBuffer *buf = custom_bone_instance_shgroup(ctx, ctx->custom_wire, geom);
|
||||
BoneInstanceData inst_data;
|
||||
|
|
|
@ -3450,6 +3450,25 @@ void drw_batch_cache_generate_requested(Object *ob)
|
|||
}
|
||||
}
|
||||
|
||||
/* Note: Logic here is duplicated from #drw_batch_cache_generate_requested. */
|
||||
void drw_batch_cache_generate_requested_evaluated_mesh(Object *ob)
|
||||
{
|
||||
const DRWContextState *draw_ctx = DRW_context_state_get();
|
||||
const Scene *scene = draw_ctx->scene;
|
||||
const enum eContextObjectMode mode = CTX_data_mode_enum_ex(
|
||||
draw_ctx->object_edit, draw_ctx->obact, draw_ctx->object_mode);
|
||||
const bool is_paint_mode = ELEM(
|
||||
mode, CTX_MODE_SCULPT, CTX_MODE_PAINT_TEXTURE, CTX_MODE_PAINT_VERTEX, CTX_MODE_PAINT_WEIGHT);
|
||||
|
||||
const bool use_hide = ((ob->type == OB_MESH) &&
|
||||
((is_paint_mode && (ob == draw_ctx->obact) &&
|
||||
DRW_object_use_hide_faces(ob)) ||
|
||||
((mode == CTX_MODE_EDIT_MESH) && DRW_object_is_in_edit_mode(ob))));
|
||||
|
||||
Mesh *mesh = BKE_object_get_evaluated_mesh(ob);
|
||||
DRW_mesh_batch_cache_create_requested(DST.task_graph, ob, mesh, scene, is_paint_mode, use_hide);
|
||||
}
|
||||
|
||||
void drw_batch_cache_generate_requested_delayed(Object *ob)
|
||||
{
|
||||
BLI_gset_add(DST.delayed_extraction, ob);
|
||||
|
|
|
@ -173,7 +173,8 @@ static void drw_task_graph_deinit(void)
|
|||
{
|
||||
BLI_task_graph_work_and_wait(DST.task_graph);
|
||||
|
||||
BLI_gset_free(DST.delayed_extraction, (void (*)(void *key))drw_batch_cache_generate_requested);
|
||||
BLI_gset_free(DST.delayed_extraction,
|
||||
(void (*)(void *key))drw_batch_cache_generate_requested_evaluated_mesh);
|
||||
DST.delayed_extraction = NULL;
|
||||
BLI_task_graph_work_and_wait(DST.task_graph);
|
||||
|
||||
|
|
|
@ -663,7 +663,12 @@ eDRWCommandType command_type_get(const uint64_t *command_type_bits, int index);
|
|||
|
||||
void drw_batch_cache_validate(Object *ob);
|
||||
void drw_batch_cache_generate_requested(struct Object *ob);
|
||||
|
||||
/**
|
||||
* \warning Only evaluated mesh data is handled by this delayed generation.
|
||||
*/
|
||||
void drw_batch_cache_generate_requested_delayed(Object *ob);
|
||||
void drw_batch_cache_generate_requested_evaluated_mesh(Object *ob);
|
||||
|
||||
void drw_resource_buffer_finish(DRWData *vmempool);
|
||||
|
||||
|
|
Loading…
Reference in New Issue