diff options
author | Chia-I Wu <[email protected]> | 2019-02-25 14:57:03 -0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2019-03-11 10:02:13 -0700 |
commit | c0567e84dbbcac5ef52ddd472be2f5bc1e8cdc69 (patch) | |
tree | d65d3b233e7dce632c226d5e501f49e1b48568b2 /src/freedreno | |
parent | fffaa9b4b36be4abdecefd4578ca685da57ed3e2 (diff) |
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.
Diffstat (limited to 'src/freedreno')
-rw-r--r-- | src/freedreno/vulkan/tu_cs.h | 11 |
1 files changed, 11 insertions, 0 deletions
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) { |