Commit: bf1b622dd962416fef94ccb2f47878eced31e20d
Author: Clément Foucault
Date: Sun Aug 16 15:38:34 2020 +0200
Branches: master
https://developer.blender.org/rBbf1b622dd962416fef94ccb2f47878eced31e20d
GPUState: GPU_blend final API renaming
We now use GPU_blend for enabling / disabling blending and explicitly
set the blend equation.
===================================================================
M source/blender/blenfont/intern/blf_font.c
M source/blender/draw/intern/draw_manager.c
M source/blender/draw/intern/draw_view.c
M source/blender/editors/animation/anim_channels_defines.c
M source/blender/editors/animation/anim_draw.c
M source/blender/editors/animation/anim_markers.c
M source/blender/editors/animation/keyframes_draw.c
M source/blender/editors/animation/time_scrub_ui.c
M source/blender/editors/curve/editcurve_paint.c
M source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c
M source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
M source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
M source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c
M source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c
M source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c
M source/blender/editors/gizmo_library/gizmo_types/primitive3d_gizmo.c
M source/blender/editors/gpencil/annotate_draw.c
M source/blender/editors/gpencil/annotate_paint.c
M source/blender/editors/gpencil/gpencil_fill.c
M source/blender/editors/gpencil/gpencil_paint.c
M source/blender/editors/gpencil/gpencil_utils.c
M source/blender/editors/interface/interface.c
M source/blender/editors/interface/interface_draw.c
M source/blender/editors/interface/interface_icons.c
M source/blender/editors/interface/interface_panel.c
M source/blender/editors/interface/interface_region_search.c
M source/blender/editors/interface/interface_widgets.c
M source/blender/editors/mask/mask_draw.c
M source/blender/editors/mesh/editmesh_knife.c
M source/blender/editors/object/object_remesh.c
M source/blender/editors/physics/particle_edit.c
M source/blender/editors/screen/area.c
M source/blender/editors/screen/screen_draw.c
M source/blender/editors/sculpt_paint/paint_cursor.c
M source/blender/editors/sculpt_paint/paint_image.c
M source/blender/editors/sculpt_paint/paint_stroke.c
M source/blender/editors/space_action/action_draw.c
M source/blender/editors/space_clip/clip_dopesheet_draw.c
M source/blender/editors/space_clip/clip_draw.c
M source/blender/editors/space_clip/clip_graph_draw.c
M source/blender/editors/space_clip/clip_utils.c
M source/blender/editors/space_file/file_draw.c
M source/blender/editors/space_graph/graph_draw.c
M source/blender/editors/space_graph/space_graph.c
M source/blender/editors/space_image/image_draw.c
M source/blender/editors/space_info/textview.c
M source/blender/editors/space_nla/nla_draw.c
M source/blender/editors/space_node/drawnode.c
M source/blender/editors/space_node/node_draw.c
M source/blender/editors/space_outliner/outliner_draw.c
M source/blender/editors/space_sequencer/sequencer_draw.c
M source/blender/editors/space_text/text_draw.c
M source/blender/editors/space_view3d/drawobject.c
M source/blender/editors/space_view3d/view3d_draw.c
M source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
M source/blender/editors/space_view3d/view3d_gizmo_ruler.c
M source/blender/editors/space_view3d/view3d_placement.c
M source/blender/editors/transform/transform.c
M source/blender/editors/transform/transform_constraints.c
M source/blender/editors/transform/transform_draw_cursors.c
M source/blender/editors/transform/transform_gizmo_3d.c
M source/blender/editors/transform/transform_mode_edge_slide.c
M source/blender/editors/transform/transform_mode_vert_slide.c
M source/blender/editors/transform/transform_snap.c
M source/blender/editors/uvedit/uvedit_draw.c
M source/blender/editors/uvedit/uvedit_smart_stitch.c
M source/blender/gpu/GPU_state.h
M source/blender/gpu/intern/gpu_state.cc
M source/blender/windowmanager/intern/wm_dragdrop.c
M source/blender/windowmanager/intern/wm_draw.c
M source/blender/windowmanager/intern/wm_gesture.c
M source/blender/windowmanager/intern/wm_operators.c
M source/blender/windowmanager/intern/wm_playanim.c
===================================================================
diff --git a/source/blender/blenfont/intern/blf_font.c
b/source/blender/blenfont/intern/blf_font.c
index 2a6bc41704b..7febfb5d3d5 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -221,8 +221,8 @@ void blf_batch_draw(void)
return;
}
- GPU_blend(true);
- GPU_blend_set_func_separate(GPU_BLEND_ALPHA);
+ GPU_blend(GPU_BLEND_ALPHA);
+ GPU_blend(GPU_BLEND_ALPHA);
#ifndef BLF_STANDALONE
/* We need to flush widget base first to ensure correct ordering. */
@@ -238,7 +238,7 @@ void blf_batch_draw(void)
GPU_batch_uniform_1i(g_batch.batch, "glyph", 0);
GPU_batch_draw(g_batch.batch);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
/* restart to 1st vertex data pointers */
GPU_vertbuf_attr_get_raw_data(g_batch.verts, g_batch.pos_loc,
&g_batch.pos_step);
diff --git a/source/blender/draw/intern/draw_manager.c
b/source/blender/draw/intern/draw_manager.c
index fd57934b8e5..4e8b931f6a6 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -1595,8 +1595,8 @@ void DRW_draw_render_loop_offscreen(struct Depsgraph
*depsgraph,
GPU_clear_color(0.0f, 0.0f, 0.0f, 1.0f);
GPU_clear(GPU_COLOR_BIT);
/* Premult Alpha over black background. */
- GPU_blend_set_func_separate(GPU_BLEND_ALPHA_PREMULT);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA_PREMULT);
+ GPU_blend(GPU_BLEND_ALPHA);
}
GPU_matrix_identity_set();
@@ -1606,8 +1606,8 @@ void DRW_draw_render_loop_offscreen(struct Depsgraph
*depsgraph,
if (draw_background) {
/* Reset default. */
- GPU_blend_set_func_separate(GPU_BLEND_ALPHA);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_ALPHA);
+ GPU_blend(GPU_BLEND_NONE);
}
/* Free temporary viewport. */
diff --git a/source/blender/draw/intern/draw_view.c
b/source/blender/draw/intern/draw_view.c
index 1458ff5341c..0dc35d44788 100644
--- a/source/blender/draw/intern/draw_view.c
+++ b/source/blender/draw/intern/draw_view.c
@@ -123,7 +123,7 @@ void DRW_draw_cursor(void)
/* Draw nice Anti Aliased cursor. */
GPU_line_width(1.0f);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
GPU_line_smooth(true);
float eps = 1e-5f;
@@ -188,7 +188,7 @@ void DRW_draw_cursor(void)
GPU_batch_draw(cursor_batch);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
GPU_line_smooth(false);
GPU_matrix_pop();
GPU_matrix_projection_set(original_proj);
diff --git a/source/blender/editors/animation/anim_channels_defines.c
b/source/blender/editors/animation/anim_channels_defines.c
index aa5dffffe36..656ff844948 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -4386,8 +4386,8 @@ void ANIM_channel_draw(
}
/* set blending again, as may not be set in previous step */
- GPU_blend_set_func_separate(GPU_BLEND_ALPHA);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
+ GPU_blend(GPU_BLEND_ALPHA);
/* step 1) draw backdrop ........................................... */
if (acf->draw_backdrop) {
@@ -4436,7 +4436,7 @@ void ANIM_channel_draw(
}
/* turn off blending, since not needed anymore... */
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
/* icon is drawn as widget now... */
if (acf->has_setting(ac, ale, ACHANNEL_SETTING_VISIBLE)) {
diff --git a/source/blender/editors/animation/anim_draw.c
b/source/blender/editors/animation/anim_draw.c
index 16c6638b6d9..0bebc25863b 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -98,8 +98,8 @@ void ANIM_draw_previewrange(const bContext *C, View2D *v2d,
int end_frame_width)
/* only draw this if preview range is set */
if (PRVRANGEON) {
- GPU_blend_set_func_separate(GPU_BLEND_ALPHA);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
+ GPU_blend(GPU_BLEND_ALPHA);
GPUVertFormat *format = immVertexFormat();
uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2,
GPU_FETCH_FLOAT);
@@ -120,7 +120,7 @@ void ANIM_draw_previewrange(const bContext *C, View2D *v2d,
int end_frame_width)
immUnbindProgram();
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
}
@@ -132,8 +132,8 @@ void ANIM_draw_previewrange(const bContext *C, View2D *v2d,
int end_frame_width)
void ANIM_draw_framerange(Scene *scene, View2D *v2d)
{
/* draw darkened area outside of active timeline frame range */
- GPU_blend_set_func_separate(GPU_BLEND_ALPHA);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
+ GPU_blend(GPU_BLEND_ALPHA);
GPUVertFormat *format = immVertexFormat();
uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2,
GPU_FETCH_FLOAT);
@@ -149,7 +149,7 @@ void ANIM_draw_framerange(Scene *scene, View2D *v2d)
immRectf(pos, v2d->cur.xmin, v2d->cur.ymin, v2d->cur.xmax, v2d->cur.ymax);
}
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
/* thin lines where the actual frames are */
immUniformThemeColorShade(TH_BACK, -60);
diff --git a/source/blender/editors/animation/anim_markers.c
b/source/blender/editors/animation/anim_markers.c
index 4e4e6b38342..5f755b9f4d9 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -499,15 +499,15 @@ static void draw_marker(
marker_color_get(marker, text_color, line_color);
- GPU_blend(true);
- GPU_blend_set_func_separate(GPU_BLEND_ALPHA);
+ GPU_blend(GPU_BLEND_ALPHA);
+ GPU_blend(GPU_BLEND_ALPHA);
draw_marker_line(line_color, xpos, UI_DPI_FAC * 20, region_height);
int icon_id = marker_get_icon_id(marker, flag);
UI_icon_draw(xpos - 0.55f * UI_DPI_ICON_SIZE, UI_DPI_FAC * 18, icon_id);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
float name_y = UI_DPI_FAC * 18;
/* Give an offset to the marker name when selected,
@@ -528,12 +528,12 @@ static void draw_markers_background(rctf *rect)
immUniformColor4ubv(shade);
- GPU_blend(true);
- GPU_blend_set_func_separate(GPU_BLEND_ALPHA);
+ GPU_blend(GPU_BLEND_ALPHA);
+ GPU_blend(GPU_BLEND_ALPHA);
immRectf(pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
immUnbindProgram();
}
diff --git a/source/blender/editors/animation/keyframes_draw.c
b/source/blender/editors/animation/keyframes_draw.c
index c69f3ce3e3a..4d6d7fa3ad5 100644
--- a/source/blender/editors/animation/keyframes_draw.c
+++ b/source/blender/editors/animation/keyframes_draw.c
@@ -692,7 +692,7 @@ static void draw_keylist(View2D *v2d,
const float smaller_sz = 0.35f * icon_sz;
const float ipo_sz = 0.1f * icon_sz;
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
/* locked channels are less strongly shown, as feedback for locked channels
in DopeSheet */
/* TODO: allow this opacity factor to be themed? */
@@ -848,7 +848,7 @@ static void draw_keylist(View2D *v2d,
}
}
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
/* *************************** Channel Drawing Funcs
*************************** */
diff --git a/source/blender/editors/animation/time_scrub_ui.c
b/source/blender/editors/animation/time_scrub_ui.c
index 8c2c01c60de..1690c9e3bba 100644
--- a/source/blender/editors/animation/time_scrub_ui.c
+++ b/source/blender/editors/animation/time_scrub_ui.c
@@ -66,12 +66,12 @@ static void draw_background(const rcti *rect)
immUniformThemeColor(TH_TIME_SCRUB_BACKGROUND);
- GPU_blend(true);
- GPU_blend_set_func_separate(GPU_BLEND_ALPHA);
+ GPU_blend(GPU_BLEND_ALPHA);
+ GPU_blend(GPU_BLEND_ALPHA);
immRectf(pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
immUnbindProgram();
}
diff --git a/source/blender/editors/curve/editcurve_paint.c
b/source/blender/editors/curve/editcurve_paint.c
index ebad1995717..2dac273501d 100644
--- a/source/blender/editors/curve/editcurve_paint.c
+++ b/source/blender/editors/curve/editcurve_paint.c
@@ -420,7 +420,7 @@ static void curve_draw_stroke_3d(const struct bContext
*UNUSED(C),
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
GPU_depth_test(false);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
GPU_line_smooth(true);
GPU_line_width(3.0f);
@@ -442,7 +442,7 @@ static void curve_draw_stroke_3d(const struct bContext
*UNUSED(C),
/* Reset defaults */
GPU_depth_test(true);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
GPU_line_smooth(false);
immUnbindProgram();
diff --git a/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c
b/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c
index 341f43d0662..d4d9f9bf424 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/arrow3d_gizmo.c
@@ -195,9 +195,9 @@ static void arrow_draw_intern(ArrowGizmo3D *arrow, const
bool select, const bool
GPU_matrix_push();
GPU_matrix_mul(matrix_final);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
arrow_draw_geom(arrow, select, color);
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
GPU_matrix_pop();
@@ -207,9 +207,9 @@ static void arrow_draw_intern(ArrowGizmo3D *arrow, const
bool select, const bool
GPU_matrix_push();
GPU_matrix_mul(inter->init_matrix_final);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
arrow_draw_geom(arrow, select, (const float[4]){0.5f, 0.5f, 0.5f, 0.5f});
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
GPU_matrix_pop();
}
diff --git a/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
b/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
index ef3381110d4..13f3903f0b2 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c
@@ -195,7 +195,7 @@ static void button2d_draw_intern(const bContext *C,
}
else {
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
if (draw_options & ED_GIZMO_BUTTON_SHOW_BACKDROP)
@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs