From c0567e84dbbcac5ef52ddd472be2f5bc1e8cdc69 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 25 Feb 2019 14:57:03 -0800 Subject: [PATCH] turnip: tu_cs_emit_array Array version of tu_cs_emit. Useful for updating multiple consecutive array-like registers, or loading a shader binary with SS6_DIRECT. --- src/freedreno/vulkan/tu_cs.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/freedreno/vulkan/tu_cs.h b/src/freedreno/vulkan/tu_cs.h index 4df7fb806e3..f3e0ade2a36 100644 --- a/src/freedreno/vulkan/tu_cs.h +++ b/src/freedreno/vulkan/tu_cs.h @@ -103,6 +103,17 @@ tu_cs_emit(struct tu_cs *cs, uint32_t value) ++cs->cur; } +/** + * Emit an array of uint32_t into a command stream, without boundary checking. + */ +static inline void +tu_cs_emit_array(struct tu_cs *cs, const uint32_t *values, uint32_t length) +{ + assert(cs->cur + length <= cs->reserved_end); + memcpy(cs->cur, values, sizeof(uint32_t) * length); + cs->cur += length; +} + static inline unsigned tu_odd_parity_bit(unsigned val) { -- 2.30.2