diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-03-02 20:05:42 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-03-02 20:35:59 +0300 |
commit | 5e730974fe39ab67e0e56cb683b13bb8148e0415 (patch) | |
tree | 9343743f9abd89f277ff241a55d8644b07b88300 /source/blender/draw/intern/draw_manager_exec.c | |
parent | d63829117c21c0d926cf0a9df645c3ed5cd8057a (diff) |
DRW: Add DRWMatrixState to manage all matrices together.
Diffstat (limited to 'source/blender/draw/intern/draw_manager_exec.c')
-rw-r--r-- | source/blender/draw/intern/draw_manager_exec.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index 055baff6a96..6cf8dfc7904 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -388,10 +388,10 @@ static void draw_clipping_setup_from_view(void) if (DST.clipping.updated) return; - float (*viewprojinv)[4] = DST.view_data.mat[DRW_MAT_PERSINV]; - float (*viewinv)[4] = DST.view_data.mat[DRW_MAT_VIEWINV]; - float (*projmat)[4] = DST.view_data.mat[DRW_MAT_WIN]; - float (*projinv)[4] = DST.view_data.mat[DRW_MAT_WININV]; + float (*viewprojinv)[4] = DST.view_data.matstate.mat[DRW_MAT_PERSINV]; + float (*viewinv)[4] = DST.view_data.matstate.mat[DRW_MAT_VIEWINV]; + float (*projmat)[4] = DST.view_data.matstate.mat[DRW_MAT_WIN]; + float (*projinv)[4] = DST.view_data.matstate.mat[DRW_MAT_WININV]; BoundSphere *bsphere = &DST.clipping.frustum_bsphere; /* Extract Clipping Planes */ @@ -555,13 +555,13 @@ static void draw_matrices_model_prepare(DRWCallState *st) if (st->matflag & (DRW_CALL_MODELVIEW | DRW_CALL_MODELVIEWINVERSE | DRW_CALL_NORMALVIEW | DRW_CALL_EYEVEC)) { - mul_m4_m4m4(st->modelview, DST.view_data.mat[DRW_MAT_VIEW], st->model); + mul_m4_m4m4(st->modelview, DST.view_data.matstate.mat[DRW_MAT_VIEW], st->model); } if (st->matflag & DRW_CALL_MODELVIEWINVERSE) { invert_m4_m4(st->modelviewinverse, st->modelview); } if (st->matflag & DRW_CALL_MODELVIEWPROJECTION) { - mul_m4_m4m4(st->modelviewprojection, DST.view_data.mat[DRW_MAT_PERS], st->model); + mul_m4_m4m4(st->modelviewprojection, DST.view_data.matstate.mat[DRW_MAT_PERS], st->model); } if (st->matflag & DRW_CALL_NORMALVIEW) { copy_m3_m4(st->normalview, st->modelview); @@ -610,9 +610,9 @@ static void draw_geometry_prepare(DRWShadingGroup *shgroup, DRWCallState *state) unit_m4(unitmat); GPU_shader_uniform_vector(shgroup->shader, shgroup->model, 16, 1, (float *)unitmat); GPU_shader_uniform_vector(shgroup->shader, shgroup->modelinverse, 16, 1, (float *)unitmat); - GPU_shader_uniform_vector(shgroup->shader, shgroup->modelview, 16, 1, (float *)DST.view_data.mat[DRW_MAT_VIEW]); - GPU_shader_uniform_vector(shgroup->shader, shgroup->modelviewinverse, 16, 1, (float *)DST.view_data.mat[DRW_MAT_VIEWINV]); - GPU_shader_uniform_vector(shgroup->shader, shgroup->modelviewprojection, 16, 1, (float *)DST.view_data.mat[DRW_MAT_PERS]); + GPU_shader_uniform_vector(shgroup->shader, shgroup->modelview, 16, 1, (float *)DST.view_data.matstate.mat[DRW_MAT_VIEW]); + GPU_shader_uniform_vector(shgroup->shader, shgroup->modelviewinverse, 16, 1, (float *)DST.view_data.matstate.mat[DRW_MAT_VIEWINV]); + GPU_shader_uniform_vector(shgroup->shader, shgroup->modelviewprojection, 16, 1, (float *)DST.view_data.matstate.mat[DRW_MAT_PERS]); GPU_shader_uniform_vector(shgroup->shader, shgroup->orcotexfac, 3, 2, (float *)shgroup->instance_orcofac); } } |