[Mesa-dev] [PATCH] glsl: remove rsq+rcp -> sqrt transformation to fix the game Risen
Ian Romanick
idr at freedesktop.org
Tue May 31 20:54:27 UTC 2016
On 05/31/2016 03:46 AM, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> Using sqrt here breaks rendering.
That seems really weird. Any idea why? Does it just get a different
answer for certain boundary values? 0? -0?
> Apitrace: In the bugzilla.
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94627
> ---
> src/compiler/glsl/opt_algebraic.cpp | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/src/compiler/glsl/opt_algebraic.cpp b/src/compiler/glsl/opt_algebraic.cpp
> index f5858c8..f5fec9d 100644
> --- a/src/compiler/glsl/opt_algebraic.cpp
> +++ b/src/compiler/glsl/opt_algebraic.cpp
> @@ -898,11 +898,7 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
> neg(op_expr[0]->operands[0]));
> }
>
> - /* While ir_to_mesa.cpp will lower sqrt(x) to rcp(rsq(x)), it does so at
> - * its IR level, so we can always apply this transformation.
> - */
> - if (op_expr[0] && op_expr[0]->operation == ir_unop_rsq)
> - return sqrt(op_expr[0]->operands[0]);
> + /* DO NOT transform rsq+rcp into sqrt. It breaks the game Risen. */
>
> /* As far as we know, all backends are OK with rsq. */
> if (op_expr[0] && op_expr[0]->operation == ir_unop_sqrt) {
More information about the mesa-dev
mailing list