[Mesa-dev] [PATCH 11/18] util/vk_alloc: Add a vk_zalloc2 helper
Pohjolainen, Topi
topi.pohjolainen at gmail.com
Thu Nov 3 16:31:40 UTC 2016
On Fri, Oct 28, 2016 at 02:17:07AM -0700, Jason Ekstrand wrote:
> Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
With the typo fixed in patch 10, patches 10 and 11 are:
Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
I'm working on patch 13. I'm stuck with it pretty much the same
way as with your earlier series. I just don't know well enough how
batches are built and what different offsets mean.
> ---
> src/util/vk_alloc.h | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/src/util/vk_alloc.h b/src/util/vk_alloc.h
> index a8e21ca..fdf0039 100644
> --- a/src/util/vk_alloc.h
> +++ b/src/util/vk_alloc.h
> @@ -25,6 +25,7 @@
>
> /* common allocation inlines for vulkan drivers */
>
> +#include <string.h>
> #include <vulkan/vulkan.h>
>
> static inline void *
> @@ -61,6 +62,21 @@ vk_alloc2(const VkAllocationCallbacks *parent_alloc,
> return vk_alloc(parent_alloc, size, align, scope);
> }
>
> +static inline void *
> +vk_zalloc2(const VkAllocationCallbacks *parent_alloc,
> + const VkAllocationCallbacks *alloc,
> + size_t size, size_t align,
> + VkSystemAllocationScope scope)
> +{
> + void *mem = vk_alloc2(parent_alloc, alloc, size, align, scope);
> + if (mem == NULL)
> + return NULL;
> +
> + memset(mem, 0, size);
> +
> + return mem;
> +}
> +
> static inline void
> vk_free2(const VkAllocationCallbacks *parent_alloc,
> const VkAllocationCallbacks *alloc,
> --
> 2.5.0.400.gff86faf
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list