Code cleanup: minor comment improvements
authorNicholas Bishop <nicholasbishop@gmail.com>
Sat, 24 Jan 2015 12:43:57 +0000 (13:43 +0100)
committerNicholas Bishop <nicholasbishop@gmail.com>
Mon, 26 Jan 2015 15:35:31 +0000 (16:35 +0100)
Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1026

source/blender/gpu/GPU_material.h
source/blender/gpu/intern/gpu_codegen.c
source/blender/gpu/intern/gpu_codegen.h

index cbbc428b8c4a78414aa0c72e5b5bfa9c240aa5fb..a002c981a8f6049e2802d1f3452fc74e9192a6a0 100644 (file)
@@ -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
index 984e1d6ce64ec9e2eaceddf9e302703a415b6d3c..048442350cc9c3f9dfb7734afb11e46e1eab0fb5 100644 (file)
@@ -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;
index cf9f4cc9c1b200e08e481d9e3068c8338a6e8e55..abc5650059dc5725749a05c5625d7c1da58cbf98 100644 (file)
@@ -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? */