[Mesa-dev] [PATCH v2 13/23] mesa: Autogenerate most of format_pack.c

Samuel Iglesias Gonsálvez siglesias at igalia.com
Mon Dec 1 23:03:20 PST 2014



On 01/12/14 20:00, Jason Ekstrand wrote:
> On Mon, Dec 1, 2014 at 3:04 AM, Iago Toral Quiroga <itoral at igalia.com>
> wrote:
> 
>> From: Jason Ekstrand <jason.ekstrand at intel.com>
>>
>> We were auto-generating it before.  The problem was that the autogeneration
>> tool we were using was called "copy, paste, and edit".  Let's use a more
>> sensible solution.
>>
>> Signed-off-by: Jason Ekstrand <jason.ekstrand at intel.com>
>>
>> v2 by Samuel Iglesias <siglesias at igalia.com>
>> - Remove format_pack.c as it is now autogenerated
>> - Add usage of INDENT_FLAGS in Makefile.am
>> - Remove trailing blank line
>>
>> v3 by Samuel Iglesias <siglesias at igalia.com>
>> - Merge format_convert.py into format_parser.py
>>    - Adapt pack_*_* function generations
>> - Fix out-of-tree build
>>
>> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias at igalia.com>
>> ---
[...]
>> +   def __get_datatype(self, type, size):
>> +      if type == FLOAT:
>> +         if size == 32:
>> +            return 'float'
>> +         elif size == 16:
>> +            return 'uint16_t'
>> +         else:
>> +            assert False
>> +      elif type == UNSIGNED:
>> +         if size <= 8:
>> +            return 'uint8_t'
>> +         elif size <= 16:
>> +            return 'uint16_t'
>> +         elif size <= 32:
>> +            return 'uint32_t'
>> +         else:
>> +            assert False
>> +      elif type == SIGNED:
>> +         if size <= 8:
>> +            return 'int8_t'
>> +         elif size <= 16:
>> +            return 'int16_t'
>> +         elif size <= 32:
>> +            return 'int32_t'
>> +         else:
>> +            assert False
>> +      else:
>> +         assert False
>>
> 
> Let's put this in a helper that's called by both Format and Channel.  That
> way if we change any of this, it's all in one place.  Also, it still
> doesn't build.  Matt is looking into that.
> --Jason
> 
> 

OK, I will put this in a helper.

Which error do you get when building? I created a build/ directory in
Mesa and build from there with success. However, any help on this would
be great.

Thanks,

Sam


More information about the mesa-dev mailing list