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

Vedran Miletić vedran at miletic.net
Sun Jun 5 23:07:26 UTC 2016


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.

Regards,
Vedran

-- 
Vedran Miletić
vedran.miletic.net


More information about the mesa-dev mailing list