[Bf-blender-cvs] [470cbad51a6] blender-v3.2-release: Fix T97872: Annotation lines lost AA

Germano Cavalcante noreply at git.blender.org
Fri May 13 03:31:55 CEST 2022


Commit: 470cbad51a63c56d8114ccfb3bb408b1d9cb4824
Author: Germano Cavalcante
Date:   Fri May 6 10:59:47 2022 -0300
Branches: blender-v3.2-release
https://developer.blender.org/rB470cbad51a63c56d8114ccfb3bb408b1d9cb4824

Fix T97872: Annotation lines lost AA

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

rBa0a99fb25284 only fixed the problem on master.

But thanks to @hitrpr for spotting the bug in version 3.2 too.

Differential Revision: https://developer.blender.org/D14876

===================================================================

M	source/blender/gpu/intern/gpu_shader_builtin.c

===================================================================

diff --git a/source/blender/gpu/intern/gpu_shader_builtin.c b/source/blender/gpu/intern/gpu_shader_builtin.c
index 13238a03688..1100272b712 100644
--- a/source/blender/gpu/intern/gpu_shader_builtin.c
+++ b/source/blender/gpu/intern/gpu_shader_builtin.c
@@ -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(



More information about the Bf-blender-cvs mailing list