mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-09 14:50:11 +01:00
pvr: Implement vkCreateEvent and vkDestroyEvent APIs.
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com> Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18612>
This commit is contained in:
parent
def3b88da5
commit
1b94dfd4b2
2 changed files with 39 additions and 2 deletions
|
|
@ -2541,7 +2541,20 @@ VkResult pvr_CreateEvent(VkDevice _device,
|
|||
const VkAllocationCallbacks *pAllocator,
|
||||
VkEvent *pEvent)
|
||||
{
|
||||
assert(!"Unimplemented");
|
||||
PVR_FROM_HANDLE(pvr_device, device, _device);
|
||||
|
||||
struct pvr_event *event = vk_object_alloc(&device->vk,
|
||||
pAllocator,
|
||||
sizeof(*event),
|
||||
VK_OBJECT_TYPE_EVENT);
|
||||
if (!event)
|
||||
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
|
||||
|
||||
event->sync = NULL;
|
||||
event->state = PVR_EVENT_STATE_RESET_BY_HOST;
|
||||
|
||||
*pEvent = pvr_event_to_handle(event);
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -2549,7 +2562,16 @@ void pvr_DestroyEvent(VkDevice _device,
|
|||
VkEvent _event,
|
||||
const VkAllocationCallbacks *pAllocator)
|
||||
{
|
||||
assert(!"Unimplemented");
|
||||
PVR_FROM_HANDLE(pvr_device, device, _device);
|
||||
PVR_FROM_HANDLE(pvr_event, event, _event);
|
||||
|
||||
if (!event)
|
||||
return;
|
||||
|
||||
if (event->sync)
|
||||
vk_sync_destroy(&device->vk, event->sync);
|
||||
|
||||
vk_object_free(&device->vk, pAllocator, event);
|
||||
}
|
||||
|
||||
VkResult pvr_GetEventStatus(VkDevice _device, VkEvent _event)
|
||||
|
|
|
|||
|
|
@ -222,6 +222,13 @@ enum pvr_static_clear_variant_bits {
|
|||
|
||||
#define PVR_STATIC_CLEAR_VARIANT_COUNT (PVR_STATIC_CLEAR_COLOR_BIT << 1U)
|
||||
|
||||
enum pvr_event_state {
|
||||
PVR_EVENT_STATE_SET_BY_HOST,
|
||||
PVR_EVENT_STATE_RESET_BY_HOST,
|
||||
PVR_EVENT_STATE_SET_BY_DEVICE,
|
||||
PVR_EVENT_STATE_RESET_BY_DEVICE
|
||||
};
|
||||
|
||||
struct pvr_bo;
|
||||
struct pvr_compute_ctx;
|
||||
struct pvr_compute_pipeline;
|
||||
|
|
@ -630,6 +637,13 @@ struct pvr_descriptor_set {
|
|||
struct pvr_descriptor descriptors[0];
|
||||
};
|
||||
|
||||
struct pvr_event {
|
||||
struct vk_object_base base;
|
||||
|
||||
enum pvr_event_state state;
|
||||
struct vk_sync *sync;
|
||||
};
|
||||
|
||||
struct pvr_descriptor_state {
|
||||
struct pvr_descriptor_set *descriptor_sets[PVR_MAX_DESCRIPTOR_SETS];
|
||||
uint32_t valid_mask;
|
||||
|
|
@ -1601,6 +1615,7 @@ VK_DEFINE_NONDISP_HANDLE_CASTS(pvr_descriptor_set,
|
|||
base,
|
||||
VkDescriptorSet,
|
||||
VK_OBJECT_TYPE_DESCRIPTOR_SET)
|
||||
VK_DEFINE_NONDISP_HANDLE_CASTS(pvr_event, base, VkEvent, VK_OBJECT_TYPE_EVENT)
|
||||
VK_DEFINE_NONDISP_HANDLE_CASTS(pvr_descriptor_pool,
|
||||
base,
|
||||
VkDescriptorPool,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue