From 298329554a5a0ae40bc4a64ca9c1490d22edc947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Sun, 16 Aug 2020 16:48:21 +0200 Subject: Cleanup: GPUState: remove double GPU_blend calls --- source/blender/blenfont/intern/blf_font.c | 1 - source/blender/draw/intern/draw_manager.c | 2 -- source/blender/editors/animation/anim_channels_defines.c | 1 - source/blender/editors/animation/anim_draw.c | 2 -- source/blender/editors/animation/anim_markers.c | 2 -- source/blender/editors/animation/time_scrub_ui.c | 1 - source/blender/editors/gpencil/annotate_draw.c | 1 - source/blender/editors/gpencil/annotate_paint.c | 1 - source/blender/editors/gpencil/gpencil_paint.c | 1 - source/blender/editors/gpencil/gpencil_utils.c | 1 - source/blender/editors/interface/interface_draw.c | 9 --------- source/blender/editors/interface/interface_widgets.c | 2 -- source/blender/editors/mask/mask_draw.c | 2 -- source/blender/editors/mesh/editmesh_knife.c | 1 - source/blender/editors/screen/area.c | 3 --- source/blender/editors/screen/screen_draw.c | 2 -- source/blender/editors/sculpt_paint/paint_cursor.c | 2 -- source/blender/editors/space_clip/clip_draw.c | 3 --- source/blender/editors/space_clip/clip_utils.c | 1 - source/blender/editors/space_graph/graph_draw.c | 1 - source/blender/editors/space_image/image_draw.c | 5 ----- source/blender/editors/space_info/textview.c | 1 - source/blender/editors/space_nla/nla_draw.c | 3 --- source/blender/editors/space_node/drawnode.c | 1 - source/blender/editors/space_sequencer/sequencer_draw.c | 4 ---- source/blender/editors/space_text/text_draw.c | 1 - source/blender/editors/space_view3d/drawobject.c | 1 - source/blender/editors/space_view3d/view3d_draw.c | 3 --- source/blender/editors/transform/transform.c | 1 - source/blender/editors/transform/transform_mode_edge_slide.c | 1 - source/blender/editors/transform/transform_mode_vert_slide.c | 1 - source/blender/gpu/GPU_state.h | 1 - source/blender/windowmanager/intern/wm_draw.c | 3 +-- source/blender/windowmanager/intern/wm_gesture.c | 1 - source/blender/windowmanager/intern/wm_playanim.c | 1 - 35 files changed, 1 insertion(+), 66 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 7febfb5d3d5..5724d844089 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -222,7 +222,6 @@ void blf_batch_draw(void) } GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); #ifndef BLF_STANDALONE /* We need to flush widget base first to ensure correct ordering. */ diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 4e8b931f6a6..11430c4075e 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -1596,7 +1596,6 @@ void DRW_draw_render_loop_offscreen(struct Depsgraph *depsgraph, GPU_clear(GPU_COLOR_BIT); /* Premult Alpha over black background. */ GPU_blend(GPU_BLEND_ALPHA_PREMULT); - GPU_blend(GPU_BLEND_ALPHA); } GPU_matrix_identity_set(); @@ -1606,7 +1605,6 @@ void DRW_draw_render_loop_offscreen(struct Depsgraph *depsgraph, if (draw_background) { /* Reset default. */ - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_NONE); } diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 656ff844948..0a464e6709a 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -4387,7 +4387,6 @@ void ANIM_channel_draw( /* set blending again, as may not be set in previous step */ GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); /* step 1) draw backdrop ........................................... */ if (acf->draw_backdrop) { diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 0bebc25863b..73df0518f06 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -99,7 +99,6 @@ 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(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); @@ -133,7 +132,6 @@ void ANIM_draw_framerange(Scene *scene, View2D *v2d) { /* draw darkened area outside of active timeline frame range */ 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); diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 5f755b9f4d9..3bfa3b9d5be 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -499,7 +499,6 @@ static void draw_marker( marker_color_get(marker, text_color, line_color); - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); draw_marker_line(line_color, xpos, UI_DPI_FAC * 20, region_height); @@ -528,7 +527,6 @@ static void draw_markers_background(rctf *rect) immUniformColor4ubv(shade); - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); immRectf(pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax); diff --git a/source/blender/editors/animation/time_scrub_ui.c b/source/blender/editors/animation/time_scrub_ui.c index 1690c9e3bba..0615e21c4a5 100644 --- a/source/blender/editors/animation/time_scrub_ui.c +++ b/source/blender/editors/animation/time_scrub_ui.c @@ -66,7 +66,6 @@ static void draw_background(const rcti *rect) immUniformThemeColor(TH_TIME_SCRUB_BACKGROUND); - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); immRectf(pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax); diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c index 78f4df8f71a..654d1b87918 100644 --- a/source/blender/editors/gpencil/annotate_draw.c +++ b/source/blender/editors/gpencil/annotate_draw.c @@ -735,7 +735,6 @@ static void annotation_draw_data( /* turn on alpha-blending */ GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); /* Do not write to depth (avoid self-occlusion). */ bool prev_depth_mask = GPU_depth_mask_get(); diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c index 56f554e5b7c..8237e6cfd62 100644 --- a/source/blender/editors/gpencil/annotate_paint.c +++ b/source/blender/editors/gpencil/annotate_paint.c @@ -1701,7 +1701,6 @@ static void annotation_draw_eraser(bContext *UNUSED(C), int x, int y, void *p_pt GPU_line_smooth(true); GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); immUniformColor4ub(255, 100, 100, 20); imm_draw_circle_fill_2d(shdr_pos, x, y, p->radius, 40); diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 251d1b22846..3f62c3ec8c0 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -2269,7 +2269,6 @@ static void gpencil_draw_eraser(bContext *UNUSED(C), int x, int y, void *p_ptr) GPU_line_smooth(true); GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); immUniformColor4ub(255, 100, 100, 20); imm_draw_circle_fill_2d(shdr_pos, x, y, p->radius, 40); diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 46de164f381..8b77709bacb 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -1761,7 +1761,6 @@ void ED_gpencil_brush_draw_eraser(Brush *brush, int x, int y) GPU_line_smooth(true); GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); immUniformColor4ub(255, 100, 100, 20); imm_draw_circle_fill_2d(shdr_pos, x, y, radius, 40); diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 8ebc8e60993..ba878be3dc7 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -752,7 +752,6 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(region), GPU_scissor(rect->xmin, rect->ymin, w, h); # endif - GPU_blend(GPU_BLEND_ALPHA); /* Combine with premultiplied alpha. */ GPU_blend(GPU_BLEND_ALPHA_PREMULT); @@ -781,8 +780,6 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(region), col); GPU_blend(GPU_BLEND_NONE); - /* Reset default. */ - GPU_blend(GPU_BLEND_ALPHA); # if 0 // restore scissortest @@ -924,7 +921,6 @@ void ui_draw_but_HISTOGRAM(ARegion *UNUSED(region), float w = BLI_rctf_size_x(&rect); float h = BLI_rctf_size_y(&rect) * hist->ymax; - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); float color[4]; @@ -1067,7 +1063,6 @@ void ui_draw_but_WAVEFORM(ARegion *UNUSED(region), /* Flush text cache before changing scissors. */ BLF_batch_draw_flush(); - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); float color[4]; @@ -1095,7 +1090,6 @@ void ui_draw_but_WAVEFORM(ARegion *UNUSED(region), /* Flush text cache before drawing things on top. */ BLF_batch_draw_flush(); - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); GPUVertFormat *format = immVertexFormat(); @@ -1398,7 +1392,6 @@ void ui_draw_but_VECTORSCOPE(ARegion *UNUSED(region), float alpha = scopes->vecscope_alpha * scopes->vecscope_alpha * scopes->vecscope_alpha; - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); float color[4]; @@ -1956,7 +1949,6 @@ void ui_draw_but_CURVE(ARegion *region, uiBut *but, const uiWidgetColors *wcol, if (but->a1 == UI_GRAD_H) { /* grid, hsv uses different grid */ GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); ARRAY_SET_ITEMS(color_backdrop, 0, 0, 0, 48.0 / 255.0); immUniformColor4fv(color_backdrop); ui_draw_but_curve_grid(pos, rect, zoomx, zoomy, offsx, offsy, 0.1666666f); @@ -2459,7 +2451,6 @@ void ui_draw_but_TRACKPREVIEW(ARegion *UNUSED(region), int width = BLI_rctf_size_x(&rect) + 1; int height = BLI_rctf_size_y(&rect); - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); /* need scissor test, preview image can draw outside of boundary */ diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index e946aec2176..5410eed9915 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2784,7 +2784,6 @@ static void widget_menu_back(uiWidgetColors *wcol, rcti *rect, int flag, int dir rect->ymax += 0.1f * U.widget_unit; } - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); widget_softshadow(rect, roundboxalign, wcol->roundness * U.widget_unit); @@ -5163,7 +5162,6 @@ static void ui_draw_widget_back_color(uiWidgetTypeEnum type, uiWidgetType *wt = widget_type(type); if (use_shadow) { - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); widget_softshadow(rect, UI_CNR_ALL, 0.25f * U.widget_unit); GPU_blend(GPU_BLEND_NONE); diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c index b5db7b3d37e..dbaa335a9bf 100644 --- a/source/blender/editors/mask/mask_draw.c +++ b/source/blender/editors/mask/mask_draw.c @@ -594,7 +594,6 @@ static void draw_mask_layers(const bContext *C, const int width, const int height) { - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); GPU_program_point_size(true); @@ -739,7 +738,6 @@ void ED_mask_draw_region( if (overlay_mode != MASK_OVERLAY_ALPHACHANNEL) { /* More blending types could be supported in the future. */ - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_MULTIPLY); } diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 1c1b69ca719..94cd7650abe 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -1128,7 +1128,6 @@ static void knifetool_draw(const bContext *UNUSED(C), ARegion *UNUSED(region), v int i, snapped_verts_count, other_verts_count; float fcol[4]; - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); GPUVertBuf *vert = GPU_vertbuf_create_with_format(format); diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 784a933d494..5004b0132c2 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -94,7 +94,6 @@ static void region_draw_emboss(const ARegion *region, const rcti *scirct, int si /* set transp line */ GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); float color[4] = {0.0f, 0.0f, 0.0f, 0.25f}; UI_GetThemeColor3fv(TH_EDITOR_OUTLINE, color); @@ -311,7 +310,6 @@ static void region_draw_azones(ScrArea *area, ARegion *region) GPU_line_width(1.0f); GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); GPU_matrix_push(); GPU_matrix_translate_2f(-region->winrct.xmin, -region->winrct.ymin); @@ -3269,7 +3267,6 @@ void ED_region_info_draw_multiline(ARegion *region, GPU_scissor_get(scissor); GPU_scissor(rect.xmin, rect.ymin, BLI_rcti_size_x(&rect) + 1, BLI_rcti_size_y(&rect) + 1); - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); GPUVertFormat *format = immVertexFormat(); uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); diff --git a/source/blender/editors/screen/screen_draw.c b/source/blender/editors/screen/screen_draw.c index a9e38244f62..a5d3c4842e6 100644 --- a/source/blender/editors/screen/screen_draw.c +++ b/source/blender/editors/screen/screen_draw.c @@ -410,7 +410,6 @@ void ED_screen_draw_edges(wmWindow *win) corner_scale = U.pixelsize * 8.0f; edge_thickness = corner_scale * 0.21f; - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); GPUBatch *batch = batch_screen_edges_get(&verts_per_corner); @@ -484,7 +483,6 @@ void ED_screen_draw_split_preview(ScrArea *area, const int dir, const float fac) /* splitpoint */ GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); immUniformColor4ub(255, 255, 255, 100); diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index bb4139cc510..4115b5e51d6 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -634,7 +634,6 @@ static bool paint_draw_tex_overlay(UnifiedPaintSettings *ups, uint texCoord = GPU_vertformat_attr_add(format, "texCoord", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); /* Premultiplied alpha blending. */ - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA_PREMULT); immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_COLOR); @@ -727,7 +726,6 @@ static bool paint_draw_cursor_overlay( uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); uint texCoord = GPU_vertformat_attr_add(format, "texCoord", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA_PREMULT); immBindBuiltinProgram(GPU_SHADER_2D_IMAGE_COLOR); diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index 38c668acd37..17539b2c423 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -153,7 +153,6 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *region, MovieClip *clip MovieTrackingPlaneTrack *act_plane_track = BKE_tracking_plane_track_get_active(&clip->tracking); MovieTrackingReconstruction *reconstruction = BKE_tracking_get_active_reconstruction(tracking); - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); /* cache background */ @@ -330,7 +329,6 @@ static void draw_movieclip_buffer(const bContext *C, /* checkerboard for case alpha */ if (ibuf->planes == 32) { GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); imm_draw_box_checker_2d(x, y, x + zoomx * ibuf->x, y + zoomy * ibuf->y); } @@ -1211,7 +1209,6 @@ static void draw_plane_marker_image(Scene *scene, if (plane_track->image_opacity != 1.0f || ibuf->planes == 32) { transparent = true; GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); } GPUTexture *texture = GPU_texture_create_nD(ibuf->x, diff --git a/source/blender/editors/space_clip/clip_utils.c b/source/blender/editors/space_clip/clip_utils.c index 0de1497a1af..bcbf843f51c 100644 --- a/source/blender/editors/space_clip/clip_utils.c +++ b/source/blender/editors/space_clip/clip_utils.c @@ -416,7 +416,6 @@ void clip_draw_sfra_efra(View2D *v2d, Scene *scene) /* currently clip editor supposes that editing clip length is equal to scene frame range */ GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 0be3d8665cf..ac860b72e84 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -1263,7 +1263,6 @@ void graph_draw_channel_names(bContext *C, bAnimContext *ac, ARegion *region) /* set blending again, as may not be set in previous step */ GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); for (ale = anim_data.first; ale; ale = ale->next, ymax -= ACHANNEL_STEP(ac), channel_index++) { float ymin = ymax - ACHANNEL_HEIGHT(ac); diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index 6b79151da3f..d58f5ede7d7 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -175,7 +175,6 @@ void ED_image_draw_info(Scene *scene, float hue = 0, sat = 0, val = 0, lum = 0, u = 0, v = 0; float col[4], finalcol[4]; - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); uint pos = GPU_vertformat_attr_add( @@ -539,7 +538,6 @@ static void draw_udim_label(ARegion *region, float fx, float fy, const char *lab int x, y; UI_view2d_view_to_region(®ion->v2d, fx, fy, &x, &y); - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); int textwidth = BLF_width(blf_mono_font, label, strlen(label)) + 10; @@ -601,7 +599,6 @@ static void draw_image_buffer(const bContext *C, imm_draw_box_checker_2d(x, y, x + ibuf->x * zoomx, y + ibuf->y * zoomy); GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); } /* If RGBA display with color management */ @@ -768,7 +765,6 @@ static void draw_image_paint_helpers( return; } - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_COLOR); @@ -1054,7 +1050,6 @@ void draw_image_cache(const bContext *C, ARegion *region) const rcti *rect_visible = ED_region_visible_rect(region); const int region_bottom = rect_visible->ymin; - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); /* Draw cache background. */ diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c index 698adf7ee8e..4d9a4fb2706 100644 --- a/source/blender/editors/space_info/textview.c +++ b/source/blender/editors/space_info/textview.c @@ -84,7 +84,6 @@ static void textview_draw_sel(const char *str, const int sta = BLI_str_utf8_offset_to_column(str, max_ii(sel[0], 0)); const int end = BLI_str_utf8_offset_to_column(str, min_ii(sel[1], str_len_draw)); - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); GPUVertFormat *format = immVertexFormat(); diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 6d4684e7a17..b0d5360e29b 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -435,7 +435,6 @@ static void nla_draw_strip(SpaceNla *snla, if ((strip->extendmode != NLASTRIP_EXTEND_NOTHING) && (non_solo == 0)) { /* enable transparency... */ GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); switch (strip->extendmode) { /* since this does both sides, @@ -746,7 +745,6 @@ void draw_nla_main_data(bAnimContext *ac, SpaceNla *snla, ARegion *region) * and a second darker rect within which we draw keyframe indicator dots if there's data */ GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); /* get colors for drawing */ float color[4]; @@ -853,7 +851,6 @@ void draw_nla_channel_list(const bContext *C, bAnimContext *ac, ARegion *region) /* set blending again, as may not be set in previous step */ GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); /* loop through channels, and set up drawing depending on their type */ for (ale = anim_data.first; ale; diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index d889bcb15d6..fcc02f49d07 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3689,7 +3689,6 @@ void draw_nodespace_back_pix(const bContext *C, } else if (snode->flag & SNODE_USE_ALPHA) { GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); ED_draw_imbuf_ctx(C, ibuf, x, y, false, snode->zoom, snode->zoom); diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 2bc3550413d..b4556017c03 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -382,7 +382,6 @@ static void drawmeta_contents(Scene *scene, Sequence *seqm, float x1, float y1, offset = 0; } - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); for (seq = seqbase->first; seq; seq = seq->next) { @@ -752,7 +751,6 @@ static void draw_sequence_extensions(Scene *scene, Sequence *seq, uint pos, floa y1 = seq->machine + SEQ_STRIP_OFSBOTTOM; y2 = seq->machine + SEQ_STRIP_OFSTOP; - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); color3ubv_from_seq(scene, seq, col); @@ -842,7 +840,6 @@ static void draw_seq_background(Scene *scene, if (seq->flag & SEQ_MUTE) { GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); col[3] = MUTE_ALPHA; } @@ -1592,7 +1589,6 @@ static void sequencer_draw_display_buffer(const bContext *C, if (sseq->mainb == SEQ_DRAW_IMG_IMBUF && sseq->flag & SEQ_USE_ALPHA) { GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); } /* Format needs to be created prior to any immBindShader call. diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index f40cc98d4f7..f1b1d6760f3 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -1354,7 +1354,6 @@ static void draw_text_decoration(SpaceText *st, ARegion *region) highlight_color[3] = 0.1f; immUniformColor4fv(highlight_color); GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); immRecti(pos, 0, y1, region->winx, y2); GPU_blend(GPU_BLEND_NONE); } diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 3c5b5abdefc..6969ecf197e 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -132,7 +132,6 @@ void ED_draw_object_facemap(Depsgraph *depsgraph, const int *facemap_data = CustomData_get_layer(&me->pdata, CD_FACEMAP); if (facemap_data) { GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); const MVert *mvert = me->mvert; const MPoly *mpoly = me->mpoly; diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 6973e55e5ea..33b365b45aa 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -588,7 +588,6 @@ static void drawviewborder(Scene *scene, Depsgraph *depsgraph, ARegion *region, float alpha = 1.0f; if (ca->passepartalpha != 1.0f) { - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); alpha = ca->passepartalpha; } @@ -1027,7 +1026,6 @@ static void draw_view_axis(RegionView3D *rv3d, const rcti *rect) GPU_line_width(2.0f); GPU_line_smooth(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); @@ -1070,7 +1068,6 @@ static void draw_rotation_guide(const RegionView3D *rv3d) negate_v3_v3(o, rv3d->ofs); - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); GPU_depth_mask(false); /* don't overwrite zbuf */ diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index b97145c5f50..2fa291e7ae4 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1545,7 +1545,6 @@ static void drawAutoKeyWarning(TransInfo *UNUSED(t), ARegion *region) /* autokey recording icon... */ GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); xco -= U.widget_unit; yco -= (int)printable_size[1] / 2; diff --git a/source/blender/editors/transform/transform_mode_edge_slide.c b/source/blender/editors/transform/transform_mode_edge_slide.c index d9fd8880c3f..45debe964f4 100644 --- a/source/blender/editors/transform/transform_mode_edge_slide.c +++ b/source/blender/editors/transform/transform_mode_edge_slide.c @@ -1149,7 +1149,6 @@ void drawEdgeSlide(TransInfo *t) GPU_depth_test(false); - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); GPU_matrix_push(); diff --git a/source/blender/editors/transform/transform_mode_vert_slide.c b/source/blender/editors/transform/transform_mode_vert_slide.c index 1de7d219cae..11d0b375e6f 100644 --- a/source/blender/editors/transform/transform_mode_vert_slide.c +++ b/source/blender/editors/transform/transform_mode_vert_slide.c @@ -392,7 +392,6 @@ void drawVertSlide(TransInfo *t) GPU_depth_test(false); - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA); GPU_matrix_push(); diff --git a/source/blender/gpu/GPU_state.h b/source/blender/gpu/GPU_state.h index 089edb860ef..0aeb4df8b77 100644 --- a/source/blender/gpu/GPU_state.h +++ b/source/blender/gpu/GPU_state.h @@ -105,7 +105,6 @@ typedef enum eGPUProvokingVertex { * - this is called when starting Blender, for opengl rendering. */ void GPU_state_init(void); -void GPU_blend(bool enable); void GPU_blend(eGPUBlend blend); void GPU_face_culling(eGPUFaceCullTest culling); void GPU_front_facing(bool invert); diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index d5e175b8cb4..6f3fbf77987 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -576,8 +576,7 @@ void wm_draw_region_blend(ARegion *region, int view, bool blend) const float rectg[4] = {rect_geo.xmin, rect_geo.ymin, rect_geo.xmax, rect_geo.ymax}; if (blend) { - /* GL_ONE because regions drawn offscreen have premultiplied alpha. */ - GPU_blend(GPU_BLEND_ALPHA); + /* Regions drawn offscreen have premultiplied alpha. */ GPU_blend(GPU_BLEND_ALPHA_PREMULT); } diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index d73da935626..67733ffc673 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -353,7 +353,6 @@ static void draw_filled_lasso(wmGesture *gt) draw_filled_lasso_px_cb, &lasso_fill_data); - GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ADDITIVE); IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR); diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c index 2f949142eb7..9d472ed4597 100644 --- a/source/blender/windowmanager/intern/wm_playanim.c +++ b/source/blender/windowmanager/intern/wm_playanim.c @@ -316,7 +316,6 @@ static void playanim_toscreen( /* checkerboard for case alpha */ if (ibuf->planes == 32) { GPU_blend(GPU_BLEND_ALPHA); - GPU_blend(GPU_BLEND_ALPHA); imm_draw_box_checker_2d_ex(offs_x, offs_y, -- cgit v1.2.3