aboutsummaryrefslogtreecommitdiff
path: root/loader/loader.h
diff options
context:
space:
mode:
authorJon Ashburn <jon@lunarg.com>2015-08-20 16:35:30 -0600
committerJon Ashburn <jon@lunarg.com>2015-08-24 09:17:44 -0600
commitbbd33cb3fb3d7200f13d1125e7d419c05e692ca2 (patch)
treef5744eeef12077db6912572ec300508b1efeeaf5 /loader/loader.h
parent49bfac7871a43a74e238c749013691b79c939d74 (diff)
downloadusermoji-bbd33cb3fb3d7200f13d1125e7d419c05e692ca2.tar.xz
loader: Make so layer manifest files are retained at CreateInstance
layer manifest files were rescanned after CreateInstance as needed for CreateDevice and GetPhysicalDeviceXXXProperties. Now stored the device and instance layer list in instance object. Also fix mem leak of extension list in some cases. Also fix bug where deep copy of instance to device layer properties was not being done. Only a shallow copy was being done. Also remove the lib_info struct from layer properties structure as only the lib name field was being used. Other layer library info is stored in the layer_library_list once the layer libraries are opened.
Diffstat (limited to 'loader/loader.h')
-rw-r--r--loader/loader.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/loader/loader.h b/loader/loader.h
index 2b4e4911..1e4a3aba 100644
--- a/loader/loader.h
+++ b/loader/loader.h
@@ -71,7 +71,7 @@ struct loader_name_value {
};
struct loader_lib_info {
- char *lib_name;
+ char lib_name[MAX_STRING_SIZE];
uint32_t ref_count;
loader_platform_dl_handle lib_handle;
};
@@ -86,7 +86,7 @@ struct loader_layer_functions {
struct loader_layer_properties {
VkLayerProperties info;
enum layer_type type;
- struct loader_lib_info lib_info;
+ char lib_name[MAX_STRING_SIZE];
struct loader_layer_functions functions;
struct loader_extension_list instance_extension_list;
struct loader_extension_list device_extension_list;
@@ -121,7 +121,9 @@ struct loader_device {
/* per ICD structure */
struct loader_icd {
- const struct loader_scanned_icds *scanned_icds;
+ // pointers to find other structs
+ const struct loader_scanned_icds *this_icd_lib;
+ const struct loader_instance *this_instance;
struct loader_device *logical_device_list;
uint32_t gpu_count;
@@ -170,6 +172,9 @@ struct loader_instance {
struct loader_instance *next;
struct loader_extension_list ext_list; // icds and loaders extensions
struct loader_icd_libs icd_libs;
+ struct loader_layer_list instance_layer_list;
+ struct loader_layer_list device_layer_list;
+
/* TODO: Should keep track of application provided allocation functions */
struct loader_msg_callback_map_entry *icd_msg_callback_map;
@@ -249,7 +254,10 @@ bool compare_vk_extension_properties(
const VkExtensionProperties* op1,
const VkExtensionProperties* op2);
-VkResult loader_validate_layers(const uint32_t layer_count, const char * const *ppEnabledLayerNames, struct loader_layer_list *list);
+VkResult loader_validate_layers(
+ const uint32_t layer_count,
+ const char * const *ppEnabledLayerNames,
+ const struct loader_layer_list *list);
VkResult loader_validate_instance_extensions(
const struct loader_extension_list *icd_exts,
@@ -341,7 +349,7 @@ void loader_add_to_ext_list(
uint32_t prop_list_count,
const VkExtensionProperties *props);
void loader_destroy_ext_list(struct loader_extension_list *ext_info);
-
+void loader_delete_layer_properties(struct loader_layer_list *layer_list);
void loader_add_to_layer_list(
struct loader_layer_list *list,
uint32_t prop_list_count,