DRW: Fix issue introduce in removal of DRW_STATE_POINT

Fix issue raised by mano-wii in rB97d22e12b521

Fix T65050 knife tool snapping indicator not visible
This commit is contained in:
Clément Foucault
2019-05-28 17:18:39 +02:00
parent 9e85d4052f
commit c4e4b6872a
3 changed files with 17 additions and 3 deletions

View File

@@ -350,6 +350,8 @@ typedef enum {
DRW_STATE_CLIP_PLANES = (1 << 22),
DRW_STATE_WIRE_SMOOTH = (1 << 23),
DRW_STATE_FIRST_VERTEX_CONVENTION = (1 << 24),
/** DO NOT USE. Assumed always enabled. Only used internally. */
DRW_STATE_PROGRAM_POINT_SIZE = (1 << 25),
} DRWState;
#define DRW_STATE_DEFAULT \

View File

@@ -1541,7 +1541,7 @@ void DRW_view_persmat_get(const DRWView *view, float mat[4][4], bool inverse)
DRWPass *DRW_pass_create(const char *name, DRWState state)
{
DRWPass *pass = BLI_memblock_alloc(DST.vmempool->passes);
pass->state = state;
pass->state = state | DRW_STATE_PROGRAM_POINT_SIZE;
if (((G.debug_value > 20) && (G.debug_value < 30)) || (G.debug & G_DEBUG)) {
BLI_strncpy(pass->name, name, MAX_PASS_NAME);
}
@@ -1564,7 +1564,7 @@ bool DRW_pass_is_empty(DRWPass *pass)
void DRW_pass_state_set(DRWPass *pass, DRWState state)
{
pass->state = state;
pass->state = state | DRW_STATE_PROGRAM_POINT_SIZE;
}
void DRW_pass_state_add(DRWPass *pass, DRWState state)

View File

@@ -251,6 +251,19 @@ void drw_state_set(DRWState state)
}
}
/* Program Points Size */
{
int test;
if ((test = CHANGED_TO(DRW_STATE_PROGRAM_POINT_SIZE))) {
if (test == 1) {
GPU_program_point_size(true);
}
else {
GPU_program_point_size(false);
}
}
}
/* Stencil */
{
DRWState test;
@@ -355,7 +368,6 @@ void DRW_state_reset(void)
DRW_state_reset_ex(DRW_STATE_DEFAULT);
GPU_point_size(5);
GPU_program_point_size(true);
/* Reset blending function */
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);