diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2015-01-24 17:50:03 +0300 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2015-01-26 18:36:07 +0300 |
commit | c5f5012c5a1b30ee757244782584cab087e22999 (patch) | |
tree | 72b78c749cf7cd6576a1af75bdbef9935d21dbce /source/blender/gpu | |
parent | 8174ea2684b8d144de10508c1766117abe4b6a9a (diff) |
Code cleanup: use GPUDynamicType instead of int
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D1026
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_material.h | 58 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.c | 4 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.h | 6 |
3 files changed, 34 insertions, 34 deletions
diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index a002c981a8f..a65a123c768 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -123,13 +123,40 @@ typedef struct GPUNodeStack { short sockettype; } GPUNodeStack; +typedef enum GPUDynamicType { + GPU_DYNAMIC_NONE = 0, + GPU_DYNAMIC_OBJECT_VIEWMAT = 1, + GPU_DYNAMIC_OBJECT_MAT = 2, + GPU_DYNAMIC_OBJECT_VIEWIMAT = 3, + GPU_DYNAMIC_OBJECT_IMAT = 4, + GPU_DYNAMIC_OBJECT_COLOR = 5, + GPU_DYNAMIC_OBJECT_AUTOBUMPSCALE = 15, + + GPU_DYNAMIC_LAMP_FIRST = 6, + GPU_DYNAMIC_LAMP_DYNVEC = 6, + GPU_DYNAMIC_LAMP_DYNCO = 7, + GPU_DYNAMIC_LAMP_DYNIMAT = 8, + GPU_DYNAMIC_LAMP_DYNPERSMAT = 9, + GPU_DYNAMIC_LAMP_DYNENERGY = 10, + GPU_DYNAMIC_LAMP_DYNCOL = 11, + GPU_DYNAMIC_LAMP_LAST = 11, + GPU_DYNAMIC_SAMPLER_2DBUFFER = 12, + GPU_DYNAMIC_SAMPLER_2DIMAGE = 13, + GPU_DYNAMIC_SAMPLER_2DSHADOW = 14, + GPU_DYNAMIC_LAMP_DISTANCE = 16, + GPU_DYNAMIC_LAMP_ATT1 = 17, + GPU_DYNAMIC_LAMP_ATT2 = 18, + GPU_DYNAMIC_LAMP_SPOTSIZE = 19, + GPU_DYNAMIC_LAMP_SPOTBLEND = 20, +} GPUDynamicType; + GPUNodeLink *GPU_attribute(CustomDataType type, const char *name); GPUNodeLink *GPU_uniform(float *num); -GPUNodeLink *GPU_dynamic_uniform(float *num, int dynamictype, void *data); +GPUNodeLink *GPU_dynamic_uniform(float *num, GPUDynamicType dynamictype, void *data); GPUNodeLink *GPU_image(struct Image *ima, struct ImageUser *iuser, bool is_data); GPUNodeLink *GPU_image_preview(struct PreviewImage *prv); GPUNodeLink *GPU_texture(int size, float *pixels); -GPUNodeLink *GPU_dynamic_texture(struct GPUTexture *tex, int dynamictype, void *data); +GPUNodeLink *GPU_dynamic_texture(struct GPUTexture *tex, GPUDynamicType dynamictype, void *data); GPUNodeLink *GPU_builtin(GPUBuiltin builtin); GPUNodeLink *GPU_opengl_builtin(GPUOpenGLBuiltin builtin); @@ -183,33 +210,6 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr); /* Export GLSL shader */ -typedef enum GPUDynamicType { - GPU_DYNAMIC_NONE = 0, - GPU_DYNAMIC_OBJECT_VIEWMAT = 1, - GPU_DYNAMIC_OBJECT_MAT = 2, - GPU_DYNAMIC_OBJECT_VIEWIMAT = 3, - GPU_DYNAMIC_OBJECT_IMAT = 4, - GPU_DYNAMIC_OBJECT_COLOR = 5, - GPU_DYNAMIC_OBJECT_AUTOBUMPSCALE = 15, - - GPU_DYNAMIC_LAMP_FIRST = 6, - GPU_DYNAMIC_LAMP_DYNVEC = 6, - GPU_DYNAMIC_LAMP_DYNCO = 7, - GPU_DYNAMIC_LAMP_DYNIMAT = 8, - GPU_DYNAMIC_LAMP_DYNPERSMAT = 9, - GPU_DYNAMIC_LAMP_DYNENERGY = 10, - GPU_DYNAMIC_LAMP_DYNCOL = 11, - GPU_DYNAMIC_LAMP_LAST = 11, - GPU_DYNAMIC_SAMPLER_2DBUFFER = 12, - GPU_DYNAMIC_SAMPLER_2DIMAGE = 13, - GPU_DYNAMIC_SAMPLER_2DSHADOW = 14, - GPU_DYNAMIC_LAMP_DISTANCE = 16, - GPU_DYNAMIC_LAMP_ATT1 = 17, - GPU_DYNAMIC_LAMP_ATT2 = 18, - GPU_DYNAMIC_LAMP_SPOTSIZE = 19, - GPU_DYNAMIC_LAMP_SPOTBLEND = 20, -} GPUDynamicType; - typedef enum GPUDataType { GPU_DATA_NONE = 0, GPU_DATA_1I = 1, // 1 integer diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 0ada2602ae4..9b49d232209 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -1178,7 +1178,7 @@ GPUNodeLink *GPU_uniform(float *num) return link; } -GPUNodeLink *GPU_dynamic_uniform(float *num, int dynamictype, void *data) +GPUNodeLink *GPU_dynamic_uniform(float *num, GPUDynamicType dynamictype, void *data) { GPUNodeLink *link = GPU_node_link_create(); @@ -1225,7 +1225,7 @@ GPUNodeLink *GPU_texture(int size, float *pixels) return link; } -GPUNodeLink *GPU_dynamic_texture(GPUTexture *tex, int dynamictype, void *data) +GPUNodeLink *GPU_dynamic_texture(GPUTexture *tex, GPUDynamicType dynamictype, void *data) { GPUNodeLink *link = GPU_node_link_create(); diff --git a/source/blender/gpu/intern/gpu_codegen.h b/source/blender/gpu/intern/gpu_codegen.h index 8b63af925a6..c76341afa00 100644 --- a/source/blender/gpu/intern/gpu_codegen.h +++ b/source/blender/gpu/intern/gpu_codegen.h @@ -94,7 +94,7 @@ struct GPUNodeLink { void *ptr1, *ptr2; bool dynamic; - int dynamictype; + GPUDynamicType dynamictype; GPUType type; @@ -131,7 +131,7 @@ typedef struct GPUInput { int attribid; /* id for vertex attributes */ bool bindtex; /* input is responsible for binding the texture? */ bool definetex; /* input is responsible for defining the pixel? */ - int textarget; /* GL_TEXTURE_* */ + int textarget; /* GL texture target, e.g. GL_TEXTURE_2D */ GPUType textype; /* datatype */ struct Image *ima; /* image */ @@ -139,7 +139,7 @@ typedef struct GPUInput { struct PreviewImage *prv; /* preview images & icons */ bool image_isdata; /* image does not contain color data */ float *dynamicvec; /* vector data in case it is dynamic */ - int dynamictype; /* origin of the dynamic uniform (GPUDynamicType) */ + GPUDynamicType dynamictype; /* origin of the dynamic uniform */ void *dynamicdata; /* data source of the dynamic uniform */ struct GPUTexture *tex; /* input texture, only set at runtime */ int shaderloc; /* id from opengl */ |