On Mon, Aug 4, 2014 at 7:55 AM, Brian Paul <bri...@vmware.com> wrote:

> On 08/02/2014 02:11 PM, Jason Ekstrand wrote:
>
>> Most format conversion operations required by GL can be performed by
>> converting one channel at a time, shuffling the channels around, and
>> optionally filling missing channels with zeros and ones.  This adds a
>> function to do just that in a general, yet efficient, way.
>>
>> v2:
>>   * Add better comments including full docs for functions
>>   * Don't use __typeof__
>>   * Use inline helpers instead of writing out conversions by hand,
>>   * Force full loop unrolling for better performance
>>
>> Signed-off-by: Jason Ekstrand <jason.ekstr...@intel.com>
>> ---
>>   src/mesa/main/format_utils.c | 844 ++++++++++++++++++++++++++++++
>> +++++++++++++
>>   src/mesa/main/format_utils.h |   5 +
>>   2 files changed, 849 insertions(+)
>>
>> diff --git a/src/mesa/main/format_utils.c b/src/mesa/main/format_utils.c
>> index 241c158..d60aeb3 100644
>> --- a/src/mesa/main/format_utils.c
>> +++ b/src/mesa/main/format_utils.c
>> @@ -54,3 +54,847 @@ _mesa_srgb_ubyte_to_linear_float(uint8_t cl)
>>
>>      return lut[cl];
>>   }
>> +
>> +/* A bunch of format conversion macros and helper functions used below */
>> +
>> +/* Only guaranteed to work for BITS <= 32 */
>> +#define MAX_UINT(BITS) ((BITS) == 32 ? UINT32_MAX : ((1u << (BITS)) - 1))
>> +#define MAX_INT(BITS) (int)MAX_UINT((BITS) - 1)
>>
>
> I'd probably put one more set of parens around the whole macro body, just
> to be safe.
>

Yup, fixed.
--Jason


>
> -Brian
>
>
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to