diff options
-rw-r--r-- | source/blender/gpu/GPU_material.h | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.c | 3 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.h | 4 |
3 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index cbbc428b8c4..a002c981a8f 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -69,6 +69,7 @@ typedef struct GPULamp GPULamp; /* Functions to create GPU Materials nodes */ typedef enum GPUType { + /* The value indicates the number of elements in each type */ GPU_NONE = 0, GPU_FLOAT = 1, GPU_VEC2 = 2, @@ -76,6 +77,7 @@ typedef enum GPUType { GPU_VEC4 = 4, GPU_MAT3 = 9, GPU_MAT4 = 16, + GPU_TEX2D = 1002, GPU_SHADOW2D = 1003, GPU_ATTRIB = 3001 diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 984e1d6ce64..048442350cc 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -64,6 +64,7 @@ static char *glsl_material_library = NULL; /* structs and defines */ +/* Indices match the GPUType enum */ static const char *GPU_DATATYPE_STR[17] = {"", "float", "vec2", "vec3", "vec4", NULL, NULL, NULL, NULL, "mat3", NULL, NULL, NULL, NULL, NULL, NULL, "mat4"}; @@ -160,7 +161,7 @@ static void gpu_parse_functions_string(GHash *hash, char *code) type= GPU_TEX2D; if (type) { - /* add paramater */ + /* add parameter */ code = gpu_str_skip_token(code, NULL, 0); code = gpu_str_skip_token(code, NULL, 0); function->paramqual[function->totparam]= qual; diff --git a/source/blender/gpu/intern/gpu_codegen.h b/source/blender/gpu/intern/gpu_codegen.h index cf9f4cc9c1b..abc5650059d 100644 --- a/source/blender/gpu/intern/gpu_codegen.h +++ b/source/blender/gpu/intern/gpu_codegen.h @@ -105,6 +105,8 @@ struct GPUNodeLink { int dynamictype; int type; + + /* Refcount */ int users; struct GPUTexture *dynamictex; @@ -133,7 +135,7 @@ typedef struct GPUInput { int source; /* data source */ int id; /* unique id as created by code generator */ - int texid; /* number for multitexture */ + int texid; /* number for multitexture, starting from zero */ int attribid; /* id for vertex attributes */ int bindtex; /* input is responsible for binding the texture? */ int definetex; /* input is responsible for defining the pixel? */ |