summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Young <marky@lunarg.com>2017-03-29 13:39:27 -0600
committerMark Young <marky@lunarg.com>2017-04-07 09:08:22 -0600
commit3cc02e191b679cd2417f95a92b701cd6690f11c4 (patch)
tree0f5c4ac09921d1b7a1e6fa38606aeaee2b50d166
parent5ce9cedd1809b095fa0cac22c2eea4f65c2456aa (diff)
loader: Fix loader and layer negotiation
Resolve missing struct sType as well as extern of vkNegotiateLoaderAndLayerInterface as a C function. Finally, bump up the JSON file version so it looks for the negotiate function. Change-Id: I7fd4784fce6cbd0c303f7b2bb354542e4b16b1df
-rw-r--r--include/vulkan/vk_layer.h9
-rw-r--r--layers/linux/VkLayer_core_validation.json2
-rw-r--r--layers/linux/VkLayer_object_tracker.json2
-rw-r--r--layers/linux/VkLayer_parameter_validation.json2
-rw-r--r--layers/linux/VkLayer_swapchain.json2
-rw-r--r--layers/linux/VkLayer_threading.json2
-rw-r--r--layers/linux/VkLayer_unique_objects.json2
-rw-r--r--layers/windows/VkLayer_core_validation.json2
-rw-r--r--layers/windows/VkLayer_object_tracker.json2
-rw-r--r--layers/windows/VkLayer_parameter_validation.json2
-rw-r--r--layers/windows/VkLayer_swapchain.json2
-rw-r--r--layers/windows/VkLayer_threading.json2
-rw-r--r--layers/windows/VkLayer_unique_objects.json2
-rw-r--r--loader/loader.c3
14 files changed, 22 insertions, 14 deletions
diff --git a/include/vulkan/vk_layer.h b/include/vulkan/vk_layer.h
index 4a502a33..5458ff2b 100644
--- a/include/vulkan/vk_layer.h
+++ b/include/vulkan/vk_layer.h
@@ -132,3 +132,12 @@ typedef struct {
} u;
} VkLayerDeviceCreateInfo;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+VKAPI_ATTR VkResult VKAPI_CALL vkNegotiateLoaderLayerInterfaceVersion(VkNegotiateLayerInterface *pVersionStruct);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/layers/linux/VkLayer_core_validation.json b/layers/linux/VkLayer_core_validation.json
index 8788bda0..7e36ecad 100644
--- a/layers/linux/VkLayer_core_validation.json
+++ b/layers/linux/VkLayer_core_validation.json
@@ -1,5 +1,5 @@
{
- "file_format_version" : "1.0.0",
+ "file_format_version" : "1.1.0",
"layer" : {
"name": "VK_LAYER_LUNARG_core_validation",
"type": "GLOBAL",
diff --git a/layers/linux/VkLayer_object_tracker.json b/layers/linux/VkLayer_object_tracker.json
index f4c88a4e..db0bae9d 100644
--- a/layers/linux/VkLayer_object_tracker.json
+++ b/layers/linux/VkLayer_object_tracker.json
@@ -1,5 +1,5 @@
{
- "file_format_version" : "1.0.0",
+ "file_format_version" : "1.1.0",
"layer" : {
"name": "VK_LAYER_LUNARG_object_tracker",
"type": "GLOBAL",
diff --git a/layers/linux/VkLayer_parameter_validation.json b/layers/linux/VkLayer_parameter_validation.json
index cd5d40e8..0b6cd34b 100644
--- a/layers/linux/VkLayer_parameter_validation.json
+++ b/layers/linux/VkLayer_parameter_validation.json
@@ -1,5 +1,5 @@
{
- "file_format_version" : "1.0.0",
+ "file_format_version" : "1.1.0",
"layer" : {
"name": "VK_LAYER_LUNARG_parameter_validation",
"type": "GLOBAL",
diff --git a/layers/linux/VkLayer_swapchain.json b/layers/linux/VkLayer_swapchain.json
index 41cdc641..2d62dd8e 100644
--- a/layers/linux/VkLayer_swapchain.json
+++ b/layers/linux/VkLayer_swapchain.json
@@ -1,5 +1,5 @@
{
- "file_format_version" : "1.0.0",
+ "file_format_version" : "1.1.0",
"layer" : {
"name": "VK_LAYER_LUNARG_swapchain",
"type": "GLOBAL",
diff --git a/layers/linux/VkLayer_threading.json b/layers/linux/VkLayer_threading.json
index 8d4b590b..b7701a9a 100644
--- a/layers/linux/VkLayer_threading.json
+++ b/layers/linux/VkLayer_threading.json
@@ -1,5 +1,5 @@
{
- "file_format_version" : "1.0.0",
+ "file_format_version" : "1.1.0",
"layer" : {
"name": "VK_LAYER_GOOGLE_threading",
"type": "GLOBAL",
diff --git a/layers/linux/VkLayer_unique_objects.json b/layers/linux/VkLayer_unique_objects.json
index 368766b6..11be2a36 100644
--- a/layers/linux/VkLayer_unique_objects.json
+++ b/layers/linux/VkLayer_unique_objects.json
@@ -1,5 +1,5 @@
{
- "file_format_version" : "1.0.0",
+ "file_format_version" : "1.1.0",
"layer" : {
"name": "VK_LAYER_GOOGLE_unique_objects",
"type": "GLOBAL",
diff --git a/layers/windows/VkLayer_core_validation.json b/layers/windows/VkLayer_core_validation.json
index 37e57a5d..012cb592 100644
--- a/layers/windows/VkLayer_core_validation.json
+++ b/layers/windows/VkLayer_core_validation.json
@@ -1,5 +1,5 @@
{
- "file_format_version" : "1.0.0",
+ "file_format_version" : "1.1.0",
"layer" : {
"name": "VK_LAYER_LUNARG_core_validation",
"type": "GLOBAL",
diff --git a/layers/windows/VkLayer_object_tracker.json b/layers/windows/VkLayer_object_tracker.json
index fc8dfd2a..888fc012 100644
--- a/layers/windows/VkLayer_object_tracker.json
+++ b/layers/windows/VkLayer_object_tracker.json
@@ -1,5 +1,5 @@
{
- "file_format_version" : "1.0.0",
+ "file_format_version" : "1.1.0",
"layer" : {
"name": "VK_LAYER_LUNARG_object_tracker",
"type": "GLOBAL",
diff --git a/layers/windows/VkLayer_parameter_validation.json b/layers/windows/VkLayer_parameter_validation.json
index 21bcb03b..5b841d27 100644
--- a/layers/windows/VkLayer_parameter_validation.json
+++ b/layers/windows/VkLayer_parameter_validation.json
@@ -1,5 +1,5 @@
{
- "file_format_version" : "1.0.0",
+ "file_format_version" : "1.1.0",
"layer" : {
"name": "VK_LAYER_LUNARG_parameter_validation",
"type": "GLOBAL",
diff --git a/layers/windows/VkLayer_swapchain.json b/layers/windows/VkLayer_swapchain.json
index 34e1fdeb..1c2a40e4 100644
--- a/layers/windows/VkLayer_swapchain.json
+++ b/layers/windows/VkLayer_swapchain.json
@@ -1,5 +1,5 @@
{
- "file_format_version" : "1.0.0",
+ "file_format_version" : "1.1.0",
"layer" : {
"name": "VK_LAYER_LUNARG_swapchain",
"type": "GLOBAL",
diff --git a/layers/windows/VkLayer_threading.json b/layers/windows/VkLayer_threading.json
index 7e531a00..616f94f6 100644
--- a/layers/windows/VkLayer_threading.json
+++ b/layers/windows/VkLayer_threading.json
@@ -1,5 +1,5 @@
{
- "file_format_version" : "1.0.0",
+ "file_format_version" : "1.1.0",
"layer" : {
"name": "VK_LAYER_GOOGLE_threading",
"type": "GLOBAL",
diff --git a/layers/windows/VkLayer_unique_objects.json b/layers/windows/VkLayer_unique_objects.json
index 319a48c9..96fdfab1 100644
--- a/layers/windows/VkLayer_unique_objects.json
+++ b/layers/windows/VkLayer_unique_objects.json
@@ -1,5 +1,5 @@
{
- "file_format_version" : "1.0.0",
+ "file_format_version" : "1.1.0",
"layer" : {
"name": "VK_LAYER_GOOGLE_unique_objects",
"type": "GLOBAL",
diff --git a/loader/loader.c b/loader/loader.c
index 4a47c75f..634395ee 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -3786,8 +3786,7 @@ VkResult loader_enable_instance_layers(struct loader_instance *inst, const VkIns
bool loader_get_layer_interface_version(PFN_vkNegotiateLoaderLayerInterfaceVersion fp_negotiate_layer_version,
VkNegotiateLayerInterface *interface_struct) {
memset(interface_struct, 0, sizeof(VkNegotiateLayerInterface));
-
- // Base assumption is that all layers are version 1 at least.
+ interface_struct->sType = LAYER_NEGOTIATE_INTERFACE_STRUCT;
interface_struct->loaderLayerInterfaceVersion = 1;
if (fp_negotiate_layer_version != NULL) {