[Mesa-dev] [PATCH] glsl: Fix pi/2 constant in acos built-in function

Paul Berry stereotype441 at gmail.com
Mon Jun 4 22:19:30 CEST 2012


On 4 June 2012 13:11, Ian Romanick <idr at freedesktop.org> wrote:

> From: Ian Romanick <ian.d.romanick at intel.com>
>
> In single precision, 1.5707963 becomes 1.5707962513 which is too
> small.  However, 1.5707964 becomes 1.5707963705 which is just right.
> The value 1.5707964 is already used in asin.ir.
>
> NOTE: This is a candidate for stable release branches.
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> Cc: Olivier Galibert <galibert at pobox.com>
> Cc: Paul Berry <stereotype441 at gmail.com>
>

Reviewed-by: Paul Berry <stereotype441 at gmail.com>


> ---
>  src/glsl/builtins/ir/acos.ir |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/glsl/builtins/ir/acos.ir b/src/glsl/builtins/ir/acos.ir
> index f0078f8..8c3797e 100644
> --- a/src/glsl/builtins/ir/acos.ir
> +++ b/src/glsl/builtins/ir/acos.ir
> @@ -4,26 +4,26 @@
>        (declare (in) float x))
>      ((declare () float s)
>       (call asin (var_ref s) ((var_ref x)))
> -      (return (expression float - (constant float (1.5707963)) (var_ref
> s)))))
> +      (return (expression float - (constant float (1.5707964)) (var_ref
> s)))))
>
>    (signature vec2
>      (parameters
>        (declare (in) vec2 x))
>      ((declare () vec2 s)
>       (call asin (var_ref s) ((var_ref x)))
> -      (return (expression vec2 - (constant float (1.5707963)) (var_ref
> s)))))
> +      (return (expression vec2 - (constant float (1.5707964)) (var_ref
> s)))))
>
>    (signature vec3
>      (parameters
>        (declare (in) vec3 x))
>      ((declare () vec3 s)
>       (call asin (var_ref s) ((var_ref x)))
> -      (return (expression vec3 - (constant float (1.5707963)) (var_ref
> s)))))
> +      (return (expression vec3 - (constant float (1.5707964)) (var_ref
> s)))))
>
>    (signature vec4
>      (parameters
>        (declare (in) vec4 x))
>      ((declare () vec4 s)
>       (call asin (var_ref s) ((var_ref x)))
> -      (return (expression vec4 - (constant float (1.5707963)) (var_ref
> s)))))
> +      (return (expression vec4 - (constant float (1.5707964)) (var_ref
> s)))))
>  ))
> --
> 1.7.6.5
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120604/79b1feca/attachment.htm>


More information about the mesa-dev mailing list