diff --git a/src/freedreno/vulkan/tu_cs.c b/src/freedreno/vulkan/tu_cs.c index 59f7f702296..8372af0080e 100644 --- a/src/freedreno/vulkan/tu_cs.c +++ b/src/freedreno/vulkan/tu_cs.c @@ -45,10 +45,12 @@ tu_cs_init(struct tu_cs *cs, * Initialize a command stream as a wrapper to an external buffer. */ void -tu_cs_init_external(struct tu_cs *cs, uint32_t *start, uint32_t *end) +tu_cs_init_external(struct tu_cs *cs, struct tu_device *device, + uint32_t *start, uint32_t *end) { memset(cs, 0, sizeof(*cs)); + cs->device = device; cs->mode = TU_CS_MODE_EXTERNAL; cs->start = cs->reserved_end = cs->cur = start; cs->end = end; @@ -252,7 +254,7 @@ tu_cs_begin_sub_stream(struct tu_cs *cs, uint32_t size, struct tu_cs *sub_cs) if (result != VK_SUCCESS) return result; - tu_cs_init_external(sub_cs, cs->cur, cs->reserved_end); + tu_cs_init_external(sub_cs, cs->device, cs->cur, cs->reserved_end); tu_cs_begin(sub_cs); result = tu_cs_reserve_space(sub_cs, size); assert(result == VK_SUCCESS); diff --git a/src/freedreno/vulkan/tu_cs.h b/src/freedreno/vulkan/tu_cs.h index e606ab465af..494d9d8fcb5 100644 --- a/src/freedreno/vulkan/tu_cs.h +++ b/src/freedreno/vulkan/tu_cs.h @@ -36,7 +36,8 @@ tu_cs_init(struct tu_cs *cs, uint32_t initial_size); void -tu_cs_init_external(struct tu_cs *cs, uint32_t *start, uint32_t *end); +tu_cs_init_external(struct tu_cs *cs, struct tu_device *device, + uint32_t *start, uint32_t *end); void tu_cs_finish(struct tu_cs *cs); @@ -79,7 +80,7 @@ tu_cs_draw_state(struct tu_cs *sub_cs, struct tu_cs *cs, uint32_t size) /* TODO: clean this up */ tu_cs_alloc(sub_cs, size, 1, &memory); - tu_cs_init_external(cs, memory.map, memory.map + size); + tu_cs_init_external(cs, sub_cs->device, memory.map, memory.map + size); tu_cs_begin(cs); tu_cs_reserve_space(cs, size);