diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-02-10 03:06:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-02-10 03:16:31 +0300 |
commit | 0b6dbbc306b0a7e60abe36968d154241bb90c1df (patch) | |
tree | d22a40e3e73f80bc1150cffe1fde866f1f602865 /source/blender/draw/engines/basic/basic_engine.c | |
parent | 16d7967c2b404cbe6719192e073c7685376f6ab1 (diff) |
Cleanup: move clipping shader lib & define into struct
Also compare clipping with the draw context instead of
accessing the RegionView3D, currently they're matching
but this might not always be the case.
Diffstat (limited to 'source/blender/draw/engines/basic/basic_engine.c')
-rw-r--r-- | source/blender/draw/engines/basic/basic_engine.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/draw/engines/basic/basic_engine.c b/source/blender/draw/engines/basic/basic_engine.c index 72ff8de2002..5123132c3e8 100644 --- a/source/blender/draw/engines/basic/basic_engine.c +++ b/source/blender/draw/engines/basic/basic_engine.c @@ -94,9 +94,8 @@ static void basic_cache_init(void *vedata) const DRWContextState *draw_ctx = DRW_context_state_get(); BASIC_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg]; const RegionView3D *rv3d = draw_ctx->rv3d; - const bool is_clip = (rv3d->rflag & RV3D_CLIPPING) != 0; - if (is_clip) { + if (draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) { DRW_state_clip_planes_set_from_rv3d(draw_ctx->rv3d); } @@ -109,7 +108,7 @@ static void basic_cache_init(void *vedata) psl->depth_pass = DRW_pass_create( "Depth Pass", DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_WIRE); stl->g_data->depth_shgrp = DRW_shgroup_create(sh_data->depth, psl->depth_pass); - if (rv3d->rflag & RV3D_CLIPPING) { + if (draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) { DRW_shgroup_world_clip_planes_from_rv3d(stl->g_data->depth_shgrp, rv3d); } @@ -117,7 +116,7 @@ static void basic_cache_init(void *vedata) "Depth Pass Cull", DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CULL_BACK); stl->g_data->depth_shgrp_cull = DRW_shgroup_create(sh_data->depth, psl->depth_pass_cull); - if (rv3d->rflag & RV3D_CLIPPING) { + if (draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) { DRW_shgroup_world_clip_planes_from_rv3d(stl->g_data->depth_shgrp_cull, rv3d); } } |