1bf215546Sopenharmony_ci/*
2bf215546Sopenharmony_ci * Copyright 2019 Google LLC
3bf215546Sopenharmony_ci * SPDX-License-Identifier: MIT
4bf215546Sopenharmony_ci *
5bf215546Sopenharmony_ci * based in part on anv and radv which are:
6bf215546Sopenharmony_ci * Copyright © 2015 Intel Corporation
7bf215546Sopenharmony_ci * Copyright © 2016 Red Hat.
8bf215546Sopenharmony_ci * Copyright © 2016 Bas Nieuwenhuizen
9bf215546Sopenharmony_ci */
10bf215546Sopenharmony_ci
11bf215546Sopenharmony_ci#ifndef VN_DEVICE_H
12bf215546Sopenharmony_ci#define VN_DEVICE_H
13bf215546Sopenharmony_ci
14bf215546Sopenharmony_ci#include "vn_common.h"
15bf215546Sopenharmony_ci
16bf215546Sopenharmony_ci#include "vn_buffer.h"
17bf215546Sopenharmony_ci#include "vn_device_memory.h"
18bf215546Sopenharmony_ci#include "vn_feedback.h"
19bf215546Sopenharmony_ci
20bf215546Sopenharmony_cistruct vn_device {
21bf215546Sopenharmony_ci   struct vn_device_base base;
22bf215546Sopenharmony_ci
23bf215546Sopenharmony_ci   struct vn_instance *instance;
24bf215546Sopenharmony_ci   struct vn_physical_device *physical_device;
25bf215546Sopenharmony_ci   struct vn_renderer *renderer;
26bf215546Sopenharmony_ci
27bf215546Sopenharmony_ci   /* unique queue family indices in which to create the device queues */
28bf215546Sopenharmony_ci   uint32_t *queue_families;
29bf215546Sopenharmony_ci   uint32_t queue_family_count;
30bf215546Sopenharmony_ci
31bf215546Sopenharmony_ci   struct vn_device_memory_pool memory_pools[VK_MAX_MEMORY_TYPES];
32bf215546Sopenharmony_ci
33bf215546Sopenharmony_ci   struct vn_buffer_cache buffer_cache;
34bf215546Sopenharmony_ci
35bf215546Sopenharmony_ci   struct vn_feedback_pool feedback_pool;
36bf215546Sopenharmony_ci
37bf215546Sopenharmony_ci   /* feedback cmd pool per queue family used by the device
38bf215546Sopenharmony_ci    * - length matches queue_family_count
39bf215546Sopenharmony_ci    * - order matches queue_families
40bf215546Sopenharmony_ci    */
41bf215546Sopenharmony_ci   struct vn_feedback_cmd_pool *cmd_pools;
42bf215546Sopenharmony_ci
43bf215546Sopenharmony_ci   struct vn_queue *queues;
44bf215546Sopenharmony_ci   uint32_t queue_count;
45bf215546Sopenharmony_ci};
46bf215546Sopenharmony_ciVK_DEFINE_HANDLE_CASTS(vn_device,
47bf215546Sopenharmony_ci                       base.base.base,
48bf215546Sopenharmony_ci                       VkDevice,
49bf215546Sopenharmony_ci                       VK_OBJECT_TYPE_DEVICE)
50bf215546Sopenharmony_ci
51bf215546Sopenharmony_ci#endif /* VN_DEVICE_H */
52