Fix T55961: Anomalous edges cage on some AMD buggy drivers.

Reviwed on irc by @fclem.
This commit is contained in:
Germano Cavalcante 2018-10-14 14:07:19 -03:00
parent ac61eb3900
commit 9a38a91f41
Notes: blender-bot 2023-02-14 06:21:59 +01:00
Referenced by issue #55961, Blender 2.8 viewport bug
1 changed files with 26 additions and 6 deletions

View File

@ -48,14 +48,22 @@ vec2 proj(vec4 pos)
return (0.5 * (pos.xy / pos.w) + 0.5) * viewportSize;
}
void doVertex(int v)
{
#ifdef VERTEX_SELECTION
vertexColor = EDIT_MESH_vertex_color(vData[v].x).rgb;
vec3 vertex_color[3];
#endif
#ifdef VERTEX_FACING
facing = vFacing[v];
float v_facing[3];
#endif
void doVertex(int v)
{
#ifdef VERTEX_SELECTION
vertexColor = vertex_color[v];
#endif
#ifdef VERTEX_FACING
facing = v_facing[v];
#endif
gl_Position = pPos[v];
@ -65,11 +73,11 @@ void doVertex(int v)
void doVertexOfs(int v, vec2 fixvec)
{
#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 = pPos[v];
@ -162,6 +170,18 @@ void main()
}
}
#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;
vertex_color[2] = EDIT_MESH_vertex_color(vData[2].x).rgb;
#endif
#ifdef VERTEX_FACING
v_facing[0] = vFacing[0];
v_facing[1] = vFacing[1];
v_facing[2] = vFacing[2];
#endif
/* Remember that we are assuming the last vertex
* of a triangle is the provoking vertex (decide what flat attribs are). */