Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_uv.cc
| Show All 38 Lines | static bool mesh_extract_uv_format_init(GPUVertFormat *format, | ||||
| for (int i = 0; i < MAX_MTFACE; i++) { | for (int i = 0; i < MAX_MTFACE; i++) { | ||||
| if (uv_layers & (1 << i)) { | if (uv_layers & (1 << i)) { | ||||
| char attr_name[32], attr_safe_name[GPU_MAX_SAFE_ATTR_NAME]; | char attr_name[32], attr_safe_name[GPU_MAX_SAFE_ATTR_NAME]; | ||||
| const char *layer_name = CustomData_get_layer_name(cd_ldata, CD_MLOOPUV, i); | const char *layer_name = CustomData_get_layer_name(cd_ldata, CD_MLOOPUV, i); | ||||
| GPU_vertformat_safe_attr_name(layer_name, attr_safe_name, GPU_MAX_SAFE_ATTR_NAME); | GPU_vertformat_safe_attr_name(layer_name, attr_safe_name, GPU_MAX_SAFE_ATTR_NAME); | ||||
| /* UV layer name. */ | /* UV layer name. */ | ||||
| BLI_snprintf(attr_name, sizeof(attr_name), "u%s", attr_safe_name); | |||||
| GPU_vertformat_attr_add(format, attr_name, GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | |||||
| /* Auto layer name. */ | |||||
| BLI_snprintf(attr_name, sizeof(attr_name), "a%s", attr_safe_name); | BLI_snprintf(attr_name, sizeof(attr_name), "a%s", attr_safe_name); | ||||
| GPU_vertformat_alias_add(format, attr_name); | GPU_vertformat_attr_add(format, attr_name, GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| /* Active render layer name. */ | /* Active render layer name. */ | ||||
| if (i == CustomData_get_render_layer(cd_ldata, CD_MLOOPUV)) { | if (i == CustomData_get_render_layer(cd_ldata, CD_MLOOPUV)) { | ||||
| GPU_vertformat_alias_add(format, "u"); | GPU_vertformat_alias_add(format, "a"); | ||||
fclem: Does that mean we get any attribute type if not using any name on a UV node? Why do color… | |||||
fclemUnsubmitted Done Inline ActionsI see now: /* Fall back to the UV layer, which matches old behavior. */
if (type == CD_AUTO_FROM_NAME && name[0] == '\0') {
type = CD_MTFACE;
}Not an issue then. fclem: I see now:
``` /* Fall back to the UV layer, which matches old behavior. */
if (type ==… | |||||
| } | } | ||||
| /* Active display layer name. */ | /* Active display layer name. */ | ||||
| if (i == CustomData_get_active_layer(cd_ldata, CD_MLOOPUV)) { | if (i == CustomData_get_active_layer(cd_ldata, CD_MLOOPUV)) { | ||||
| GPU_vertformat_alias_add(format, "au"); | GPU_vertformat_alias_add(format, "au"); | ||||
| /* Alias to `pos` for edit uvs. */ | /* Alias to `pos` for edit uvs. */ | ||||
| GPU_vertformat_alias_add(format, "pos"); | GPU_vertformat_alias_add(format, "pos"); | ||||
| } | } | ||||
| /* Stencil mask uv layer name. */ | /* Stencil mask uv layer name. */ | ||||
| ▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines | |||||
Does that mean we get any attribute type if not using any name on a UV node? Why do color attrib keep the c but uvs do not keep the u?