Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_material.c
| Show First 20 Lines • Show All 185 Lines • ▼ Show 20 Lines | if (material->coba_tex != NULL) { | ||||
| GPU_texture_free(material->coba_tex); | GPU_texture_free(material->coba_tex); | ||||
| } | } | ||||
| BLI_gset_free(material->used_libraries, NULL); | BLI_gset_free(material->used_libraries, NULL); | ||||
| } | } | ||||
| void GPU_material_free(ListBase *gpumaterial) | void GPU_material_free(ListBase *gpumaterial) | ||||
| { | { | ||||
| for (LinkData *link = gpumaterial->first; link; link = link->next) { | LISTBASE_FOREACH (LinkData *, link, gpumaterial) { | ||||
| GPUMaterial *material = link->data; | GPUMaterial *material = link->data; | ||||
| gpu_material_free_single(material); | gpu_material_free_single(material); | ||||
| MEM_freeN(material); | MEM_freeN(material); | ||||
| } | } | ||||
| BLI_freelistN(gpumaterial); | BLI_freelistN(gpumaterial); | ||||
| } | } | ||||
| Scene *GPU_material_scene(GPUMaterial *material) | Scene *GPU_material_scene(GPUMaterial *material) | ||||
| ▲ Show 20 Lines • Show All 420 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| return (mat->flag & flag) != 0; | return (mat->flag & flag) != 0; | ||||
| } | } | ||||
| GPUMaterial *GPU_material_from_nodetree_find(ListBase *gpumaterials, | GPUMaterial *GPU_material_from_nodetree_find(ListBase *gpumaterials, | ||||
| const void *engine_type, | const void *engine_type, | ||||
| int options) | int options) | ||||
| { | { | ||||
| for (LinkData *link = gpumaterials->first; link; link = link->next) { | LISTBASE_FOREACH (LinkData *, link, gpumaterials) { | ||||
| GPUMaterial *current_material = (GPUMaterial *)link->data; | GPUMaterial *current_material = (GPUMaterial *)link->data; | ||||
| if (current_material->engine_type == engine_type && current_material->options == options) { | if (current_material->engine_type == engine_type && current_material->options == options) { | ||||
| return current_material; | return current_material; | ||||
| } | } | ||||
| } | } | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 148 Lines • Show Last 20 Lines | |||||