Cleanup: DRW: Move WorldClipPlanes to builtin uniform

This commit is contained in:
2019-05-26 20:36:24 +02:00
parent ba75e93c88
commit 577d3498b4
16 changed files with 72 additions and 79 deletions

View File

@@ -94,7 +94,6 @@ 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;
if (!stl->g_data) {
/* Alloc transient pointers */
@@ -106,7 +105,7 @@ static void basic_cache_init(void *vedata)
DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL);
stl->g_data->depth_shgrp = DRW_shgroup_create(sh_data->depth, psl->depth_pass);
if (draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) {
DRW_shgroup_world_clip_planes_from_rv3d(stl->g_data->depth_shgrp, rv3d);
DRW_shgroup_state_enable(stl->g_data->depth_shgrp, DRW_STATE_CLIP_PLANES);
}
psl->depth_pass_cull = DRW_pass_create("Depth Pass Cull",
@@ -114,7 +113,7 @@ static void basic_cache_init(void *vedata)
DRW_STATE_CULL_BACK);
stl->g_data->depth_shgrp_cull = DRW_shgroup_create(sh_data->depth, psl->depth_pass_cull);
if (draw_ctx->sh_cfg == GPU_SHADER_CFG_CLIPPED) {
DRW_shgroup_world_clip_planes_from_rv3d(stl->g_data->depth_shgrp_cull, rv3d);
DRW_shgroup_state_enable(stl->g_data->depth_shgrp_cull, DRW_STATE_CLIP_PLANES);
}
}
}