<div dir="ltr"><div dir="ltr">Uploaded new version.<div>Seems that waiting for any response on <a href="https://github.com/KhronosGroup/OpenGL-API/issues/41">https://github.com/KhronosGroup/OpenGL-API/issues/41</a> may take much more time....</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 18, 2018 at 4:57 PM, Sergii Romantsov <span dir="ltr"><<a href="mailto:sergii.romantsov@gmail.com" target="_blank">sergii.romantsov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Specification doesn't define behaviour for rotation of 0-vector.<br>
Windows and Nvidia drivers have a workaround for that.<br>
For compatibility proposed that for 0-vector a rotation will be<br>
done around x-axis.<br>
<br>
-v2: logic moved to _math_matrix_rotate<br>
<br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=100960" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/<wbr>show_bug.cgi?id=100960</a><br>
Signed-off-by: Sergii Romantsov <<a href="mailto:sergii.romantsov@globallogic.com">sergii.romantsov@globallogic.<wbr>com</a>><br>
---<br>
 src/mesa/math/m_matrix.c | 19 +++++++++++++++++++<br>
 1 file changed, 19 insertions(+)<br>
<br>
diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c<br>
index 57a4953..2b3adb3 100644<br>
--- a/src/mesa/math/m_matrix.c<br>
+++ b/src/mesa/math/m_matrix.c<br>
@@ -824,6 +824,25 @@ _math_matrix_rotate( GLmatrix *mat,<br>
                M(1,0) = s;<br>
             }<br>
          }<br>
+         else {<br>
+            /* <a href="https://bugs.freedesktop.org/show_bug.cgi?id=100960" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/<wbr>show_bug.cgi?id=100960</a><br>
+             * <a href="https://github.com/KhronosGroup/OpenGL-API/issues/41" rel="noreferrer" target="_blank">https://github.com/<wbr>KhronosGroup/OpenGL-API/<wbr>issues/41</a><br>
+             * So that is kind of workaround for empty-vectors to have<br>
+             * compatibility with Windows and Nvidia drivers.<br>
+             */<br>
+            optimized = GL_TRUE;<br>
+            /* rotate only around x-axis */<br>
+            M(1,1) = c;<br>
+            M(2,2) = c;<br>
+            if (x < 0.0F) {<br>
+               M(1,2) = s;<br>
+               M(2,1) = -s;<br>
+            }<br>
+            else {<br>
+               M(1,2) = -s;<br>
+               M(2,1) = s;<br>
+            }<br>
+         }<br>
       }<br>
       else if (z == 0.0F) {<br>
          optimized = GL_TRUE;<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.7.4<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr">Sergii Romantsov<br></div><div dir="ltr"><div style="margin:0px;padding:0px;color:rgb(23,43,77);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif;font-size:14px">GlobalLogic Inc.<br><a href="http://www.globallogic.com/" rel="nofollow" style="color:rgb(0,82,204)" target="_blank">www.globallogic.com</a><br></div></div></div></div></div></div>
</div>