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

Jan Vesely jan.vesely at rutgers.edu
Thu Jun 2 01:59:02 UTC 2016


On Wed, 2016-06-01 at 14:36 +0200, Serge Martin wrote:
> This fix getting the size of a struct arg. vec3 types still work ok.
> Only buit-in args need to have power of two alignement, getTypeAllocSize
> reports the corect size.

"alignment", "correct"

otherwise LGTM. you probably want to cc Francisco on clover patches.

Jan

> 
> Cc: 12.0 <mesa-stable at lists.freedesktop.org>
> ---
>  src/gallium/state_trackers/clover/llvm/invocation.cpp | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> index 03487d6..bb0faaa 100644
> --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> @@ -469,10 +469,9 @@ namespace {
>  
>           // OpenCL 1.2 specification, Ch. 6.1.5: "A built-in data
>           // type that is not a power of two bytes in size must be
> -         // aligned to the next larger power of two".  We need this
> -         // alignment for three element vectors, which have
> -         // non-power-of-2 store size.
> -         const unsigned arg_api_size = util_next_power_of_two(arg_store_size);
> +         // aligned to the next larger power of two.
> +         // This rule applies to built-in types only, not structs or unions."
> +         const unsigned arg_api_size = TD.getTypeAllocSize(arg_type);
>  
>           llvm::Type *target_type = arg_type->isIntegerTy() ?
>                 TD.getSmallestLegalIntType(mod->getContext(), arg_store_size * 8)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/mesa-stable/attachments/20160601/334e6797/attachment-0001.sig>


More information about the mesa-stable mailing list