Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/image.cpp
| Show First 20 Lines • Show All 650 Lines • ▼ Show 20 Lines | void ImageManager::device_load_image(Device *device, Scene *scene, int slot, Progress *progress) | ||||
| if (progress->get_cancel()) { | if (progress->get_cancel()) { | ||||
| return; | return; | ||||
| } | } | ||||
| Image *img = images[slot]; | Image *img = images[slot]; | ||||
| progress->set_status("Updating Images", "Loading " + img->loader->name()); | progress->set_status("Updating Images", "Loading " + img->loader->name()); | ||||
| const int texture_limit = scene->params.texture_limit; | const int texture_limit = scene->get_params().texture_limit; | ||||
| load_image_metadata(img); | load_image_metadata(img); | ||||
| ImageDataType type = img->metadata.type; | ImageDataType type = img->metadata.type; | ||||
| /* Name for debugging. */ | /* Name for debugging. */ | ||||
| img->mem_name = string_printf("__tex_image_%s_%03d", name_from_type(type), slot); | img->mem_name = string_printf("__tex_image_%s_%03d", name_from_type(type), slot); | ||||
| /* Free previous texture in slot. */ | /* Free previous texture in slot. */ | ||||
| ▲ Show 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | |||||
| void ImageManager::device_update(Device *device, Scene *scene, Progress &progress) | void ImageManager::device_update(Device *device, Scene *scene, Progress &progress) | ||||
| { | { | ||||
| if (!need_update) { | if (!need_update) { | ||||
| return; | return; | ||||
| } | } | ||||
| scoped_callback_timer timer([scene](double time) { | scoped_callback_timer timer([scene](double time) { | ||||
| if (scene->update_stats) { | if (scene->get_update_stats()) { | ||||
| scene->update_stats->image.times.add_entry({"device_update", time}); | scene->get_update_stats()->image.times.add_entry({"device_update", time}); | ||||
| } | } | ||||
| }); | }); | ||||
| TaskPool pool; | TaskPool pool; | ||||
| for (size_t slot = 0; slot < images.size(); slot++) { | for (size_t slot = 0; slot < images.size(); slot++) { | ||||
| Image *img = images[slot]; | Image *img = images[slot]; | ||||
| if (img && img->users == 0) { | if (img && img->users == 0) { | ||||
| device_free_image(device, slot); | device_free_image(device, slot); | ||||
| ▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines | |||||