Merge branch 'blender-v4.5-release'

This commit is contained in:
Sergey Sharybin
2025-06-26 17:33:28 +02:00
5 changed files with 28 additions and 18 deletions

View File

@@ -699,6 +699,13 @@ void Instance::draw_viewport()
info_append_i18n("Compiling EEVEE engine shaders");
DRW_viewport_request_redraw();
}
/* Do not swap if the velocity module didn't go through a full sync cycle. */
if (!is_loaded(needed_shaders)) {
/* The velocity module can reference some gpu::Batch. Calling this function
* make sure we release these references and don't de-reference them later as
* they might have been freed. */
velocity.step_swap();
}
return;
}

View File

@@ -358,7 +358,10 @@ void mesh_buffer_cache_create_requested_subdiv(MeshBatchCache &cache,
if (vbos_to_create.contains(VBOType::Position) || vbos_to_create.contains(VBOType::Orco)) {
gpu::VertBufPtr orco_vbo;
buffers.vbos.add_new(
/* Don't use `add_new` because #VBOType::Orco might be requested after #VBOType::Position
* already exists. It's inefficient to build the position VBO a second time but that's the API
* that GPU subdivision provides. */
buffers.vbos.add(
VBOType::Position,
extract_positions_subdiv(
subdiv_cache, mr, vbos_to_create.contains(VBOType::Orco) ? &orco_vbo : nullptr));

View File

@@ -282,7 +282,12 @@ bool DRW_object_is_renderable(const Object *ob)
if (ob->type == OB_MESH) {
DRWContext &draw_ctx = drw_get();
if ((ob == draw_ctx.object_edit) || ob->mode == OB_MODE_EDIT) {
/* The evaluated object might be a mesh even though the original object has a different type.
* Also make sure the original object is a mesh (see #140762). */
if (draw_ctx.object_edit && draw_ctx.object_edit->type != OB_MESH) {
/* Noop. */
}
else if ((ob == draw_ctx.object_edit) || ob->mode == OB_MODE_EDIT) {
View3D *v3d = draw_ctx.v3d;
if (v3d && ((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) && RETOPOLOGY_ENABLED(v3d)) {
return false;

View File

@@ -101,20 +101,6 @@ static void execute_read_sound_waveform_task(TaskPool *__restrict task_pool, voi
BKE_sound_read_waveform(audio_job->bmain, audio_job->sound, task->stop);
}
static void push_preview_job_audio_task(TaskPool *__restrict task_pool,
PreviewJob *pj,
PreviewJobAudio *previewjb,
bool *stop)
{
ReadSoundWaveformTask *task = MEM_callocN<ReadSoundWaveformTask>("read sound waveform task");
task->wm_job = pj;
task->preview_job_audio = previewjb;
task->stop = stop;
BLI_task_pool_push(
task_pool, execute_read_sound_waveform_task, task, true, free_read_sound_waveform_task);
}
/* Only this runs inside thread. */
static void preview_startjob(void *data, wmJobWorkerStatus *worker_status)
{
@@ -160,13 +146,23 @@ static void preview_startjob(void *data, wmJobWorkerStatus *worker_status)
break;
}
Vector<ReadSoundWaveformTask *> new_tasks;
LISTBASE_FOREACH_MUTABLE (PreviewJobAudio *, previewjb, &pj->previews) {
push_preview_job_audio_task(task_pool, pj, previewjb, &worker_status->stop);
ReadSoundWaveformTask *task = MEM_callocN<ReadSoundWaveformTask>("read sound waveform task");
task->wm_job = pj;
task->preview_job_audio = previewjb;
task->stop = &worker_status->stop;
new_tasks.append(task);
BLI_remlink(&pj->previews, previewjb);
}
BLI_mutex_unlock(pj->mutex);
for (ReadSoundWaveformTask *task : new_tasks) {
BLI_task_pool_push(
task_pool, execute_read_sound_waveform_task, task, true, free_read_sound_waveform_task);
}
}
BLI_task_pool_work_and_wait(task_pool);

View File

@@ -1700,7 +1700,6 @@ static Mesh *meshgl_to_mesh(MeshGL &mgl,
* using the mesh's face offsets, and we will use Blender's parallelized function to calculate
* edges later. */
Mesh *mesh = bke::mesh_new_no_attributes(verts_num, 0, faces_num, 0);
BKE_defgroup_copy_list(&mesh->vertex_group_names, &joined_mesh->vertex_group_names);
BKE_mesh_copy_parameters_for_eval(mesh, joined_mesh);
/* First the face offsets store the size of each result face, then we accumulate them to form the