diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-06-03 11:58:05 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-06-03 12:02:56 +0300 |
commit | 0e14eb7b31a8f55bd754c020dd542a6ac007caa3 (patch) | |
tree | 0ea4dae582ec90270bc4a1c3adfac0ba022d0594 /source/blender/draw/intern/draw_manager_exec.c | |
parent | 75015f27ba39399e778fcf324f23b71483630ab3 (diff) |
Cleanup: DRW: Remove support for ModelViewProjectionMatrix
This has been replace by manual model+viewproj transform inside the shader.
Diffstat (limited to 'source/blender/draw/intern/draw_manager_exec.c')
-rw-r--r-- | source/blender/draw/intern/draw_manager_exec.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index 25fdb8080a8..b012049a368 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -66,7 +66,6 @@ typedef struct DRWCommandsState { /* Legacy matrix support. */ int obmat_loc; int obinv_loc; - int mvp_loc; /* Selection ID state. */ GPUVertBuf *select_buf; uint select_id; @@ -656,8 +655,7 @@ static void draw_compute_culling(DRWView *view) BLI_INLINE void draw_legacy_matrix_update(DRWShadingGroup *shgroup, DRWResourceHandle *handle, float obmat_loc, - float obinv_loc, - float mvp_loc) + float obinv_loc) { /* Still supported for compatibility with gpu_shader_* but should be forbidden. */ DRWObjectMatrix *ob_mats = DRW_memblock_elem_from_handle(DST.vmempool->obmats, handle); @@ -667,13 +665,6 @@ BLI_INLINE void draw_legacy_matrix_update(DRWShadingGroup *shgroup, if (obinv_loc != -1) { GPU_shader_uniform_vector(shgroup->shader, obinv_loc, 16, 1, (float *)ob_mats->modelinverse); } - /* Still supported for compatibility with gpu_shader_* but should be forbidden - * and is slow (since it does not cache the result). */ - if (mvp_loc != -1) { - float mvp[4][4]; - mul_m4_m4m4(mvp, DST.view_active->storage.persmat, ob_mats->model); - GPU_shader_uniform_vector(shgroup->shader, mvp_loc, 16, 1, (float *)mvp); - } } BLI_INLINE void draw_geometry_bind(DRWShadingGroup *shgroup, GPUBatch *geom) @@ -866,9 +857,6 @@ static void draw_update_uniforms(DRWShadingGroup *shgroup, case DRW_UNIFORM_MODEL_MATRIX_INVERSE: state->obinv_loc = uni->location; break; - case DRW_UNIFORM_MODELVIEWPROJECTION_MATRIX: - state->mvp_loc = uni->location; - break; } } } @@ -1004,10 +992,8 @@ static void draw_call_single_do(DRWShadingGroup *shgroup, draw_call_resource_bind(state, &handle); /* TODO This is Legacy. Need to be removed. */ - if (state->obmats_loc == -1 && - (state->obmat_loc != -1 || state->obinv_loc != -1 || state->mvp_loc != -1)) { - draw_legacy_matrix_update( - shgroup, &handle, state->obmat_loc, state->obinv_loc, state->mvp_loc); + if (state->obmats_loc == -1 && (state->obmat_loc != -1 || state->obinv_loc != -1)) { + draw_legacy_matrix_update(shgroup, &handle, state->obmat_loc, state->obinv_loc); } if (G.f & G_FLAG_PICKSEL) { @@ -1113,7 +1099,6 @@ static void draw_shgroup(DRWShadingGroup *shgroup, DRWState pass_state) .resourceid_loc = -1, .obmat_loc = -1, .obinv_loc = -1, - .mvp_loc = -1, .drw_state_enabled = 0, .drw_state_disabled = 0, }; |