Uploaded new version.
Seems that waiting for any response on
https://github.com/KhronosGroup/OpenGL-API/issues/41 may take much more
time....

On Tue, Sep 18, 2018 at 4:57 PM, Sergii Romantsov <
sergii.romant...@gmail.com> wrote:

> Specification doesn't define behaviour for rotation of 0-vector.
> Windows and Nvidia drivers have a workaround for that.
> For compatibility proposed that for 0-vector a rotation will be
> done around x-axis.
>
> -v2: logic moved to _math_matrix_rotate
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100960
> Signed-off-by: Sergii Romantsov <sergii.romant...@globallogic.com>
> ---
>  src/mesa/math/m_matrix.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>
> diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c
> index 57a4953..2b3adb3 100644
> --- a/src/mesa/math/m_matrix.c
> +++ b/src/mesa/math/m_matrix.c
> @@ -824,6 +824,25 @@ _math_matrix_rotate( GLmatrix *mat,
>                 M(1,0) = s;
>              }
>           }
> +         else {
> +            /* https://bugs.freedesktop.org/show_bug.cgi?id=100960
> +             * https://github.com/KhronosGroup/OpenGL-API/issues/41
> +             * So that is kind of workaround for empty-vectors to have
> +             * compatibility with Windows and Nvidia drivers.
> +             */
> +            optimized = GL_TRUE;
> +            /* rotate only around x-axis */
> +            M(1,1) = c;
> +            M(2,2) = c;
> +            if (x < 0.0F) {
> +               M(1,2) = s;
> +               M(2,1) = -s;
> +            }
> +            else {
> +               M(1,2) = -s;
> +               M(2,1) = s;
> +            }
> +         }
>        }
>        else if (z == 0.0F) {
>           optimized = GL_TRUE;
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>



-- 
Sergii Romantsov
GlobalLogic Inc.
www.globallogic.com
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to