• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright © Microsoft Corporation
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice (including the next
12  * paragraph) shall be included in all copies or substantial portions of the
13  * Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21  * IN THE SOFTWARE.
22  */
23 
24 #ifndef DZN_PHYSICAL_DEVICE_ENUM_H
25 #define DZN_PHYSICAL_DEVICE_ENUM_H
26 
27 #include <vulkan/vulkan.h>
28 
29 #include <unknwn.h>
30 
31 #ifndef _WIN32
32 #include <wsl/winadapter.h>
33 #endif
34 
35 #include <stdbool.h>
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 struct dzn_instance;
42 
43 struct dzn_physical_device_desc {
44    uint32_t vendor_id;
45    uint32_t device_id;
46    uint32_t subsys_id;
47    uint32_t revision;
48    uint64_t shared_system_memory;
49    uint64_t dedicated_system_memory;
50    uint64_t dedicated_video_memory;
51    LUID adapter_luid;
52    bool is_warp;
53    char description[128];
54 };
55 
56 VkResult
57 dzn_enumerate_physical_devices_dxgi(struct dzn_instance *instance);
58 
59 VkResult
60 dzn_enumerate_physical_devices_dxcore(struct dzn_instance *instance);
61 
62 VkResult
63 dzn_instance_add_physical_device(struct dzn_instance *instance,
64                                  IUnknown *adapter,
65                                  const struct dzn_physical_device_desc *desc);
66 
67 #ifdef __cplusplus
68 }
69 #endif
70 
71 #endif /* DZN_PHYSICAL_DEVICE_ENUM_H */
72