[Mesa-dev] [PATCH v1.1 2/2] clover: fix getting scalar args api size

Francisco Jerez currojerez at riseup.net
Mon Jun 6 00:07:25 UTC 2016


Vedran Miletić <vedran at miletic.net> writes:

> On 06/04/2016 04:27 AM, Francisco Jerez wrote:
>> Serge Martin <edb+mesa at sigluy.net> writes:
>>
>>> This fix getting the size of a struct arg. vec3 types still work ok.
>>> Only buit-in args need to have power of two alignment, getTypeAllocSize
>>> reports the correct size.
>>>
>> Is there any guarantee that the alloc size of the type will match what
>> the CL API expects? (which is the only thing arg_api_size is used for
>> IIRC) Isn't it fully dependent on the data layout which is pretty much
>> up to the target?
>>
>
> It is dependent on the target. The issue is that right now we get the 
> struct size wrongly, as we round it here to the next power of two, store 
> that in scalar arg object, and later compare that rounded value to 
> sizeof(struct_arg_type) which user has passed via the API.
>
I know, but using the target data layout-dependent alloc size of the
type as API-visible size seems pretty bogus too -- Unless we set as
requirement on all targets that their data alignment rules should match
the CL API's exactly, which I don't think is the case right now but
doesn't sound like a completely crazy idea to me.

> Regards,
> Vedran
>
> -- 
> Vedran Miletić
> vedran.miletic.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160605/0111bee1/attachment.sig>


More information about the mesa-dev mailing list