[Bf-blender-cvs] [f06f6ea] master: Cleanup: style, gpu module

Campbell Barton noreply at git.blender.org
Sat Jan 9 21:19:54 CET 2016


Commit: f06f6eab0de15aeebab13074ef0b4173649779b4
Author: Campbell Barton
Date:   Sun Jan 10 07:12:10 2016 +1100
Branches: master
https://developer.blender.org/rBf06f6eab0de15aeebab13074ef0b4173649779b4

Cleanup: style, gpu module

===================================================================

M	source/blender/gpu/GPU_basic_shader.h
M	source/blender/gpu/GPU_compositing.h
M	source/blender/gpu/GPU_draw.h
M	source/blender/gpu/GPU_extensions.h
M	source/blender/gpu/GPU_framebuffer.h
M	source/blender/gpu/GPU_material.h
M	source/blender/gpu/GPU_select.h
M	source/blender/gpu/GPU_shader.h
M	source/blender/gpu/GPU_texture.h
M	source/blender/gpu/intern/gpu_basic_shader.c
M	source/blender/gpu/intern/gpu_buffers.c
M	source/blender/gpu/intern/gpu_codegen.c
M	source/blender/gpu/intern/gpu_compositing.c
M	source/blender/gpu/intern/gpu_debug.c
M	source/blender/gpu/intern/gpu_draw.c
M	source/blender/gpu/intern/gpu_extensions.c
M	source/blender/gpu/intern/gpu_framebuffer.c
M	source/blender/gpu/intern/gpu_material.c
M	source/blender/gpu/intern/gpu_select.c
M	source/blender/gpu/intern/gpu_shader.c
M	source/blender/gpu/intern/gpu_texture.c

===================================================================

diff --git a/source/blender/gpu/GPU_basic_shader.h b/source/blender/gpu/GPU_basic_shader.h
index f964e05..f376850 100644
--- a/source/blender/gpu/GPU_basic_shader.h
+++ b/source/blender/gpu/GPU_basic_shader.h
@@ -41,15 +41,15 @@ extern "C" {
 /* Fixed Function Shader */
 
 typedef enum GPUBasicShaderOption {
-	GPU_SHADER_USE_COLOR =        (1<<0),   /* use glColor, for lighting it replaces diffuse */
-	GPU_SHADER_LIGHTING =         (1<<1),   /* use lighting */
-	GPU_SHADER_TWO_SIDED =        (1<<2),   /* flip normals towards viewer */
-	GPU_SHADER_TEXTURE_2D =       (1<<3),   /* use 2D texture to replace diffuse color */
+	GPU_SHADER_USE_COLOR =        (1 << 0),   /* use glColor, for lighting it replaces diffuse */
+	GPU_SHADER_LIGHTING =         (1 << 1),   /* use lighting */
+	GPU_SHADER_TWO_SIDED =        (1 << 2),   /* flip normals towards viewer */
+	GPU_SHADER_TEXTURE_2D =       (1 << 3),   /* use 2D texture to replace diffuse color */
 
-	GPU_SHADER_SOLID_LIGHTING =   (1<<4),   /* use faster lighting (set automatically) */
-	GPU_SHADER_STIPPLE =          (1<<5),   /* use stipple */
+	GPU_SHADER_SOLID_LIGHTING =   (1 << 4),   /* use faster lighting (set automatically) */
+	GPU_SHADER_STIPPLE =          (1 << 5),   /* use stipple */
 	GPU_SHADER_OPTIONS_NUM = 6,
-	GPU_SHADER_OPTION_COMBINATIONS = (1<<GPU_SHADER_OPTIONS_NUM)
+	GPU_SHADER_OPTION_COMBINATIONS = (1 << GPU_SHADER_OPTIONS_NUM)
 } GPUBasicShaderOption;
 
 /* Keep these in sync with gpu_shader_basic_frag.glsl */
diff --git a/source/blender/gpu/GPU_compositing.h b/source/blender/gpu/GPU_compositing.h
index 04e89da..892fe4f 100644
--- a/source/blender/gpu/GPU_compositing.h
+++ b/source/blender/gpu/GPU_compositing.h
@@ -82,7 +82,9 @@ bool GPU_fx_compositor_initialize_passes(
         const struct GPUFXSettings *fx_settings);
 
 /* do compositing on the fx passes that have been initialized */
-bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, struct Scene *scene, struct GPUOffScreen *ofs);
+bool GPU_fx_do_composite_pass(
+        GPUFX *fx, float projmat[4][4], bool is_persp,
+        struct Scene *scene, struct GPUOffScreen *ofs);
 
 /* bind new depth buffer for XRay pass */
 void GPU_fx_compositor_setup_XRay_pass(GPUFX *fx, bool do_xray);
diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h
index 3e6c26f..afb1cbc 100644
--- a/source/blender/gpu/GPU_draw.h
+++ b/source/blender/gpu/GPU_draw.h
@@ -133,9 +133,12 @@ void GPU_paint_update_image(struct Image *ima, struct ImageUser *iuser, int x, i
 void GPU_update_images_framechange(void);
 int GPU_update_image_time(struct Image *ima, double time);
 int GPU_verify_image(struct Image *ima, struct ImageUser *iuser, int tftile, bool compare, bool mipmap, bool is_data);
-void GPU_create_gl_tex(unsigned int *bind, unsigned int *rect, float *frect, int rectw, int recth,
-                       bool mipmap, bool use_hight_bit_depth, struct Image *ima);
-void GPU_create_gl_tex_compressed(unsigned int *bind, unsigned int *pix, int x, int y, int mipmap, struct Image *ima, struct ImBuf *ibuf);
+void GPU_create_gl_tex(
+        unsigned int *bind, unsigned int *rect, float *frect, int rectw, int recth,
+        bool mipmap, bool use_hight_bit_depth, struct Image *ima);
+void GPU_create_gl_tex_compressed(
+        unsigned int *bind, unsigned int *pix, int x, int y, int mipmap,
+        struct Image *ima, struct ImBuf *ibuf);
 bool GPU_upload_dxt_texture(struct ImBuf *ibuf);
 void GPU_free_image(struct Image *ima);
 void GPU_free_images(void);
diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h
index fda12a4..64167e94 100644
--- a/source/blender/gpu/GPU_extensions.h
+++ b/source/blender/gpu/GPU_extensions.h
@@ -64,25 +64,25 @@ void GPU_code_generate_glsl_lib(void);
 /* GPU Types */
 
 typedef enum GPUDeviceType {
-	GPU_DEVICE_NVIDIA =     (1<<0),
-	GPU_DEVICE_ATI =        (1<<1),
-	GPU_DEVICE_INTEL =      (1<<2),
-	GPU_DEVICE_SOFTWARE =   (1<<3),
-	GPU_DEVICE_UNKNOWN =    (1<<4),
+	GPU_DEVICE_NVIDIA =     (1 << 0),
+	GPU_DEVICE_ATI =        (1 << 1),
+	GPU_DEVICE_INTEL =      (1 << 2),
+	GPU_DEVICE_SOFTWARE =   (1 << 3),
+	GPU_DEVICE_UNKNOWN =    (1 << 4),
 	GPU_DEVICE_ANY =        (0xff)
 } GPUDeviceType;
 
 typedef enum GPUOSType {
-	GPU_OS_WIN =            (1<<8),
-	GPU_OS_MAC =            (1<<9),
-	GPU_OS_UNIX =           (1<<10),
+	GPU_OS_WIN =            (1 << 8),
+	GPU_OS_MAC =            (1 << 9),
+	GPU_OS_UNIX =           (1 << 10),
 	GPU_OS_ANY =            (0xff00)
 } GPUOSType;
 
 typedef enum GPUDriverType {
-	GPU_DRIVER_OFFICIAL =   (1<<16),
-	GPU_DRIVER_OPENSOURCE = (1<<17),
-	GPU_DRIVER_SOFTWARE =   (1<<18),
+	GPU_DRIVER_OFFICIAL =   (1 << 16),
+	GPU_DRIVER_OPENSOURCE = (1 << 17),
+	GPU_DRIVER_SOFTWARE =   (1 << 18),
 	GPU_DRIVER_ANY =        (0xff0000)
 } GPUDriverType;
 
diff --git a/source/blender/gpu/GPU_framebuffer.h b/source/blender/gpu/GPU_framebuffer.h
index 973da5d..2719b8f 100644
--- a/source/blender/gpu/GPU_framebuffer.h
+++ b/source/blender/gpu/GPU_framebuffer.h
@@ -62,7 +62,9 @@ void GPU_framebuffer_bind_no_save(GPUFrameBuffer *fb, int slot);
 bool GPU_framebuffer_bound(GPUFrameBuffer *fb);
 
 void GPU_framebuffer_restore(void);
-void GPU_framebuffer_blur(GPUFrameBuffer *fb, struct GPUTexture *tex, GPUFrameBuffer *blurfb, struct GPUTexture *blurtex);
+void GPU_framebuffer_blur(
+        GPUFrameBuffer *fb, struct GPUTexture *tex,
+        GPUFrameBuffer *blurfb, struct GPUTexture *blurtex);
 
 /* GPU OffScreen
  * - wrapper around framebuffer and texture for simple offscreen drawing
diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h
index 25a4f33..40b3286 100644
--- a/source/blender/gpu/GPU_material.h
+++ b/source/blender/gpu/GPU_material.h
@@ -214,8 +214,12 @@ void GPU_material_free(struct ListBase *gpumaterial);
 void GPU_materials_free(void);
 
 bool GPU_lamp_override_visible(GPULamp *lamp, struct SceneRenderLayer *srl, struct Material *ma);
-void GPU_material_bind(GPUMaterial *material, int oblay, int viewlay, double time, int mipmap, float viewmat[4][4], float viewinv[4][4], float cameraborder[4], bool scenelock);
-void GPU_material_bind_uniforms(GPUMaterial *material, float obmat[4][4], float obcol[4], float autobumpscale, GPUParticleInfo *pi);
+void GPU_material_bind(
+        GPUMaterial *material, int oblay, int viewlay, double time, int mipmap,
+        float viewmat[4][4], float viewinv[4][4], float cameraborder[4], bool scenelock);
+void GPU_material_bind_uniforms(
+        GPUMaterial *material, float obmat[4][4], float obcol[4],
+        float autobumpscale, GPUParticleInfo *pi);
 void GPU_material_unbind(GPUMaterial *material);
 bool GPU_material_bound(GPUMaterial *material);
 struct Scene *GPU_material_scene(GPUMaterial *material);
@@ -269,7 +273,8 @@ typedef struct GPUInputUniform {
 	struct Image *image;      /* when type=GPU_DYNAMIC_SAMPLER_2DIMAGE */
 	int texnumber;            /* when type=GPU_DYNAMIC_SAMPLER, texture number: 0.. */
 	unsigned char *texpixels; /* for internally generated texture, pixel data in RGBA format */
-	int texsize;              /* size in pixel of the texture in texpixels buffer: for 2D textures, this is S and T size (square texture) */
+	int texsize;              /* size in pixel of the texture in texpixels buffer:
+	                           * for 2D textures, this is S and T size (square texture) */
 } GPUInputUniform;
 
 typedef struct GPUInputAttribute {
@@ -307,7 +312,9 @@ void GPU_lamp_update_colors(GPULamp *lamp, float r, float g, float b, float ener
 void GPU_lamp_update_distance(GPULamp *lamp, float distance, float att1, float att2);
 void GPU_lamp_update_spot(GPULamp *lamp, float spotsize, float spotblend);
 int GPU_lamp_shadow_layer(GPULamp *lamp);
-GPUNodeLink *GPU_lamp_get_data(GPUMaterial *mat, GPULamp *lamp, GPUNodeLink **col, GPUNodeLink **lv, GPUNodeLink **dist, GPUNodeLink **shadow, GPUNodeLink **energy);
+GPUNodeLink *GPU_lamp_get_data(
+        GPUMaterial *mat, GPULamp *lamp,
+        GPUNodeLink **r_col, GPUNodeLink **r_lv, GPUNodeLink **r_dist, GPUNodeLink **r_shadow, GPUNodeLink **r_energy);
 
 /* World */
 void GPU_mist_update_enable(short enable);
@@ -334,4 +341,3 @@ void GPU_material_update_fvar_offset(GPUMaterial *gpu_material,
 #endif
 
 #endif /*__GPU_MATERIAL_H__*/
-
diff --git a/source/blender/gpu/GPU_select.h b/source/blender/gpu/GPU_select.h
index 5dff711..6a16b5b 100644
--- a/source/blender/gpu/GPU_select.h
+++ b/source/blender/gpu/GPU_select.h
@@ -40,19 +40,9 @@ enum {
 	GPU_SELECT_NEAREST_SECOND_PASS      = 3,
 };
 
-/* initialize and provide buffer for results */
 void GPU_select_begin(unsigned int *buffer, unsigned int bufsize, rctf *input, char mode, int oldhits);
-
-/* loads a new selection id and ends previous query, if any. In second pass of selection it also returns
- * if id has been hit on the first pass already. Thus we can skip drawing un-hit objects IMPORTANT: We rely on the order of object rendering on passes to be
- * the same for this to work */
 bool GPU_select_load_id(unsigned int id);
-
-/* cleanup and flush selection results to buffer. Return number of hits and hits in buffer.
- * if dopass is true, we will do a second pass with occlusion queries to get the closest hit */
 unsigned int GPU_select_end(void);
-
-/* has user activated? */
 bool GPU_select_query_check_active(void);
 
 #endif
diff --git a/source/blender/gpu/GPU_shader.h b/source/blender/gpu/GPU_shader.h
index b80c425..6464fb7 100644
--- a/source/blender/gpu/GPU_shader.h
+++ b/source/blender/gpu/GPU_shader.h
@@ -56,20 +56,26 @@ void GPU_program_unbind(GPUProgram *);
  * - only for fragment shaders now
  * - must call texture bind before setting a texture as uniform! */
 
-GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, const char *geocode, const char *libcode, const char *defines, int input, int output, int number);
 enum {
 	GPU_SHADER_FLAGS_NONE = 0,
 	GPU_SHADER_FLAGS_SPECIAL_OPENSUBDIV = (1 << 0),
 };
-GPUShader *GPU_shader_create_ex(const char *vertexcode,
-                                const char *fragcode,
-                                const char *geocode,
-                                const char *libcode,

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list