DRW: Add Provoking vertex state.

This commit is contained in:
Clément Foucault 2018-12-06 23:18:18 +01:00
parent 58398acc68
commit 88d36e6456
2 changed files with 14 additions and 0 deletions

View File

@ -296,6 +296,7 @@ typedef enum {
DRW_STATE_WIRE_SMOOTH = (1 << 22),
DRW_STATE_TRANS_FEEDBACK = (1 << 23),
DRW_STATE_BLEND_OIT = (1 << 24),
DRW_STATE_FIRST_VERTEX_CONVENTION = (1 << 25),
DRW_STATE_WRITE_STENCIL = (1 << 27),
DRW_STATE_WRITE_STENCIL_SHADOW_PASS = (1 << 28),

View File

@ -356,6 +356,19 @@ void drw_state_set(DRWState state)
}
}
/* Provoking Vertex */
{
int test;
if ((test = CHANGED_TO(DRW_STATE_FIRST_VERTEX_CONVENTION))) {
if (test == 1) {
glProvokingVertex(GL_FIRST_VERTEX_CONVENTION);
}
else {
glProvokingVertex(GL_LAST_VERTEX_CONVENTION);
}
}
}
#undef CHANGED_TO
#undef CHANGED_ANY
#undef CHANGED_ANY_STORE_VAR