diff options
author | Jason Fielder <jason_apple> | 2022-04-14 12:47:52 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-04-14 12:49:18 +0300 |
commit | b0dc3aff2c73f2a1b65406dcb7fe73c95b9485ed (patch) | |
tree | 29642f7e85e2f5189549c1710854c421463a2e0d /source/blender/draw/engines/overlay | |
parent | d62f443f2d0b464131f77f770f9aa19d81164f0c (diff) |
Metal: GLSL shader compatibility 3rd pass
Undefined behaviour for divergent control-flow fixes, replacement for partial vector references, and resolution of a number of calculation precision issues occuring on macOS.
Authored by Apple: Michael Parkin-White
Ref: T96261
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D14437
Diffstat (limited to 'source/blender/draw/engines/overlay')
-rw-r--r-- | source/blender/draw/engines/overlay/shaders/outline_detect_frag.glsl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/draw/engines/overlay/shaders/outline_detect_frag.glsl b/source/blender/draw/engines/overlay/shaders/outline_detect_frag.glsl index 19d54a57479..ba0a4c0da81 100644 --- a/source/blender/draw/engines/overlay/shaders/outline_detect_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/outline_detect_frag.glsl @@ -358,6 +358,12 @@ void main() line_end = vec2(0.0, 0.5); break; default: + /* Ensure values are assigned to, avoids undefined behaviour for + * divergent control-flow. This can occur if discard is called + * as discard is not treated as a return in Metal 2.2. So + * side-effects can still cause problems. */ + line_start = vec2(0.0); + line_end = vec2(0.0); break; } |