diff options
author | mano-wii <germano.costa@ig.com.br> | 2019-04-18 15:37:07 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2019-04-18 16:09:34 +0300 |
commit | f41ab375f38b0f828701f846fe33ec1d8ebd320e (patch) | |
tree | ed566a0628f037562aea12ad13ed1a6d4a2cba3e /source/blender/draw | |
parent | dc8dd24351462e73c5d0260564aad9cd56fd6c33 (diff) |
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
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/modes/shaders/edit_mesh_overlay_geom.glsl | 10 |
1 files changed, 7 insertions, 3 deletions
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); |