On Wed, Dec 2, 2015 at 1:34 PM, Jason Ekstrand <ja...@jlekstrand.net> wrote:
> On Tue, Dec 1, 2015 at 4:16 PM, Matt Turner <matts...@gmail.com> wrote:
>> ---
>> I add the true/false variables for clarity since there are some existing
>> optimizations using ~0 where it actually has nothing to do with true.
>>
>> I could take it or leave it. We obviously can't use them for feq and
>> friends. Maybe itrue/ifalse and ftrue/ffalse?
>>
>>  src/glsl/nir/nir_opt_algebraic.py | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/src/glsl/nir/nir_opt_algebraic.py 
>> b/src/glsl/nir/nir_opt_algebraic.py
>> index 6aa8b1f..04261e7 100644
>> --- a/src/glsl/nir/nir_opt_algebraic.py
>> +++ b/src/glsl/nir/nir_opt_algebraic.py
>> @@ -32,6 +32,9 @@ b = 'b'
>>  c = 'c'
>>  d = 'd'
>>
>> +true = ~0
>> +false = 0
>
> I think you can just use the python True and False and it works fine.
> With that changed,

With that change, I see this diff in the generated nir_opt_algebraic.c:

-   { 0x0 /* 0 */ },
+   { NIR_FALSE /* False */ },
...
-   { 0xffffffff /* -1 */ },
+   { NIR_TRUE /* True */ },

I had no idea it would handle that. Cool.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to