summaryrefslogtreecommitdiffstats
path: root/ta
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-09-27 17:08:06 +0200
committerMartin Herkt <652892+lachs0r@users.noreply.github.com>2017-12-25 00:47:53 +0100
commit4e34615872011f906bf653f61e7ac75d2066a06b (patch)
tree25dc37e11f1f5cdb34619a22091dbf0dc9cf1116 /ta
parentad50e640dcf94da7f14c908a96c05b3de791d498 (diff)
downloadmpv-4e34615872011f906bf653f61e7ac75d2066a06b.tar.bz2
mpv-4e34615872011f906bf653f61e7ac75d2066a06b.tar.xz
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
Diffstat (limited to 'ta')
-rw-r--r--ta/ta_talloc.h7
1 files changed, 7 insertions, 0 deletions
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))