<div dir="ltr"><div>Hello,</div><div>i've updated a test for the latest version of mesa-patch:</div><div dir="ltr"><a href="https://patchwork.freedesktop.org/patch/255629/">https://patchwork.freedesktop.org/patch/255629/</a><br></div><div>The image should looks for any driver (Windows, Nvidia, mesa) like this: </div><div><img src="cid:ii_jn3175hu0" alt="Screenshot from 2018-10-10 13-47-56.png" width="548" height="563"><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Sep 21, 2018 at 4:21 PM Sergii Romantsov <<a href="mailto:sergii.romantsov@gmail.com">sergii.romantsov@gmail.com</a>> wrote:<br></div><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>
In <a href="https://github.com/KhronosGroup/OpenGL-API/issues/41" rel="noreferrer" target="_blank">https://github.com/KhronosGroup/OpenGL-API/issues/41</a> said that<br>
behaviour is undefined and agreed that it would be fine for<br>
implementation to do something useful for this.<br>
Windows and Nvidia drivers have a workaround for that.<br>
For compatibility proposed optimized version of computations.<br>
Specification defines a formula of rotation (see "OpenGL 4.6<br>
(Compatibility Profile) - May 14, 2018", paragraph "12.1.1 Matrices").<br>
<br>
Optimized formula will look so:<br>
<br>
R = cos(angle) * I<br>
<br>
That is equavalent to logic that magnitude of (0,0,0)-vector is 1.0.<br>
<br>
-v2: logic moved to _math_matrix_rotate<br>
<br>
-v3: general optimization of computations<br>
<br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=100960" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=100960</a><br>
Signed-off-by: Sergii Romantsov <<a href="mailto:sergii.romantsov@globallogic.com" target="_blank">sergii.romantsov@globallogic.com</a>><br>
---<br>
src/mesa/math/m_matrix.c | 12 ++++++++++++<br>
1 file changed, 12 insertions(+)<br>
<br>
diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c<br>
index 57a4953..3eef122 100644<br>
--- a/src/mesa/math/m_matrix.c<br>
+++ b/src/mesa/math/m_matrix.c<br>
@@ -824,6 +824,18 @@ _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/show_bug.cgi?id=100960</a><br>
+ * <a href="https://github.com/KhronosGroup/OpenGL-API/issues/41" rel="noreferrer" target="_blank">https://github.com/KhronosGroup/OpenGL-API/issues/41</a><br>
+ * Here we will treat magnitude as 1.0 if it really 0.0.<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>
+ M(0,0) = c;<br>
+ M(1,1) = c;<br>
+ M(2,2) = c;<br>
+ }<br>
}<br>
else if (z == 0.0F) {<br>
optimized = GL_TRUE;<br>
-- <br>
2.7.4<br>
<br>
</blockquote></div>