diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-05-20 20:35:20 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-22 14:29:04 +0300 |
commit | 676e1e7b26e34dd2f2f324cd764189df641f5737 (patch) | |
tree | cc170738e58fa0785bb630c74a408918d97f928b /source/blender/draw/engines/external/external_engine.c | |
parent | e1153c6a1ae97f549fdeedb1612ff1f148c5950a (diff) |
DRW: Remove some usage of DRW_viewport_matrix_get
Diffstat (limited to 'source/blender/draw/engines/external/external_engine.c')
-rw-r--r-- | source/blender/draw/engines/external/external_engine.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/source/blender/draw/engines/external/external_engine.c b/source/blender/draw/engines/external/external_engine.c index 1223e31b891..7e03ce525d7 100644 --- a/source/blender/draw/engines/external/external_engine.c +++ b/source/blender/draw/engines/external/external_engine.c @@ -90,8 +90,7 @@ typedef struct EXTERNAL_PrivateData { bool update_depth; bool view_updated; - float last_mat[4][4]; - float curr_mat[4][4]; + float last_persmat[4][4]; } EXTERNAL_PrivateData; /* Transient data */ /* Functions */ @@ -126,13 +125,11 @@ static void external_engine_init(void *vedata) } { - float view[4][4]; - float win[4][4]; - DRW_viewport_matrix_get(view, DRW_MAT_VIEW); - DRW_viewport_matrix_get(win, DRW_MAT_WIN); - mul_m4_m4m4(stl->g_data->curr_mat, view, win); - if (!equals_m4m4(stl->g_data->curr_mat, stl->g_data->last_mat)) { + float persmat[4][4]; + DRW_view_persmat_get(NULL, persmat, false); + if (!equals_m4m4(persmat, stl->g_data->last_persmat)) { stl->g_data->update_depth = true; + copy_m4_m4(stl->g_data->last_persmat, persmat); } } } @@ -270,8 +267,6 @@ static void external_draw_scene(void *vedata) // copy tmp buffer to default GPU_framebuffer_blit(fbl->depth_buffer_fb, 0, dfbl->depth_only_fb, 0, GPU_DEPTH_BIT); } - - copy_m4_m4(stl->g_data->last_mat, stl->g_data->curr_mat); } static void external_view_update(void *vedata) |