diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-03-22 23:26:27 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-03-22 23:29:23 +0300 |
commit | 26c140fbc85c6cee4ce7548873c38e6ce2f24c8b (patch) | |
tree | 2162a3ee3c74d1394b14efc79ceb64c458d95139 /source/blender/draw/modes/edit_mesh_mode.c | |
parent | 4646ecf74917d5cee0a4f0d330a1306acd086a61 (diff) |
Draw Module: Move the Global Ubo block definition to it's own file.
Diffstat (limited to 'source/blender/draw/modes/edit_mesh_mode.c')
-rw-r--r-- | source/blender/draw/modes/edit_mesh_mode.c | 70 |
1 files changed, 41 insertions, 29 deletions
diff --git a/source/blender/draw/modes/edit_mesh_mode.c b/source/blender/draw/modes/edit_mesh_mode.c index e1016c87c1d..45d32d70bbc 100644 --- a/source/blender/draw/modes/edit_mesh_mode.c +++ b/source/blender/draw/modes/edit_mesh_mode.c @@ -49,6 +49,7 @@ extern char datatoc_edit_overlay_facefill_vert_glsl[]; extern char datatoc_edit_overlay_facefill_frag_glsl[]; extern char datatoc_edit_normals_vert_glsl[]; extern char datatoc_edit_normals_geom_glsl[]; +extern char datatoc_common_globals_lib_glsl[]; extern char datatoc_gpu_shader_uniform_color_frag_glsl[]; @@ -138,58 +139,69 @@ static void EDIT_MESH_engine_init(void) tex, 2); if (!e_data.overlay_tri_sh) { - e_data.overlay_tri_sh = DRW_shader_create(datatoc_edit_overlay_vert_glsl, - datatoc_edit_overlay_geom_tri_glsl, - datatoc_edit_overlay_frag_glsl, "#define EDGE_FIX\n"); + e_data.overlay_tri_sh = DRW_shader_create_with_lib(datatoc_edit_overlay_vert_glsl, + datatoc_edit_overlay_geom_tri_glsl, + datatoc_edit_overlay_frag_glsl, + datatoc_common_globals_lib_glsl, "#define EDGE_FIX\n"); } if (!e_data.overlay_tri_fast_sh) { - e_data.overlay_tri_fast_sh = DRW_shader_create(datatoc_edit_overlay_vert_glsl, - datatoc_edit_overlay_geom_tri_glsl, - datatoc_edit_overlay_frag_glsl, NULL); + e_data.overlay_tri_fast_sh = DRW_shader_create_with_lib(datatoc_edit_overlay_vert_glsl, + datatoc_edit_overlay_geom_tri_glsl, + datatoc_edit_overlay_frag_glsl, + datatoc_common_globals_lib_glsl, NULL); } if (!e_data.overlay_tri_vcol_sh) { - e_data.overlay_tri_vcol_sh = DRW_shader_create(datatoc_edit_overlay_vert_glsl, - datatoc_edit_overlay_geom_tri_glsl, - datatoc_edit_overlay_frag_glsl, "#define EDGE_FIX\n" - "#define VERTEX_SELECTION\n"); + e_data.overlay_tri_vcol_sh = DRW_shader_create_with_lib(datatoc_edit_overlay_vert_glsl, + datatoc_edit_overlay_geom_tri_glsl, + datatoc_edit_overlay_frag_glsl, + datatoc_common_globals_lib_glsl, "#define EDGE_FIX\n" + "#define VERTEX_SELECTION\n"); } if (!e_data.overlay_tri_vcol_fast_sh) { - e_data.overlay_tri_vcol_fast_sh = DRW_shader_create(datatoc_edit_overlay_vert_glsl, - datatoc_edit_overlay_geom_tri_glsl, - datatoc_edit_overlay_frag_glsl, "#define VERTEX_SELECTION\n"); + e_data.overlay_tri_vcol_fast_sh = DRW_shader_create_with_lib(datatoc_edit_overlay_vert_glsl, + datatoc_edit_overlay_geom_tri_glsl, + datatoc_edit_overlay_frag_glsl, + datatoc_common_globals_lib_glsl, "#define VERTEX_SELECTION\n"); } if (!e_data.overlay_edge_sh) { - e_data.overlay_edge_sh = DRW_shader_create(datatoc_edit_overlay_vert_glsl, - datatoc_edit_overlay_geom_edge_glsl, - datatoc_edit_overlay_frag_glsl, NULL); + e_data.overlay_edge_sh = DRW_shader_create_with_lib(datatoc_edit_overlay_vert_glsl, + datatoc_edit_overlay_geom_edge_glsl, + datatoc_edit_overlay_frag_glsl, + datatoc_common_globals_lib_glsl, NULL); } if (!e_data.overlay_edge_vcol_sh) { - e_data.overlay_edge_vcol_sh = DRW_shader_create(datatoc_edit_overlay_vert_glsl, - datatoc_edit_overlay_geom_edge_glsl, - datatoc_edit_overlay_frag_glsl, "#define VERTEX_SELECTION\n"); + e_data.overlay_edge_vcol_sh = DRW_shader_create_with_lib(datatoc_edit_overlay_vert_glsl, + datatoc_edit_overlay_geom_edge_glsl, + datatoc_edit_overlay_frag_glsl, + datatoc_common_globals_lib_glsl, "#define VERTEX_SELECTION\n"); } if (!e_data.overlay_vert_sh) { - e_data.overlay_vert_sh = DRW_shader_create(datatoc_edit_overlay_loosevert_vert_glsl, NULL, - datatoc_edit_overlay_frag_glsl, "#define VERTEX_SELECTION\n"); + e_data.overlay_vert_sh = DRW_shader_create_with_lib(datatoc_edit_overlay_loosevert_vert_glsl, NULL, + datatoc_edit_overlay_frag_glsl, + datatoc_common_globals_lib_glsl, "#define VERTEX_SELECTION\n"); } if (!e_data.overlay_facedot_sh) { - e_data.overlay_facedot_sh = DRW_shader_create(datatoc_edit_overlay_facedot_vert_glsl, NULL, - datatoc_edit_overlay_facedot_frag_glsl, NULL); + e_data.overlay_facedot_sh = DRW_shader_create_with_lib(datatoc_edit_overlay_facedot_vert_glsl, NULL, + datatoc_edit_overlay_facedot_frag_glsl, + datatoc_common_globals_lib_glsl, NULL); } if (!e_data.overlay_mix_sh) { e_data.overlay_mix_sh = DRW_shader_create_fullscreen(datatoc_edit_overlay_mix_frag_glsl, NULL); } if (!e_data.overlay_facefill_sh) { - e_data.overlay_facefill_sh = DRW_shader_create(datatoc_edit_overlay_facefill_vert_glsl, NULL, - datatoc_edit_overlay_facefill_frag_glsl, NULL); + e_data.overlay_facefill_sh = DRW_shader_create_with_lib(datatoc_edit_overlay_facefill_vert_glsl, NULL, + datatoc_edit_overlay_facefill_frag_glsl, + datatoc_common_globals_lib_glsl, NULL); } if (!e_data.normals_face_sh) { - e_data.normals_face_sh = DRW_shader_create(datatoc_edit_normals_vert_glsl, datatoc_edit_normals_geom_glsl, - datatoc_gpu_shader_uniform_color_frag_glsl, "#define FACE_NORMALS\n"); + e_data.normals_face_sh = DRW_shader_create(datatoc_edit_normals_vert_glsl, + datatoc_edit_normals_geom_glsl, + datatoc_gpu_shader_uniform_color_frag_glsl, "#define FACE_NORMALS\n"); } if (!e_data.normals_sh) { - e_data.normals_sh = DRW_shader_create(datatoc_edit_normals_vert_glsl, datatoc_edit_normals_geom_glsl, - datatoc_gpu_shader_uniform_color_frag_glsl, NULL); + e_data.normals_sh = DRW_shader_create(datatoc_edit_normals_vert_glsl, + datatoc_edit_normals_geom_glsl, + datatoc_gpu_shader_uniform_color_frag_glsl, NULL); } if (!e_data.depth_sh) { e_data.depth_sh = DRW_shader_create_3D_depth_only(); |