From 4e34615872011f906bf653f61e7ac75d2066a06b Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Wed, 27 Sep 2017 17:08:06 +0200 Subject: vo_gpu: vulkan: refactor vk_cmdpool 1. No more static arrays (deps / callbacks / queues / cmds) 2. Allows safely recording multiple commands at the same time 3. Uses resources optimally by never over-allocating commands --- ta/ta_talloc.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ta') diff --git a/ta/ta_talloc.h b/ta/ta_talloc.h index 693fd091e0..9ebedd94fd 100644 --- a/ta/ta_talloc.h +++ b/ta/ta_talloc.h @@ -124,6 +124,13 @@ char *ta_talloc_asprintf_append_buffer(char *s, const char *fmt, ...) TA_PRF(2, (idxvar)--; \ } while (0) +// Returns whether or not there was any element to pop. +#define MP_TARRAY_POP(p, idxvar, out) \ + ((idxvar) > 0 \ + ? (*(out) = (p)[--(idxvar)], true) \ + : false \ + ) + #define talloc_struct(ctx, type, ...) \ talloc_memdup(ctx, &(type) TA_EXPAND_ARGS(__VA_ARGS__), sizeof(type)) -- cgit v1.2.3