Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_cache_impl_volume.c
| Show First 20 Lines • Show All 298 Lines • ▼ Show 20 Lines | static DRWVolumeGrid *volume_grid_cache_get(const Volume *volume, | ||||
| } | } | ||||
| /* Allocate new grid. */ | /* Allocate new grid. */ | ||||
| cache_grid = MEM_callocN(sizeof(DRWVolumeGrid), __func__); | cache_grid = MEM_callocN(sizeof(DRWVolumeGrid), __func__); | ||||
| cache_grid->name = BLI_strdup(name); | cache_grid->name = BLI_strdup(name); | ||||
| BLI_addtail(&cache->grids, cache_grid); | BLI_addtail(&cache->grids, cache_grid); | ||||
| /* TODO: can we load this earlier, avoid accessing the global and take | /* TODO: can we load this earlier, avoid accessing the global and take | ||||
| * advantage of dependency graph multithreading? */ | * advantage of dependency graph multi-threading? */ | ||||
| BKE_volume_load(volume, G.main); | BKE_volume_load(volume, G.main); | ||||
| /* Test if we support textures with the number of channels. */ | /* Test if we support textures with the number of channels. */ | ||||
| size_t channels = BKE_volume_grid_channels(grid); | size_t channels = BKE_volume_grid_channels(grid); | ||||
| if (!ELEM(channels, 1, 3)) { | if (!ELEM(channels, 1, 3)) { | ||||
| return cache_grid; | return cache_grid; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines | |||||