diff options
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/fluid.c | 10 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 140 |
2 files changed, 8 insertions, 142 deletions
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index 8b959e30aff..ac6ed6b9949 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -3526,8 +3526,8 @@ static void BKE_fluid_modifier_processDomain(FluidModifierData *mmd, } } if (!baking_data && !baking_noise && !mode_replay) { - /* There is no need to call manta_update_smoke_structures() here. - * The noise cache has already been read with manta_update_noise_structures(). */ + /* TODO (sebbas): Confirm if this read call is really needed or not. */ + has_data = manta_update_smoke_structures(mds->fluid, mmd, data_frame); } else { has_data = manta_read_data(mds->fluid, mmd, data_frame); @@ -4448,9 +4448,15 @@ void BKE_fluid_modifier_create_type_data(struct FluidModifierData *mmd) mmd->domain->cache_flag = 0; mmd->domain->cache_type = FLUID_DOMAIN_CACHE_MODULAR; mmd->domain->cache_mesh_format = FLUID_DOMAIN_FILE_BIN_OBJECT; +#ifdef WITH_OPENVDB mmd->domain->cache_data_format = FLUID_DOMAIN_FILE_OPENVDB; mmd->domain->cache_particle_format = FLUID_DOMAIN_FILE_OPENVDB; mmd->domain->cache_noise_format = FLUID_DOMAIN_FILE_OPENVDB; +#else + mmd->domain->cache_data_format = FLUID_DOMAIN_FILE_UNI; + mmd->domain->cache_particle_format = FLUID_DOMAIN_FILE_UNI; + mmd->domain->cache_noise_format = FLUID_DOMAIN_FILE_UNI; +#endif modifier_path_init(mmd->domain->cache_directory, sizeof(mmd->domain->cache_directory), FLUID_DOMAIN_DIR_DEFAULT); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 747ce18cada..4dc2177ec75 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -4147,146 +4147,6 @@ ImBuf *BKE_sequencer_give_ibuf_direct(const SeqRenderData *context, float cfra, return ibuf; } -/* *********************** threading api ******************* */ - -static ListBase running_threads; -static ListBase prefetch_wait; -static ListBase prefetch_done; - -static pthread_mutex_t queue_lock = PTHREAD_MUTEX_INITIALIZER; -static pthread_mutex_t wakeup_lock = PTHREAD_MUTEX_INITIALIZER; -static pthread_cond_t wakeup_cond = PTHREAD_COND_INITIALIZER; - -// static pthread_mutex_t prefetch_ready_lock = PTHREAD_MUTEX_INITIALIZER; -// static pthread_cond_t prefetch_ready_cond = PTHREAD_COND_INITIALIZER; - -static pthread_mutex_t frame_done_lock = PTHREAD_MUTEX_INITIALIZER; -static pthread_cond_t frame_done_cond = PTHREAD_COND_INITIALIZER; - -static volatile bool seq_thread_shutdown = true; -static volatile int seq_last_given_monoton_cfra = 0; -static int monoton_cfra = 0; - -typedef struct PrefetchThread { - struct PrefetchThread *next, *prev; - - Scene *scene; - struct PrefetchQueueElem *current; - pthread_t pthread; - int running; - -} PrefetchThread; - -typedef struct PrefetchQueueElem { - struct PrefetchQueueElem *next, *prev; - - int rectx; - int recty; - float cfra; - int chanshown; - int preview_render_size; - - int monoton_cfra; - - ImBuf *ibuf; -} PrefetchQueueElem; - -void BKE_sequencer_give_ibuf_prefetch_request(const SeqRenderData *context, - float cfra, - int chanshown) -{ - PrefetchQueueElem *e; - if (seq_thread_shutdown) { - return; - } - - e = MEM_callocN(sizeof(PrefetchQueueElem), "prefetch_queue_elem"); - e->rectx = context->rectx; - e->recty = context->recty; - e->cfra = cfra; - e->chanshown = chanshown; - e->preview_render_size = context->preview_render_size; - e->monoton_cfra = monoton_cfra++; - - pthread_mutex_lock(&queue_lock); - BLI_addtail(&prefetch_wait, e); - pthread_mutex_unlock(&queue_lock); - - pthread_mutex_lock(&wakeup_lock); - pthread_cond_signal(&wakeup_cond); - pthread_mutex_unlock(&wakeup_lock); -} - -ImBuf *BKE_sequencer_give_ibuf_threaded(const SeqRenderData *context, float cfra, int chanshown) -{ - PrefetchQueueElem *e = NULL; - bool found_something = false; - - if (seq_thread_shutdown) { - return BKE_sequencer_give_ibuf(context, cfra, chanshown); - } - - while (!e) { - bool success = false; - pthread_mutex_lock(&queue_lock); - - for (e = prefetch_done.first; e; e = e->next) { - if (cfra == e->cfra && chanshown == e->chanshown && context->rectx == e->rectx && - context->recty == e->recty && context->preview_render_size == e->preview_render_size) { - success = true; - found_something = true; - break; - } - } - - if (!e) { - for (e = prefetch_wait.first; e; e = e->next) { - if (cfra == e->cfra && chanshown == e->chanshown && context->rectx == e->rectx && - context->recty == e->recty && context->preview_render_size == e->preview_render_size) { - found_something = true; - break; - } - } - } - - if (!e) { - PrefetchThread *tslot; - - for (tslot = running_threads.first; tslot; tslot = tslot->next) { - if (tslot->current && cfra == tslot->current->cfra && - chanshown == tslot->current->chanshown && context->rectx == tslot->current->rectx && - context->recty == tslot->current->recty && - context->preview_render_size == tslot->current->preview_render_size) { - found_something = true; - break; - } - } - } - - /* e->ibuf is unrefed by render thread on next round. */ - - if (e) { - seq_last_given_monoton_cfra = e->monoton_cfra; - } - - pthread_mutex_unlock(&queue_lock); - - if (!success) { - e = NULL; - - if (!found_something) { - fprintf(stderr, "SEQ-THREAD: Requested frame not in queue ???\n"); - break; - } - pthread_mutex_lock(&frame_done_lock); - pthread_cond_wait(&frame_done_cond, &frame_done_lock); - pthread_mutex_unlock(&frame_done_lock); - } - } - - return e ? e->ibuf : NULL; -} - /* check whether sequence cur depends on seq */ bool BKE_sequence_check_depend(Sequence *seq, Sequence *cur) { |