[Bf-blender-cvs] [4eb6b35] viewport_experiments: Use an enum for enabled GPU Fx

Antony Riakiotakis noreply at git.blender.org
Thu Feb 12 16:40:20 CET 2015


Commit: 4eb6b35926c5481714848bcdfa5bcf228ecb609e
Author: Antony Riakiotakis
Date:   Tue Feb 10 16:39:26 2015 +0100
Branches: viewport_experiments
https://developer.blender.org/rB4eb6b35926c5481714848bcdfa5bcf228ecb609e

Use an enum for enabled GPU Fx

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

M	source/blender/editors/include/ED_view3d.h
M	source/blender/editors/space_view3d/view3d_draw.c
M	source/blender/gpu/GPU_compositing.h
M	source/blender/gpu/intern/gpu_compositing.c
M	source/blender/makesdna/DNA_gpu_types.h

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

diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index 4facb2f..cb8a3eb 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -64,6 +64,7 @@ struct wmWindow;
 struct GPUFX;
 struct GPUOffScreen;
 struct GPUFXOptions;
+enum GPUFxFlags;
 
 /* for derivedmesh drawing callbacks, for view3d_select, .... */
 typedef struct ViewContext {
@@ -307,7 +308,7 @@ int ED_view3d_scene_layer_set(int lay, const int *values, int *active);
 bool ED_view3d_context_activate(struct bContext *C);
 void ED_view3d_draw_offscreen_init(struct Scene *scene, struct View3D *v3d);
 void ED_view3d_draw_offscreen(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, int winx, int winy, float viewmat[4][4],
-                              float winmat[4][4], bool do_bgpic, bool do_sky, struct GPUFX *fx, bool is_persp, struct GPUOffScreen *ofs, struct GPUFXOptions *fxoptions, int fxflags);
+                              float winmat[4][4], bool do_bgpic, bool do_sky, struct GPUFX *fx, bool is_persp, struct GPUOffScreen *ofs, struct GPUFXOptions *fxoptions, enum GPUFxFlags fxflags);
 
 struct ImBuf *ED_view3d_draw_offscreen_imbuf(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, int sizex, int sizey, unsigned int flag,
                                              bool draw_background, int alpha_mode, char err_out[256]);
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 7c80c71..63890ba 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -3052,7 +3052,7 @@ static void view3d_main_area_clear(Scene *scene, View3D *v3d, ARegion *ar, bool
  */
 void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar, int winx, int winy,
                               float viewmat[4][4], float winmat[4][4],
-                              bool do_bgpic, bool do_sky, GPUFX *fx, bool is_persp, GPUOffScreen *ofs, GPUFXOptions *fxoptions, int fxflags)
+                              bool do_bgpic, bool do_sky, GPUFX *fx, bool is_persp, GPUOffScreen *ofs, GPUFXOptions *fxoptions, GPUFxFlags fxflags)
 {
 	struct bThemeState theme_state;
 	int bwinx, bwiny;
diff --git a/source/blender/gpu/GPU_compositing.h b/source/blender/gpu/GPU_compositing.h
index cc00185..fe2bc5b 100644
--- a/source/blender/gpu/GPU_compositing.h
+++ b/source/blender/gpu/GPU_compositing.h
@@ -45,6 +45,7 @@ struct RegionView3D;
 struct rcti;
 struct Scene;
 struct View3D;
+enum GPUFXFlags;
 
 /**** Public API *****/
 
@@ -70,7 +71,7 @@ GPUFX *GPU_create_fx_compositor(void);
 void GPU_destroy_fx_compositor(GPUFX *fx);
 
 /* initialize a framebuffer with size taken from the viewport */
-bool GPU_initialize_fx_passes(GPUFX *fx, struct rcti *rect, rcti *scissor_rect, int fxflags, struct GPUFXOptions *options);
+bool GPU_initialize_fx_passes(GPUFX *fx, struct rcti *rect, rcti *scissor_rect, enum GPUFxFlags fxflags, struct GPUFXOptions *options);
 
 /* 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);
diff --git a/source/blender/gpu/intern/gpu_compositing.c b/source/blender/gpu/intern/gpu_compositing.c
index 73c4a31..9dabbb3 100644
--- a/source/blender/gpu/intern/gpu_compositing.c
+++ b/source/blender/gpu/intern/gpu_compositing.c
@@ -253,7 +253,7 @@ static GPUTexture * create_jitter_texture(void)
 }
 
 
-bool GPU_initialize_fx_passes(GPUFX *fx, rcti *rect, rcti *scissor_rect, int fxflags, GPUFXOptions *options)
+bool GPU_initialize_fx_passes(GPUFX *fx, rcti *rect, rcti *scissor_rect, GPUFxFlags fxflags, GPUFXOptions *options)
 {
 	int w = BLI_rcti_size_x(rect) + 1, h = BLI_rcti_size_y(rect) + 1;
 	char err_out[256];
diff --git a/source/blender/makesdna/DNA_gpu_types.h b/source/blender/makesdna/DNA_gpu_types.h
index 2874a3c..d889687 100644
--- a/source/blender/makesdna/DNA_gpu_types.h
+++ b/source/blender/makesdna/DNA_gpu_types.h
@@ -57,7 +57,9 @@ typedef struct GPUFXOptions {
 
 
 /* shaderfx enables */
-#define GPU_FX_DEPTH_OF_FIELD  1
-#define GPU_FX_SSAO           (1 << 1)
+typedef enum GPUFxFlags{
+	GPU_FX_DEPTH_OF_FIELD  =  1,
+	GPU_FX_SSAO            = (1 << 1)
+} GPUFxFlags;
 
 #endif




More information about the Bf-blender-cvs mailing list