Fix T97872: Annotation lines lost AA

Since rB2a7a01b339ad, `lineSmooth` has lost its default value of true.

So set the value when creating the shader.

Differential Revision: https://developer.blender.org/D14876
This commit is contained in:
Germano Cavalcante 2022-05-06 10:59:47 -03:00
parent f23f831e91
commit a0a99fb252
Notes: blender-bot 2023-02-13 15:32:14 +01:00
Referenced by commit 470cbad51a, Fix T97872: Annotation lines lost AA
Referenced by issue #97872, Regression: Annotation lines lost AA
1 changed files with 10 additions and 0 deletions

View File

@ -367,6 +367,16 @@ GPUShader *GPU_shader_get_builtin_shader_with_config(eGPUBuiltinShader shader,
if (sh_cfg == GPU_SHADER_CFG_DEFAULT) {
if (stages->create_info != NULL) {
*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 {
*sh_p = GPU_shader_create_from_arrays_named(