aboutsummaryrefslogtreecommitdiff
path: root/loader/loader.h
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <courtney@LunarG.com>2015-06-07 17:28:17 -0600
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-06-18 10:18:20 -0600
commitfd21d36c9c2eb1a207ce706ea8cb5ad55d8ef3ac (patch)
tree816f03587b704e6b03b1ab04c2c50044abb68f67 /loader/loader.h
parent8b9459466c3824e563d84baf129d1456cf118139 (diff)
downloadusermoji-fd21d36c9c2eb1a207ce706ea8cb5ad55d8ef3ac.tar.xz
loader: Only allow layer in chain once
If an application were to specify a "Validatio" layer and the environment specified a ParamChecker layer it was possible to load the same layer twice in one chain. Layers don't like that can only be referenced once and that's all they need to support multiple extensions from the one layer. This patch adds an alias pointer so that when putting together the lists of available extensions the loader can keep track of multiple extensions that are servied by the same library. Also now create specific activated_layers_list that contains only the list of layers that need to be activated.
Diffstat (limited to 'loader/loader.h')
-rw-r--r--loader/loader.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/loader/loader.h b/loader/loader.h
index e2befdc4..0e62ec6e 100644
--- a/loader/loader.h
+++ b/loader/loader.h
@@ -43,6 +43,7 @@
# define LOADER_EXPORT
#endif
+#define MAX_EXTENSION_NAME_SIZE 63
#define MAX_LAYER_LIBRARIES 64
#define MAX_GPUS_FOR_LAYER 16
@@ -56,6 +57,18 @@ struct loader_extension_property {
VkExtensionProperties info;
const char *lib_name;
enum extension_origin origin;
+ // An extension library can export the same extension
+ // under different names. Handy to provide a "grouping"
+ // such as Validation. However, the loader requires
+ // that a layer be included only once in a chain.
+ // During layer scanning the loader will check if
+ // the vkGet*ProcAddr is the same as an existing extension
+ // If so, it will link them together via the alias pointer.
+ // At initialization time we'll follow the alias pointer
+ // to the "base" extension and then use that extension
+ // internally to ensure we reject duplicates
+ char get_extension_info_name[MAX_EXTENSION_NAME_SIZE+1];
+ struct loader_extension_property *alias;
bool hosted; // does the extension reside in one driver/layer
};
@@ -189,6 +202,7 @@ struct loader_instance {
struct loader_msg_callback_map_entry *icd_msg_callback_map;
struct loader_extension_list enabled_instance_extensions;
+ struct loader_extension_list activated_layer_list;
uint32_t app_extension_count;
VkExtensionProperties *app_extension_props;