Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/overlay/overlay_shader.c
| Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | |||||
| extern char datatoc_paint_texture_vert_glsl[]; | extern char datatoc_paint_texture_vert_glsl[]; | ||||
| extern char datatoc_paint_vertcol_frag_glsl[]; | extern char datatoc_paint_vertcol_frag_glsl[]; | ||||
| extern char datatoc_paint_vertcol_vert_glsl[]; | extern char datatoc_paint_vertcol_vert_glsl[]; | ||||
| extern char datatoc_paint_weight_frag_glsl[]; | extern char datatoc_paint_weight_frag_glsl[]; | ||||
| extern char datatoc_paint_weight_vert_glsl[]; | extern char datatoc_paint_weight_vert_glsl[]; | ||||
| extern char datatoc_paint_wire_vert_glsl[]; | extern char datatoc_paint_wire_vert_glsl[]; | ||||
| extern char datatoc_particle_vert_glsl[]; | extern char datatoc_particle_vert_glsl[]; | ||||
| extern char datatoc_particle_frag_glsl[]; | extern char datatoc_particle_frag_glsl[]; | ||||
| extern char datatoc_retopology_depth_merge_frag_glsl[]; | |||||
| extern char datatoc_retopology_vert_glsl[]; | |||||
| extern char datatoc_sculpt_mask_vert_glsl[]; | extern char datatoc_sculpt_mask_vert_glsl[]; | ||||
| extern char datatoc_volume_velocity_vert_glsl[]; | extern char datatoc_volume_velocity_vert_glsl[]; | ||||
| extern char datatoc_wireframe_vert_glsl[]; | extern char datatoc_wireframe_vert_glsl[]; | ||||
| extern char datatoc_wireframe_frag_glsl[]; | extern char datatoc_wireframe_frag_glsl[]; | ||||
| extern char datatoc_gpu_shader_depth_only_frag_glsl[]; | extern char datatoc_gpu_shader_depth_only_frag_glsl[]; | ||||
| extern char datatoc_gpu_shader_point_varying_color_frag_glsl[]; | extern char datatoc_gpu_shader_point_varying_color_frag_glsl[]; | ||||
| extern char datatoc_gpu_shader_3D_smooth_color_frag_glsl[]; | extern char datatoc_gpu_shader_3D_smooth_color_frag_glsl[]; | ||||
| ▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | typedef struct OVERLAY_Shaders { | ||||
| GPUShader *particle_dot; | GPUShader *particle_dot; | ||||
| GPUShader *particle_shape; | GPUShader *particle_shape; | ||||
| GPUShader *sculpt_mask; | GPUShader *sculpt_mask; | ||||
| GPUShader *uniform_color; | GPUShader *uniform_color; | ||||
| GPUShader *volume_velocity_needle_sh; | GPUShader *volume_velocity_needle_sh; | ||||
| GPUShader *volume_velocity_sh; | GPUShader *volume_velocity_sh; | ||||
| GPUShader *wireframe_select; | GPUShader *wireframe_select; | ||||
| GPUShader *wireframe; | GPUShader *wireframe; | ||||
| GPUShader *retopology_depth_merge; | |||||
| GPUShader *retopology_face; | |||||
jbakker: Unused so remove it | |||||
| } OVERLAY_Shaders; | } OVERLAY_Shaders; | ||||
| static struct { | static struct { | ||||
| OVERLAY_Shaders sh_data[GPU_SHADER_CFG_LEN]; | OVERLAY_Shaders sh_data[GPU_SHADER_CFG_LEN]; | ||||
| } e_data = {{{NULL}}}; | } e_data = {{{NULL}}}; | ||||
| GPUShader *OVERLAY_shader_antialiasing(void) | GPUShader *OVERLAY_shader_antialiasing(void) | ||||
| { | { | ||||
| Show All 25 Lines | sh_data->depth_only = GPU_shader_create_from_arrays({ | ||||
| NULL}, | NULL}, | ||||
| .frag = (const char *[]){datatoc_gpu_shader_depth_only_frag_glsl, NULL}, | .frag = (const char *[]){datatoc_gpu_shader_depth_only_frag_glsl, NULL}, | ||||
| .defs = (const char *[]){sh_cfg->def, NULL}, | .defs = (const char *[]){sh_cfg->def, NULL}, | ||||
| }); | }); | ||||
| } | } | ||||
| return sh_data->depth_only; | return sh_data->depth_only; | ||||
| } | } | ||||
| GPUShader *OVERLAY_shader_retopology_depth_merge(void) | |||||
| { | |||||
| OVERLAY_Shaders *sh_data = &e_data.sh_data[0]; | |||||
Done Inline Actionsremove empty line jbakker: remove empty line | |||||
| if (!sh_data->retopology_depth_merge) { | |||||
| sh_data->retopology_depth_merge = GPU_shader_create_from_arrays({ | |||||
| .vert = (const char *[]){datatoc_common_fullscreen_vert_glsl, NULL}, | |||||
| .frag = (const char *[]){datatoc_retopology_depth_merge_frag_glsl, NULL}, | |||||
| }); | |||||
| } | |||||
| return sh_data->retopology_depth_merge; | |||||
| } | |||||
| GPUShader *OVERLAY_shader_retopology_face(void) | |||||
| { | |||||
| const DRWContextState *draw_ctx = DRW_context_state_get(); | |||||
| const GPUShaderConfigData *sh_cfg = &GPU_shader_cfg_data[draw_ctx->sh_cfg]; | |||||
| OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg]; | |||||
| if (!sh_data->retopology_face) { | |||||
| sh_data->retopology_face = GPU_shader_create_from_arrays({ | |||||
| .vert = (const char *[]){sh_cfg->lib, | |||||
| datatoc_common_view_lib_glsl, | |||||
| datatoc_retopology_vert_glsl, | |||||
| NULL}, | |||||
| .frag = (const char *[]){datatoc_gpu_shader_uniform_color_frag_glsl, NULL}, | |||||
| .defs = (const char *[]){sh_cfg->def, NULL}, | |||||
| }); | |||||
| } | |||||
| return sh_data->retopology_face; | |||||
| } | |||||
| GPUShader *OVERLAY_shader_edit_mesh_vert(void) | GPUShader *OVERLAY_shader_edit_mesh_vert(void) | ||||
| { | { | ||||
| const DRWContextState *draw_ctx = DRW_context_state_get(); | const DRWContextState *draw_ctx = DRW_context_state_get(); | ||||
| const GPUShaderConfigData *sh_cfg = &GPU_shader_cfg_data[draw_ctx->sh_cfg]; | const GPUShaderConfigData *sh_cfg = &GPU_shader_cfg_data[draw_ctx->sh_cfg]; | ||||
| OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg]; | OVERLAY_Shaders *sh_data = &e_data.sh_data[draw_ctx->sh_cfg]; | ||||
| if (!sh_data->edit_mesh_vert) { | if (!sh_data->edit_mesh_vert) { | ||||
| sh_data->edit_mesh_vert = GPU_shader_create_from_arrays({ | sh_data->edit_mesh_vert = GPU_shader_create_from_arrays({ | ||||
| .vert = (const char *[]){sh_cfg->lib, | .vert = (const char *[]){sh_cfg->lib, | ||||
| ▲ Show 20 Lines • Show All 1,091 Lines • Show Last 20 Lines | |||||
Unused so remove it