aboutsummaryrefslogtreecommitdiff
path: root/loader/loader.h
diff options
context:
space:
mode:
authorMark Young <marky@lunarg.com>2017-05-04 12:16:35 -0600
committerMark Young <marky@lunarg.com>2017-05-09 11:01:03 -0600
commitc5bd152da9aebd7b3a073bddbdf78dcd7dce5a86 (patch)
treedd0a217a46d238d5570fa31e8c802a0ed0cb6278 /loader/loader.h
parent3d876c1544ba6325720a64c248e8eb0214e55d6e (diff)
downloadusermoji-c5bd152da9aebd7b3a073bddbdf78dcd7dce5a86.tar.xz
loader: Fix layer Enumerate bug
This fixes a bug found by Timothee Besset regarding calling vkEnumerateDeviceLayerProperties when no layers are present. This resulted in a negative number being filled into a uint32_t which caused an invalid number of layers to be returned. Now that we have meta-layers implemented instead of hard-coded, I created two lists: an application provided list of layers, and an expanded list of layers (where meta-layers are broken up into their component layers). The former is used when working with the enumerate calls, but the later is used internally for final layer activation. Change-Id: If723fdfb5acb1dc57923282d2c641c582870ad1c
Diffstat (limited to 'loader/loader.h')
-rw-r--r--loader/loader.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/loader/loader.h b/loader/loader.h
index 28390753..2c65923d 100644
--- a/loader/loader.h
+++ b/loader/loader.h
@@ -180,7 +180,13 @@ struct loader_device {
VkDevice icd_device; // device object from the icd
struct loader_physical_device_term *phys_dev_term;
- struct loader_layer_list activated_layer_list;
+ // List of activated layers.
+ // app_ is the version based on exactly what the application asked for.
+ // This is what must be returned to the application on Enumerate calls.
+ // expanded_ is the version based on expanding meta-layers into their
+ // individual component layers. This is what is used internally.
+ struct loader_layer_list app_activated_layer_list;
+ struct loader_layer_list expanded_activated_layer_list;
VkAllocationCallbacks alloc_callbacks;
@@ -250,7 +256,15 @@ struct loader_instance {
struct loader_msg_callback_map_entry *icd_msg_callback_map;
struct loader_layer_list instance_layer_list;
- struct loader_layer_list activated_layer_list;
+
+ // List of activated layers.
+ // app_ is the version based on exactly what the application asked for.
+ // This is what must be returned to the application on Enumerate calls.
+ // expanded_ is the version based on expanding meta-layers into their
+ // individual component layers. This is what is used internally.
+ struct loader_layer_list app_activated_layer_list;
+ struct loader_layer_list expanded_activated_layer_list;
+
VkInstance instance; // layers/ICD instance returned to trampoline
struct loader_extension_list ext_list; // icds and loaders extensions
@@ -420,7 +434,8 @@ bool loader_find_layer_name_array(const char *name, uint32_t layer_count, const
VkResult loader_add_to_layer_list(const struct loader_instance *inst, struct loader_layer_list *list, uint32_t prop_list_count,
const struct loader_layer_properties *props);
void loader_find_layer_name_add_list(const struct loader_instance *inst, const char *name, const enum layer_type_flags type_flags,
- const struct loader_layer_list *search_list, struct loader_layer_list *found_list);
+ const struct loader_layer_list *source_list, struct loader_layer_list *target_list,
+ struct loader_layer_list *expanded_target_list);
void loader_scanned_icd_clear(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list);
VkResult loader_icd_scan(const struct loader_instance *inst, struct loader_icd_tramp_list *icd_tramp_list);
void loader_layer_scan(const struct loader_instance *inst, struct loader_layer_list *instance_layers);