Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_shader_builtin.c
| Show First 20 Lines • Show All 361 Lines • ▼ Show 20 Lines | GPUShader *GPU_shader_get_builtin_shader_with_config(eGPUBuiltinShader shader, | ||||
| if (*sh_p == NULL) { | if (*sh_p == NULL) { | ||||
| const GPUShaderStages *stages = &builtin_shader_stages[shader]; | const GPUShaderStages *stages = &builtin_shader_stages[shader]; | ||||
| /* common case */ | /* common case */ | ||||
| if (sh_cfg == GPU_SHADER_CFG_DEFAULT) { | if (sh_cfg == GPU_SHADER_CFG_DEFAULT) { | ||||
| if (stages->create_info != NULL) { | if (stages->create_info != NULL) { | ||||
| *sh_p = GPU_shader_create_from_info_name(stages->create_info); | *sh_p = GPU_shader_create_from_info_name(stages->create_info); | ||||
| if (ELEM(shader, | |||||
| GPU_SHADER_3D_POLYLINE_CLIPPED_UNIFORM_COLOR, | |||||
| GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR, | |||||
| GPU_SHADER_3D_POLYLINE_FLAT_COLOR, | |||||
| GPU_SHADER_3D_POLYLINE_SMOOTH_COLOR)) { | |||||
| /* Set a default value for `lineSmooth`. | |||||
| * Ideally this value should be set by the caller. */ | |||||
| GPU_shader_bind(*sh_p); | |||||
| GPU_shader_uniform_1i(*sh_p, "lineSmooth", 1); | |||||
| } | |||||
| } | } | ||||
| else { | else { | ||||
| *sh_p = GPU_shader_create_from_arrays_named( | *sh_p = GPU_shader_create_from_arrays_named( | ||||
| stages->name, | stages->name, | ||||
| { | { | ||||
| .vert = (const char *[]){stages->vert, NULL}, | .vert = (const char *[]){stages->vert, NULL}, | ||||
| .geom = (const char *[]){stages->geom, NULL}, | .geom = (const char *[]){stages->geom, NULL}, | ||||
| .frag = | .frag = | ||||
| ▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines | |||||