DRW: Fix custom engine not being BGL safe

This was caused by unprotected drawing callbacks.
As of 2.91, we require that all python callbacks used for
drawing needs to be safeguarded by `GPU_bgl_end()` to end the
state tracking override.
This commit is contained in:
Clément Foucault 2020-10-22 01:19:10 +02:00
parent 5a65305f89
commit cc3fdffbbe
1 changed files with 3 additions and 0 deletions

View File

@ -36,6 +36,7 @@
#include "GPU_matrix.h"
#include "GPU_shader.h"
#include "GPU_state.h"
#include "GPU_viewport.h"
#include "external_engine.h" /* own include */
@ -243,6 +244,8 @@ static void external_draw_scene_do(void *vedata)
type = rv3d->render_engine->type;
type->view_draw(rv3d->render_engine, draw_ctx->evil_C, draw_ctx->depsgraph);
GPU_bgl_end();
GPU_matrix_pop();
GPU_matrix_pop_projection();