DRW: Add new per drawcall option to bypass culling.

This commit is contained in:
2018-05-28 14:20:58 +02:00
parent 201952aed2
commit ec6da3d72e
4 changed files with 13 additions and 4 deletions

View File

@@ -747,7 +747,8 @@ static void draw_matrices_model_prepare(DRWCallState *st)
}
/* No need to go further the call will not be used. */
if (st->flag & DRW_CALL_CULLED)
if ((st->flag & DRW_CALL_CULLED) != 0 &&
(st->flag & DRW_CALL_BYPASS_CULLING) == 0)
return;
/* Order matters */
@@ -1119,8 +1120,11 @@ static void draw_shgroup(DRWShadingGroup *shgroup, DRWState pass_state)
draw_visibility_eval(call->state);
draw_matrices_model_prepare(call->state);
if ((call->state->flag & DRW_CALL_CULLED) != 0)
if ((call->state->flag & DRW_CALL_CULLED) != 0 &&
(call->state->flag & DRW_CALL_BYPASS_CULLING) == 0)
{
continue;
}
/* XXX small exception/optimisation for outline rendering. */
if (shgroup->callid != -1) {