venus: expose vn_feedback_buffer_create()
For query pool feedback, which are variable in size depending on the query type and being contiguous will allow for simpler copies/clears. Signed-off-by: Juston Li <justonli@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23348>
This commit is contained in:
@@ -10,15 +10,6 @@
|
||||
#include "vn_physical_device.h"
|
||||
#include "vn_queue.h"
|
||||
|
||||
/* coherent buffer with bound and mapped memory */
|
||||
struct vn_feedback_buffer {
|
||||
VkBuffer buffer;
|
||||
VkDeviceMemory memory;
|
||||
void *data;
|
||||
|
||||
struct list_head head;
|
||||
};
|
||||
|
||||
static uint32_t
|
||||
vn_get_memory_type_index(const VkPhysicalDeviceMemoryProperties *mem_props,
|
||||
uint32_t mem_type_bits,
|
||||
@@ -35,7 +26,7 @@ vn_get_memory_type_index(const VkPhysicalDeviceMemoryProperties *mem_props,
|
||||
return UINT32_MAX;
|
||||
}
|
||||
|
||||
static VkResult
|
||||
VkResult
|
||||
vn_feedback_buffer_create(struct vn_device *dev,
|
||||
uint32_t size,
|
||||
const VkAllocationCallbacks *alloc,
|
||||
@@ -128,7 +119,7 @@ out_free_feedback_buf:
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
vn_feedback_buffer_destroy(struct vn_device *dev,
|
||||
struct vn_feedback_buffer *feedback_buf,
|
||||
const VkAllocationCallbacks *alloc)
|
||||
|
||||
@@ -55,6 +55,15 @@ struct vn_feedback_cmd_pool {
|
||||
VkCommandPool pool;
|
||||
};
|
||||
|
||||
/* coherent buffer with bound and mapped memory */
|
||||
struct vn_feedback_buffer {
|
||||
VkBuffer buffer;
|
||||
VkDeviceMemory memory;
|
||||
void *data;
|
||||
|
||||
struct list_head head;
|
||||
};
|
||||
|
||||
VkResult
|
||||
vn_feedback_pool_init(struct vn_device *dev,
|
||||
struct vn_feedback_pool *pool,
|
||||
@@ -109,6 +118,17 @@ vn_feedback_set_counter(struct vn_feedback_slot *slot, uint64_t counter)
|
||||
*slot->counter = counter;
|
||||
}
|
||||
|
||||
VkResult
|
||||
vn_feedback_buffer_create(struct vn_device *dev,
|
||||
uint32_t size,
|
||||
const VkAllocationCallbacks *alloc,
|
||||
struct vn_feedback_buffer **out_feedback_buf);
|
||||
|
||||
void
|
||||
vn_feedback_buffer_destroy(struct vn_device *dev,
|
||||
struct vn_feedback_buffer *feedback_buf,
|
||||
const VkAllocationCallbacks *alloc);
|
||||
|
||||
void
|
||||
vn_feedback_event_cmd_record(VkCommandBuffer cmd_handle,
|
||||
VkEvent ev_handle,
|
||||
|
||||
Reference in New Issue
Block a user