Merge branch 'blender-v3.2-release'

This commit is contained in:
Joseph Eagar 2022-05-12 01:29:42 -07:00
commit 31202ea628
2 changed files with 15 additions and 3 deletions

View File

@ -333,6 +333,8 @@ static char attr_prefix_get(CustomDataType type)
switch (type) {
case CD_TANGENT:
return 't';
case CD_MCOL:
return 'c';
case CD_AUTO_FROM_NAME:
return 'a';
case CD_HAIRLENGTH:

View File

@ -42,10 +42,20 @@ static int node_shader_gpu_vertex_color(GPUMaterial *mat,
GPUNodeStack *out)
{
NodeShaderVertexColor *vertexColor = (NodeShaderVertexColor *)node->storage;
/* NOTE: using CD_AUTO_FROM_NAME instead of CD_MCOL or CD_PROP_COLOR as geometry nodes may
* overwrite data which will also change the CustomDataType. This will also make EEVEE and Cycles
/* NOTE: using CD_AUTO_FROM_NAME instead of CD_MCOL or CD_PROP_COLOR for named attributes
* as geometry nodes may overwrite data which will also change the CustomDataType.
* This will also make EEVEE and Cycles
* consistent. See T93179. */
GPUNodeLink *vertexColorLink = GPU_attribute(mat, CD_AUTO_FROM_NAME, vertexColor->layer_name);
GPUNodeLink *vertexColorLink;
if (vertexColor->layer_name[0]) {
vertexColorLink = GPU_attribute(mat, CD_AUTO_FROM_NAME, vertexColor->layer_name);
}
else { /* Fall back on active render color attribute. */
vertexColorLink = GPU_attribute(mat, CD_MCOL, vertexColor->layer_name);
}
return GPU_stack_link(mat, node, "node_vertex_color", in, out, vertexColorLink);
}