Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_node_graph.c
| Show First 20 Lines • Show All 410 Lines • ▼ Show 20 Lines | if (STREQ(attr->name, name) && attr->use_dupli == use_dupli) { | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| /* Add new requested attribute if it's within GPU limits. */ | /* Add new requested attribute if it's within GPU limits. */ | ||||
| if (attr == NULL && attrs->count < GPU_MAX_UNIFORM_ATTR) { | if (attr == NULL && attrs->count < GPU_MAX_UNIFORM_ATTR) { | ||||
| attr = MEM_callocN(sizeof(*attr), __func__); | attr = MEM_callocN(sizeof(*attr), __func__); | ||||
| STRNCPY(attr->name, name); | STRNCPY(attr->name, name); | ||||
| { | |||||
| char attr_name_esc[sizeof(attr->name) * 2]; | |||||
| BLI_str_escape(attr_name_esc, attr->name, sizeof(attr_name_esc)); | |||||
| SNPRINTF(attr->name_id_prop, "[\"%s\"]", attr_name_esc); | |||||
| } | |||||
| attr->use_dupli = use_dupli; | attr->use_dupli = use_dupli; | ||||
| attr->hash_code = BLI_ghashutil_strhash_p(attr->name) << 1 | (attr->use_dupli ? 0 : 1); | attr->hash_code = BLI_ghashutil_strhash_p(attr->name) << 1 | (attr->use_dupli ? 0 : 1); | ||||
| attr->id = -1; | attr->id = -1; | ||||
| BLI_addtail(&attrs->list, attr); | BLI_addtail(&attrs->list, attr); | ||||
| attrs->count++; | attrs->count++; | ||||
| } | } | ||||
| if (attr != NULL) { | if (attr != NULL) { | ||||
| ▲ Show 20 Lines • Show All 485 Lines • Show Last 20 Lines | |||||