Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/gpu/intern/gpu_node_graph.c')
-rw-r--r--source/blender/gpu/intern/gpu_node_graph.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/gpu/intern/gpu_node_graph.c b/source/blender/gpu/intern/gpu_node_graph.c
index bc7ace792bb..3c6a03c56d3 100644
--- a/source/blender/gpu/intern/gpu_node_graph.c
+++ b/source/blender/gpu/intern/gpu_node_graph.c
@@ -328,11 +328,13 @@ void gpu_node_graph_finalize_uniform_attrs(GPUNodeGraph *graph)
/* Attributes and Textures */
-static char attr_prefix_get(CustomDataType type)
+static char attr_prefix_get(eCustomDataType type)
{
switch (type) {
case CD_TANGENT:
return 't';
+ case CD_MCOL:
+ return 'c';
case CD_AUTO_FROM_NAME:
return 'a';
case CD_HAIRLENGTH:
@@ -345,7 +347,7 @@ static char attr_prefix_get(CustomDataType type)
static void attr_input_name(GPUMaterialAttribute *attr)
{
- /* NOTE: Replicate changes to mesh_render_data_create() in draw_cache_impl_mesh.c */
+ /* NOTE: Replicate changes to mesh_render_data_create() in draw_cache_impl_mesh.cc */
if (attr->type == CD_ORCO) {
/* OPTI: orco is computed from local positions, but only if no modifier is present. */
STRNCPY(attr->input_name, "orco");
@@ -362,7 +364,7 @@ static void attr_input_name(GPUMaterialAttribute *attr)
/** Add a new varying attribute of given type and name. Returns NULL if out of slots. */
static GPUMaterialAttribute *gpu_node_graph_add_attribute(GPUNodeGraph *graph,
- CustomDataType type,
+ eCustomDataType type,
const char *name)
{
/* Find existing attribute. */
@@ -466,7 +468,7 @@ static GPUMaterialTexture *gpu_node_graph_add_texture(GPUNodeGraph *graph,
/* Creating Inputs */
-GPUNodeLink *GPU_attribute(GPUMaterial *mat, const CustomDataType type, const char *name)
+GPUNodeLink *GPU_attribute(GPUMaterial *mat, const eCustomDataType type, const char *name)
{
GPUNodeGraph *graph = gpu_material_node_graph(mat);
GPUMaterialAttribute *attr = gpu_node_graph_add_attribute(graph, type, name);
@@ -489,7 +491,7 @@ GPUNodeLink *GPU_attribute(GPUMaterial *mat, const CustomDataType type, const ch
}
GPUNodeLink *GPU_attribute_with_default(GPUMaterial *mat,
- const CustomDataType type,
+ const eCustomDataType type,
const char *name,
eGPUDefaultValue default_value)
{
@@ -611,7 +613,7 @@ bool GPU_link(GPUMaterial *mat, const char *name, ...)
va_start(params, name);
for (i = 0; i < function->totparam; i++) {
- if (function->paramqual[i] != FUNCTION_QUAL_IN) {
+ if (function->paramqual[i] == FUNCTION_QUAL_OUT) {
linkptr = va_arg(params, GPUNodeLink **);
gpu_node_output(node, function->paramtype[i], linkptr);
}
@@ -669,7 +671,7 @@ static bool gpu_stack_link_v(GPUMaterial *material,
}
for (i = 0; i < function->totparam; i++) {
- if (function->paramqual[i] != FUNCTION_QUAL_IN) {
+ if (function->paramqual[i] == FUNCTION_QUAL_OUT) {
if (totout == 0) {
linkptr = va_arg(params, GPUNodeLink **);
gpu_node_output(node, function->paramtype[i], linkptr);