[Mesa-dev] [PATCH 3/3] radeonsi: use #pragma pack to pack si_shader_key
Marek Olšák
maraeo at gmail.com
Mon Jun 26 22:15:43 UTC 2017
On Thu, Jun 22, 2017 at 9:19 AM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> On 20.06.2017 20:00, Marek Olšák wrote:
>>
>> From: Marek Olšák <marek.olsak at amd.com>
>>
>> sizeof(struct si_shader_key):
>> Before reverting the 2 commits: 120 bytes
>> After reverting the 2 commits: 128 bytes
>> With #pragma pack: 107 bytes
>>
>> I'm not sure if memcmp with a byte-aligned size is a good idea.
>
>
> Does this have a measurable impact? The code is nicer to read with the
> structure after the patches, but I'm not sure it's worth the risk of getting
> misaligned data somewhere.
It decreases the time spent in si_update_shaders by 6% when going from
128 bytes to 106 for the shader key.
What do you mean by the risk?
Marek
More information about the mesa-dev
mailing list