[Bf-blender-cvs] [22814ca5559] blender2.8: Fix related to T55961: Glitch in selecting loose edges on some AMD drives.

mano-wii noreply at git.blender.org
Mon Oct 15 14:55:02 CEST 2018


Commit: 22814ca55596fee662b7e469ebb244761cfc647f
Author: mano-wii
Date:   Mon Oct 15 09:54:24 2018 -0300
Branches: blender2.8
https://developer.blender.org/rB22814ca55596fee662b7e469ebb244761cfc647f

Fix related to T55961: Glitch in selecting loose edges on some AMD drives.

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

M	source/blender/draw/modes/shaders/edit_mesh_overlay_geom_edge.glsl

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

diff --git a/source/blender/draw/modes/shaders/edit_mesh_overlay_geom_edge.glsl b/source/blender/draw/modes/shaders/edit_mesh_overlay_geom_edge.glsl
index d8b54168f09..1a44e4a9e4f 100644
--- a/source/blender/draw/modes/shaders/edit_mesh_overlay_geom_edge.glsl
+++ b/source/blender/draw/modes/shaders/edit_mesh_overlay_geom_edge.glsl
@@ -30,6 +30,15 @@ out float facing;
 /* See fragment shader */
 flat out vec2 ssPos[3];
 
+/* Some bugged AMD drivers need these global variables. See T55961 */
+#ifdef VERTEX_SELECTION
+vec3 vertex_color[3];
+#endif
+
+#ifdef VERTEX_FACING
+float v_facing[3];
+#endif
+
 /* project to screen space */
 vec2 proj(vec4 pos)
 {
@@ -39,11 +48,11 @@ vec2 proj(vec4 pos)
 void doVertex(int v, vec4 pos)
 {
 #ifdef VERTEX_SELECTION
-	vertexColor = EDIT_MESH_vertex_color(vData[v].x).rgb;
+	vertexColor = vertex_color[v];
 #endif
 
 #ifdef VERTEX_FACING
-	facing = vFacing[v];
+	facing = v_facing[v];
 #endif
 
 	gl_Position = pos;
@@ -80,6 +89,17 @@ void main()
 		dirs2 *= pPos[1].w;
 	}
 
+#ifdef VERTEX_SELECTION
+	vertex_color[0] = EDIT_MESH_vertex_color(vData[0].x).rgb;
+	vertex_color[1] = EDIT_MESH_vertex_color(vData[1].x).rgb;
+#endif
+
+#ifdef VERTEX_FACING
+	/* Weird but some buggy AMD drivers need this. */
+	v_facing[0] = vFacing[0];
+	v_facing[1] = vFacing[1];
+#endif
+
 	/* Edge / Vert data */
 	ssPos[0] = ssPos[2] = pos[0];
 	ssPos[1] = pos[1];



More information about the Bf-blender-cvs mailing list