[Mesa-dev] [PATCH v2 09/28] glsl/ir: Add builtin function support for doubles

Ian Romanick idr at freedesktop.org
Mon Feb 9 11:07:40 PST 2015


On 02/07/2015 05:25 PM, Matt Turner wrote:
> On Sat, Feb 7, 2015 at 5:16 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
>> On Sat, Feb 7, 2015 at 8:10 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
>>>>> diff --git a/src/glsl/ir.h b/src/glsl/ir.h
>>>>> index a0f48b2..6e7c654 100644
>>>>> --- a/src/glsl/ir.h
>>>>> +++ b/src/glsl/ir.h
>>>>> @@ -1275,6 +1275,13 @@ enum ir_expression_operation {
>>>>>     ir_unop_bitcast_f2u, /**< Bit-identical float-to-uint "conversion" */
>>>>>     ir_unop_any,
>>>>>
>>>>> +   ir_unop_d2f,         /**< Double-to-float conversion. */
>>>>> +   ir_unop_f2d,         /**< Float-to-double conversion. */
>>>>> +   ir_unop_d2i,         /**< Double-to-integer conversion. */
>>>>> +   ir_unop_i2d,         /**< Integer-to-double conversion. */
>>>>> +   ir_unop_d2u,         /**< Double-to-unsigned conversion. */
>>>>> +   ir_unop_u2d,         /**< Unsigned-to-double conversion. */
>>>>> +
>>>>
>>>> These should be properly ordered with the other cast operations.  Also,
>>>> ir_unop_d2b is missing.
>>>
>>> Blast! You're right. I thought we were OK with d2f + f2b but... I
>>> guess not. I'll add it in :(
>>
>> BTW, I don't see a logic to the current cast operations' order, so I'm
>> going to leave these as-is (but add d2b in... b2d is actually probably
>> unnecessary).

Right... f2d(b2f(x)) should be fine.

> I'd at least put them above the bitcast operations and any with the
> other similar things like f2u.

Yeah... I wasn't completely clear, but that's what I was thinking too.



More information about the mesa-dev mailing list