aboutsummaryrefslogtreecommitdiff
path: root/loader/loader.h
diff options
context:
space:
mode:
authorJon Ashburn <jon@lunarg.com>2015-06-10 10:06:06 -0600
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-06-18 10:22:56 -0600
commit21313145963f5dd1f3fec57c6d00bd50eaaee237 (patch)
tree8c4bf2536796c731c2e34655283108af5c0ff506 /loader/loader.h
parent5600c8d92d654e1b131abd5ac35fd1378690f2e4 (diff)
downloadusermoji-21313145963f5dd1f3fec57c6d00bd50eaaee237.tar.xz
loader: Add device struct so can destroy layer info at DestroyDevice
This also allows multiple logical devices per icd/gpu combo. Old code conflated a icd/gpu combo with a logical device
Diffstat (limited to 'loader/loader.h')
-rw-r--r--loader/loader.h36
1 files changed, 21 insertions, 15 deletions
diff --git a/loader/loader.h b/loader/loader.h
index 44ded0ba..f3408d2c 100644
--- a/loader/loader.h
+++ b/loader/loader.h
@@ -45,7 +45,7 @@
#define MAX_EXTENSION_NAME_SIZE 255
#define MAX_LAYER_LIBRARIES 64
-#define MAX_GPUS_FOR_LAYER 16
+#define MAX_GPUS_PER_ICD 16
enum extension_origin {
VK_EXTENSION_ORIGIN_ICD,
@@ -91,11 +91,24 @@ struct loader_scanned_layers {
struct loader_extension_list physical_device_extension_list;
};
+/* per CreateDevice structure */
+struct loader_device {
+ VkLayerDispatchTable loader_dispatch;
+ VkDevice device; // device object from the icd
+
+ uint32_t app_extension_count;
+ VkExtensionProperties *app_extension_props;
+
+ struct loader_extension_list enabled_device_extensions;
+ struct loader_extension_list activated_layer_list;
+
+ struct loader_device *next;
+};
+
struct loader_icd {
const struct loader_scanned_icds *scanned_icds;
- VkLayerDispatchTable loader_dispatch[MAX_GPUS_FOR_LAYER];
- uint32_t layer_count[MAX_GPUS_FOR_LAYER];
+ struct loader_device *logical_device_list;
uint32_t gpu_count;
VkPhysicalDevice *gpus;
VkInstance instance; // instance object from the icd
@@ -109,20 +122,13 @@ struct loader_icd {
PFN_vkGetDisplayInfoWSI GetDisplayInfoWSI;
PFN_vkDbgCreateMsgCallback DbgCreateMsgCallback;
PFN_vkDbgDestroyMsgCallback DbgDestroyMsgCallback;
- struct loader_icd *next;
-
- uint32_t app_extension_count[MAX_GPUS_FOR_LAYER];
- VkExtensionProperties *app_extension_props[MAX_GPUS_FOR_LAYER];
-
/*
* Fill in the cache of available extensions from all layers that
* operate with this physical device.
* This cache will be used to satisfy calls to GetPhysicalDeviceExtensionInfo
*/
- struct loader_extension_list device_extension_cache[MAX_GPUS_FOR_LAYER];
-
- struct loader_extension_list enabled_device_extensions[MAX_GPUS_FOR_LAYER];
- struct loader_extension_list activated_layer_list[MAX_GPUS_FOR_LAYER];
+ struct loader_extension_list device_extension_cache[MAX_GPUS_PER_ICD];
+ struct loader_icd *next;
};
struct loader_instance {
@@ -350,9 +356,6 @@ void loader_add_to_ext_list(
const struct loader_extension_property *props);
void loader_destroy_ext_list(struct loader_extension_list *ext_info);
-void loader_enable_instance_layers(struct loader_instance *inst);
-void loader_deactivate_instance_layers(struct loader_instance *instance);
-
bool loader_is_extension_scanned(const VkExtensionProperties *ext_prop);
void loader_icd_scan(void);
void layer_lib_scan(void);
@@ -360,6 +363,9 @@ void loader_coalesce_extensions(void);
struct loader_icd * loader_get_icd(const VkPhysicalDevice gpu,
uint32_t *gpu_index);
+void loader_remove_logical_device(VkDevice device);
+void loader_enable_instance_layers(struct loader_instance *inst);
+void loader_deactivate_instance_layers(struct loader_instance *instance);
uint32_t loader_activate_instance_layers(struct loader_instance *inst);
void loader_activate_instance_layer_extensions(struct loader_instance *inst);
#endif /* LOADER_H */