[Bf-blender-cvs] [f41ab375f38] master: Fix T62792: AMD glitch when clipping region in edit mode.

mano-wii noreply at git.blender.org
Thu Apr 18 15:09:45 CEST 2019


Commit: f41ab375f38b0f828701f846fe33ec1d8ebd320e
Author: mano-wii
Date:   Thu Apr 18 09:37:07 2019 -0300
Branches: master
https://developer.blender.org/rBf41ab375f38b0f828701f846fe33ec1d8ebd320e

Fix T62792: AMD glitch when clipping region in edit mode.

The `AMD Radeon HD 7600M` compiler is usually buggy for Geometry Shaders.
In this case, indexing was causing problems in `gl_in[i].gl_ClipDistance[0]`.

Reviewers: fclem

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

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

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

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

diff --git a/source/blender/draw/modes/shaders/edit_mesh_overlay_geom.glsl b/source/blender/draw/modes/shaders/edit_mesh_overlay_geom.glsl
index f25724d2e91..62928ef5d86 100644
--- a/source/blender/draw/modes/shaders/edit_mesh_overlay_geom.glsl
+++ b/source/blender/draw/modes/shaders/edit_mesh_overlay_geom.glsl
@@ -20,9 +20,6 @@ void do_vertex(const int i, vec4 pos, float coord, vec2 offset)
   gl_Position = pos;
   /* Multiply offset by 2 because gl_Position range is [-1..1]. */
   gl_Position.xy += offset * 2.0 * pos.w;
-#ifdef USE_WORLD_CLIP_PLANES
-  world_clip_planes_set_clip_distance(gl_in[i].gl_ClipDistance);
-#endif
   EmitVertex();
 }
 
@@ -70,8 +67,15 @@ void main()
   bool horizontal = line.x > line.y;
   edge_ofs = (horizontal) ? edge_ofs.zyz : edge_ofs.xzz;
 
+#ifdef USE_WORLD_CLIP_PLANES
+  world_clip_planes_set_clip_distance(gl_in[0].gl_ClipDistance);
+#endif
   do_vertex(0, pos0, half_size, edge_ofs.xy);
   do_vertex(0, pos0, -half_size, -edge_ofs.xy);
+
+#ifdef USE_WORLD_CLIP_PLANES
+  world_clip_planes_set_clip_distance(gl_in[1].gl_ClipDistance);
+#endif
   do_vertex(1, pos1, half_size, edge_ofs.xy);
   do_vertex(1, pos1, -half_size, -edge_ofs.xy);



More information about the Bf-blender-cvs mailing list