[Bf-blender-cvs] [171e231a8a8] greasepencil-object: Fix: Crash in non-3d editors when using Annotations

Joshua Leung noreply at git.blender.org
Wed Jul 25 06:40:01 CEST 2018


Commit: 171e231a8a8790408a78ec98014f00b52e738d9a
Author: Joshua Leung
Date:   Wed Jul 25 16:39:56 2018 +1200
Branches: greasepencil-object
https://developer.blender.org/rB171e231a8a8790408a78ec98014f00b52e738d9a

Fix: Crash in non-3d editors when using Annotations

The wrong shader was being used after removing the per-point
varying colors.

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

M	source/blender/editors/gpencil/annotate_draw.c

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

diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c
index d761b4f5f8c..dad5af7379c 100644
--- a/source/blender/editors/gpencil/annotate_draw.c
+++ b/source/blender/editors/gpencil/annotate_draw.c
@@ -347,9 +347,8 @@ static void gp_draw_stroke_2d(const bGPDspoint *points, int totpoints, short thi
 
 		GPUVertFormat *format = immVertexFormat();
 		uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
-		uint color = GPU_vertformat_attr_add(format, "color", GPU_COMP_U8, 4, GPU_FETCH_INT_TO_FLOAT_UNIT);
 
-		immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
+		immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
 		immUniformColor3fvAlpha(ink, ink[3]);
 		immBegin(GPU_PRIM_TRI_STRIP, totpoints * 2 + 4);



More information about the Bf-blender-cvs mailing list