diff options
author | Brian Ho <[email protected]> | 2020-02-28 10:33:34 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-03-03 02:25:25 +0000 |
commit | 5715a61fa96e8986da82ef263e06db4ef90fb106 (patch) | |
tree | ffef98dde010986949fc676dd451c548a86686ce /src/freedreno | |
parent | bdf20d324bfec6a6cbabf7492cb4b19f7d9de5ad (diff) |
turnip: Promote tu_cs_get_size/is_empty to header
These will be used in tu_cmd_buffer.c.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3988>
Diffstat (limited to 'src/freedreno')
-rw-r--r-- | src/freedreno/vulkan/tu_cs.c | 20 | ||||
-rw-r--r-- | src/freedreno/vulkan/tu_cs.h | 20 |
2 files changed, 20 insertions, 20 deletions
diff --git a/src/freedreno/vulkan/tu_cs.c b/src/freedreno/vulkan/tu_cs.c index 16d49838ba8..9a9af0c3a00 100644 --- a/src/freedreno/vulkan/tu_cs.c +++ b/src/freedreno/vulkan/tu_cs.c @@ -80,26 +80,6 @@ tu_cs_get_offset(const struct tu_cs *cs) return cs->start - (uint32_t *) cs->bos[cs->bo_count - 1]->map; } -/** - * Get the size of the command packets emitted since the last call to - * tu_cs_add_entry. - */ -static uint32_t -tu_cs_get_size(const struct tu_cs *cs) -{ - return cs->cur - cs->start; -} - -/** - * Return true if there is no command packet emitted since the last call to - * tu_cs_add_entry. - */ -static uint32_t -tu_cs_is_empty(const struct tu_cs *cs) -{ - return tu_cs_get_size(cs) == 0; -} - /* * Allocate and add a BO to a command stream. Following command packets will * be emitted to the new BO. diff --git a/src/freedreno/vulkan/tu_cs.h b/src/freedreno/vulkan/tu_cs.h index 29baca74faf..33d000ae06f 100644 --- a/src/freedreno/vulkan/tu_cs.h +++ b/src/freedreno/vulkan/tu_cs.h @@ -67,6 +67,26 @@ VkResult tu_cs_add_entries(struct tu_cs *cs, struct tu_cs *target); /** + * Get the size of the command packets emitted since the last call to + * tu_cs_add_entry. + */ +static inline uint32_t +tu_cs_get_size(const struct tu_cs *cs) +{ + return cs->cur - cs->start; +} + +/** + * Return true if there is no command packet emitted since the last call to + * tu_cs_add_entry. + */ +static inline uint32_t +tu_cs_is_empty(const struct tu_cs *cs) +{ + return tu_cs_get_size(cs) == 0; +} + +/** * Discard all entries. This allows \a cs to be reused while keeping the * existing BOs and command packets intact. */ |