Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/render/render_preview.cc
| Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | |||||
| #include "DEG_depsgraph_query.h" | #include "DEG_depsgraph_query.h" | ||||
| #include "IMB_imbuf.h" | #include "IMB_imbuf.h" | ||||
| #include "IMB_imbuf_types.h" | #include "IMB_imbuf_types.h" | ||||
| #include "IMB_thumbs.h" | #include "IMB_thumbs.h" | ||||
| #include "BIF_glutil.h" | #include "BIF_glutil.h" | ||||
| #include "GPU_context.h" | |||||
| #include "GPU_shader.h" | #include "GPU_shader.h" | ||||
| #include "RE_engine.h" | #include "RE_engine.h" | ||||
| #include "RE_pipeline.h" | #include "RE_pipeline.h" | ||||
| #include "RE_texture.h" | #include "RE_texture.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| ▲ Show 20 Lines • Show All 1,517 Lines • ▼ Show 20 Lines | for (cur_size = static_cast<IconPreviewSize *>(ip->sizes.first); cur_size; | ||||
| /* TODO: Decouple the ID-type-specific render functions from this function, so that it's not | /* TODO: Decouple the ID-type-specific render functions from this function, so that it's not | ||||
| * necessary to know here what happens inside lower-level functions. */ | * necessary to know here what happens inside lower-level functions. */ | ||||
| const bool use_solid_render_mode = (ip->id != nullptr) && ELEM(GS(ip->id->name), ID_OB, ID_AC); | const bool use_solid_render_mode = (ip->id != nullptr) && ELEM(GS(ip->id->name), ID_OB, ID_AC); | ||||
| if (!use_solid_render_mode && preview_method_is_render(pr_method) && | if (!use_solid_render_mode && preview_method_is_render(pr_method) && | ||||
| !check_engine_supports_preview(ip->scene)) { | !check_engine_supports_preview(ip->scene)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| /* Workaround: Skip preview renders for linked IDs. Preview rendering can be slow and even | |||||
| * freeze the UI (e.g. on Eevee shader compilation). And since the result will never be stored | |||||
| * in a file, it's done every time the file is reloaded, so this becomes a frequent annoyance. | |||||
| */ | |||||
| if (!use_solid_render_mode && ip->id && ID_IS_LINKED(ip->id)) { | |||||
| continue; | |||||
| } | |||||
| #ifndef NDEBUG | #ifndef NDEBUG | ||||
| { | { | ||||
| int size_index = icon_previewimg_size_index_get(cur_size, prv); | int size_index = icon_previewimg_size_index_get(cur_size, prv); | ||||
| BLI_assert(!BKE_previewimg_is_finished(prv, size_index)); | BLI_assert(!BKE_previewimg_is_finished(prv, size_index)); | ||||
| } | } | ||||
| #endif | #endif | ||||
| if (ip->id != nullptr) { | if (ip->id != nullptr) { | ||||
| ▲ Show 20 Lines • Show All 546 Lines • Show Last 20 Lines | |||||