[Mesa-dev] [PATCH 2/6] glsl: Optimize log(exp(x)) and exp(log(x)) into x.

Eric Anholt eric at anholt.net
Mon Jan 20 08:39:13 PST 2014


Erik Faye-Lund <kusmabite at gmail.com> writes:

> On Mon, Jan 20, 2014 at 8:18 AM, Eric Anholt <eric at anholt.net> wrote:
>> ---
>>  src/glsl/opt_algebraic.cpp | 36 ++++++++++++++++++++++++++++++++++++
>>  1 file changed, 36 insertions(+)
>>
>> diff --git a/src/glsl/opt_algebraic.cpp b/src/glsl/opt_algebraic.cpp
>> index 6b0d992..4aa49e5 100644
>> --- a/src/glsl/opt_algebraic.cpp
>> +++ b/src/glsl/opt_algebraic.cpp
>> @@ -252,6 +252,42 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
>>        }
>>        break;
>>
>> +   case ir_unop_exp:
>> +      if (op_expr[0] == NULL)
>> +        break;
>
> How can this happen?!

If the first operand itself isn't an expression (for example, it's a
swizzle of something else).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140120/c3ab0db4/attachment-0001.pgp>


More information about the mesa-dev mailing list