Changeset View
Changeset View
Standalone View
Standalone View
source/blender/render/intern/source/volume_precache.c
| Show First 20 Lines • Show All 574 Lines • ▼ Show 20 Lines | static void vol_precache_part(TaskPool * __restrict pool, void *taskdata, int UNUSED(threadid)) | ||||
| } | } | ||||
| time = PIL_check_seconds_timer(); | time = PIL_check_seconds_timer(); | ||||
| if (time - state->lasttime > 1.0) { | if (time - state->lasttime > 1.0) { | ||||
| ThreadMutex *mutex = BLI_task_pool_user_mutex(pool); | ThreadMutex *mutex = BLI_task_pool_user_mutex(pool); | ||||
| if (BLI_mutex_trylock(mutex)) { | if (BLI_mutex_trylock(mutex)) { | ||||
| char str[64]; | char str[64]; | ||||
| float ratio = (float)BLI_task_pool_tasks_done(pool)/(float)state->totparts; | float ratio = (float)(state->totparts - BLI_task_pool_tasks_todo(pool))/(float)state->totparts; | ||||
| BLI_snprintf(str, sizeof(str), IFACE_("Precaching volume: %d%%"), (int)(100.0f * ratio)); | BLI_snprintf(str, sizeof(str), IFACE_("Precaching volume: %d%%"), (int)(100.0f * ratio)); | ||||
| re->i.infostr = str; | re->i.infostr = str; | ||||
| re->stats_draw(re->sdh, &re->i); | re->stats_draw(re->sdh, &re->i); | ||||
| re->i.infostr = NULL; | re->i.infostr = NULL; | ||||
| state->lasttime = time; | state->lasttime = time; | ||||
| BLI_mutex_unlock(mutex); | BLI_mutex_unlock(mutex); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 258 Lines • Show Last 20 Lines | |||||