Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 0442a0f35c9..c4da39bca2f 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -588,9 +588,7 @@ static void drawviewborder(Scene *scene, Depsgraph *depsgraph, ARegion *region,
float alpha = 1.0f;
if (ca->passepartalpha != 1.0f) {
- GPU_blend_set_func_separate(
- GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA);
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
alpha = ca->passepartalpha;
}
@@ -609,7 +607,7 @@ static void drawviewborder(Scene *scene, Depsgraph *depsgraph, ARegion *region,
immRectf(shdr_pos, x1i, y1i, x2i, 0.0f);
}
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
immUniformThemeColor3(TH_BACK);
@@ -668,7 +666,7 @@ static void drawviewborder(Scene *scene, Depsgraph *depsgraph, ARegion *region,
/* safety border */
if (ca) {
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
immUniformThemeColorAlpha(TH_VIEW_OVERLAY, 0.75f);
if (ca->dtx & CAM_DTX_CENTER) {
@@ -780,7 +778,7 @@ static void drawviewborder(Scene *scene, Depsgraph *depsgraph, ARegion *region,
imm_draw_box_wire_2d(shdr_pos, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
}
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
immUnbindProgram();
@@ -1027,9 +1025,7 @@ static void draw_view_axis(RegionView3D *rv3d, const rcti *rect)
/* draw axis lines */
GPU_line_width(2.0f);
GPU_line_smooth(true);
- GPU_blend(true);
- GPU_blend_set_func_separate(
- GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA);
+ GPU_blend(GPU_BLEND_ALPHA);
GPUVertFormat *format = immVertexFormat();
uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
@@ -1072,9 +1068,7 @@ static void draw_rotation_guide(const RegionView3D *rv3d)
negate_v3_v3(o, rv3d->ofs);
- GPU_blend(true);
- GPU_blend_set_func_separate(
- GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA);
+ GPU_blend(GPU_BLEND_ALPHA);
GPU_depth_mask(false); /* don't overwrite zbuf */
GPUVertFormat *format = immVertexFormat();
@@ -1164,7 +1158,7 @@ static void draw_rotation_guide(const RegionView3D *rv3d)
immEnd();
immUnbindProgram();
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
GPU_depth_mask(true);
}
#endif /* WITH_INPUT_NDOF */
@@ -1623,12 +1617,8 @@ void view3d_main_region_draw(const bContext *C, ARegion *region)
BKE_image_free_old_gputextures(bmain);
GPU_pass_cache_garbage_collect();
- /* XXX This is in order to draw UI batches with the DRW
- * old context since we now use it for drawing the entire area. */
- gpu_batch_presets_reset();
-
/* No depth test for drawing action zones afterwards. */
- GPU_depth_test(false);
+ GPU_depth_test(GPU_DEPTH_NONE);
v3d->flag |= V3D_INVALID_BACKBUF;
}
@@ -2163,7 +2153,7 @@ static void view3d_opengl_read_Z_pixels(GPUViewport *viewport, rcti *rect, void
{
DefaultTextureList *dtxl = (DefaultTextureList *)GPU_viewport_texture_list_get(viewport);
- GPUFrameBuffer *tmp_fb = GPU_framebuffer_create();
+ GPUFrameBuffer *tmp_fb = GPU_framebuffer_create(__func__);
GPU_framebuffer_texture_attach(tmp_fb, dtxl->depth, 0, 0);
GPU_framebuffer_bind(tmp_fb);
@@ -2329,14 +2319,14 @@ void ED_view3d_draw_depth_gpencil(Depsgraph *depsgraph, Scene *scene, ARegion *r
/* Setup view matrix. */
ED_view3d_draw_setup_view(NULL, NULL, depsgraph, scene, region, v3d, NULL, NULL, NULL);
- GPU_clear(GPU_DEPTH_BIT);
+ GPU_clear_depth(1.0f);
- GPU_depth_test(true);
+ GPU_depth_test(GPU_DEPTH_LESS_EQUAL);
GPUViewport *viewport = WM_draw_region_get_viewport(region);
DRW_draw_depth_loop_gpencil(depsgraph, region, v3d, viewport);
- GPU_depth_test(false);
+ GPU_depth_test(GPU_DEPTH_NONE);
}
/* *********************** customdata **************** */