Merge remote-tracking branch 'upstream/sdk-1.2.135' into HEAD
Change-Id: I54ac2aaf1099bf06593135617713729491fda9d8
diff --git a/BUILD.gn b/BUILD.gn
index 51672b8..0930931 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -13,11 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import("//build_overrides/build.gni")
import("//build_overrides/vulkan_loader.gni")
-# Fuchsia has non-upstream changes to the vulkan loader, so we don't want
-# to build it from upstream sources.
-assert(!is_fuchsia)
+if (is_fuchsia) {
+ import("//build/cpp/sdk_shared_library.gni")
+ import("//build/sdk/sdk_documentation.gni")
+}
if (!is_android) {
vulkan_undefine_configs = []
@@ -34,6 +36,12 @@
if (is_clang || !is_win) {
cflags = [ "-Wno-unused-function" ]
}
+ if (is_fuchsia) {
+ defines += [
+ "SYSCONFDIR=\"/config\"",
+ "EXTRASYSCONFDIR=\"/pkg/data\"",
+ ]
+ }
if (is_linux || is_mac) {
defines += [
"SYSCONFDIR=\"/etc\"",
@@ -66,7 +74,9 @@
}
if (!is_android) {
- if (vulkan_loader_shared) {
+ if (is_fuchsia) {
+ library_type = "sdk_shared_library"
+ } else if (vulkan_loader_shared) {
library_type = "shared_library"
} else {
library_type = "static_library"
@@ -127,13 +137,86 @@
if (is_mac) {
libs = [ "CoreFoundation.framework" ]
}
+ if (build_with_chromium) {
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ }
public_deps = [
"$vulkan_headers_dir:vulkan_headers",
]
- configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":vulkan_internal_config" ]
public_configs = [ ":vulkan_loader_config" ]
configs -= vulkan_undefine_configs
+
+ if (is_fuchsia) {
+ output_name = "vulkan"
+ category = "partner"
+
+ # The Vulkan loader's interface is defined by standard Khronos vulkan headers
+ # which can be obtained separately from the loader implementation itself.
+ no_headers = true
+
+ sources += [ "fuchsia/loader_extensions.c" ]
+
+ deps = [
+ ":dlopen_fuchsia",
+ "//zircon/public/lib/fdio",
+ ]
+
+ # TODO(MA-488) - while these shared libraries are needed by vulkan icd
+ # the app must provide them, so we add the deps here.
+ deps += [ "//zircon/public/lib/async-default" ]
+
+ libs = [ "zircon" ]
+
+ runtime_deps = [ "//zircon/public/lib/fdio:fdio_sdk" ]
+
+ # TODO(MA-488): remove this too
+ runtime_deps += [ "//zircon/public/lib/async-default:async-default_sdk" ]
+
+ # TODO(MA-488): The //zircon/public/lib/async-default dep gives us a dep
+ # on //zircon/public/lib/async, which uses the C++ standard library and
+ # is linked statically (built from source, though async-default is a
+ # prebuilt shared library). So link in the C++ standard library
+ # statically just to satisfy those references. When the async-default
+ # dep is dropped, this can change to "none" (i.e. be removed).
+ libcxx_linkage = "static"
+ }
}
}
+
+if (is_fuchsia) {
+ config("fuchsia_config") {
+ include_dirs = [ "fuchsia" ]
+ }
+
+ source_set("dlopen_fuchsia") {
+ public_configs = [ ":fuchsia_config" ]
+
+ sources = [
+ "fuchsia/dlopen_fuchsia.c",
+ "fuchsia/dlopen_fuchsia.h",
+ ]
+
+ deps = [
+ "//sdk/fidl/fuchsia.vulkan.loader:fuchsia.vulkan.loader_c_client",
+ "//zircon/public/lib/fdio",
+ ]
+ }
+
+ sdk_documentation("vulkan_license") {
+ name = "vulkan_license"
+ category = "public"
+
+ files = [
+ {
+ source = "LICENSE.txt"
+ dest = "LICENSE.vulkan"
+ },
+ ]
+ }
+}
+
+group("tests") {
+ # TODO(MA-684)
+}
diff --git a/README.fuchsia b/README.fuchsia
new file mode 100644
index 0000000..df31763
--- /dev/null
+++ b/README.fuchsia
@@ -0,0 +1,8 @@
+Name: Vulkan-Loader
+License: Apache 2.0
+License File: LICENSE.txt
+Upstream Git: https://github.com/KhronosGroup/Vulkan-Loader
+Description:
+
+The Khronos official Vulkan ICD desktop loader.
+
diff --git a/fuchsia/dlopen_fuchsia.c b/fuchsia/dlopen_fuchsia.c
new file mode 100644
index 0000000..b443185
--- /dev/null
+++ b/fuchsia/dlopen_fuchsia.c
@@ -0,0 +1,89 @@
+/*
+ *
+ * Copyright (c) 2018 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "dlopen_fuchsia.h"
+
+#include <fcntl.h>
+#include <fuchsia/vulkan/loader/c/fidl.h>
+#include <lib/fdio/io.h>
+#include <lib/fdio/directory.h>
+#include <stdio.h>
+#include <string.h>
+#include <threads.h>
+#include <zircon/dlfcn.h>
+#include <zircon/syscalls.h>
+
+static char g_error[128] = {};
+
+const char *dlerror_fuchsia(void) { return g_error; }
+
+static zx_handle_t vulkan_loader_svc = ZX_HANDLE_INVALID;
+void connect_to_vulkan_loader_svc(void) {
+ zx_handle_t svc1, svc2;
+ if (zx_channel_create(0, &svc1, &svc2) != ZX_OK) return;
+
+ if (fdio_service_connect("/svc/" fuchsia_vulkan_loader_Loader_Name, svc1) != ZX_OK) {
+ zx_handle_close(svc2);
+ return;
+ }
+
+ vulkan_loader_svc = svc2;
+}
+
+static once_flag svc_connect_once_flag = ONCE_FLAG_INIT;
+
+void *dlopen_fuchsia(const char *name, int mode, bool driver) {
+ // First try to just dlopen() from our own namespace. This will succeed for
+ // any layers that are packaged with the application, but will fail for
+ // client drivers loaded from the system.
+ void *result;
+ if (!driver) {
+ result = dlopen(name, mode);
+ if (result != NULL) return result;
+ }
+
+ // If we couldn't find the library in our own namespace, connect to the
+ // loader service to request this library.
+ call_once(&svc_connect_once_flag, connect_to_vulkan_loader_svc);
+
+ if (vulkan_loader_svc == ZX_HANDLE_INVALID) {
+ snprintf(g_error, sizeof(g_error), "libvulkan.so:dlopen_fuchsia: no connection to loader svc\n");
+ return NULL;
+ }
+
+ zx_handle_t vmo = ZX_HANDLE_INVALID;
+ zx_status_t st = fuchsia_vulkan_loader_LoaderGet(vulkan_loader_svc, name, strlen(name), &vmo);
+ // TODO: If this call fails because the channel is closed, we may want to
+ // reconnect.
+ if (st != ZX_OK) {
+ snprintf(g_error, sizeof(g_error), "libvulkan.so:dlopen_fuchsia: Get() failed: %d\n", st);
+ return NULL;
+ }
+
+ if (vmo == ZX_HANDLE_INVALID) {
+ snprintf(g_error, sizeof(g_error), "libvulkan.so:dlopen_fuchsia: Get() returned invalid vmo\n");
+ return NULL;
+ }
+
+ result = dlopen_vmo(vmo, mode);
+ zx_handle_close(vmo);
+ if (!result) {
+ snprintf(g_error, sizeof(g_error), "%s", dlerror());
+ }
+ return result;
+}
diff --git a/fuchsia/dlopen_fuchsia.h b/fuchsia/dlopen_fuchsia.h
new file mode 100644
index 0000000..a674b8d
--- /dev/null
+++ b/fuchsia/dlopen_fuchsia.h
@@ -0,0 +1,29 @@
+/*
+ *
+ * Copyright (c) 2018 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#pragma once
+
+#include <zircon/compiler.h>
+#include <stdbool.h>
+
+__BEGIN_CDECLS
+
+// If not |driver|, then the request is to load a layer.
+void *dlopen_fuchsia(const char *name, int mode, bool driver);
+const char *dlerror_fuchsia(void);
+
+__END_CDECLS
diff --git a/fuchsia/loader_extensions.c b/fuchsia/loader_extensions.c
new file mode 100644
index 0000000..16fbf9f
--- /dev/null
+++ b/fuchsia/loader_extensions.c
@@ -0,0 +1,47 @@
+/*
+ *
+ * Copyright (c) 2018 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <lib/fdio/directory.h>
+
+#include "loader.h"
+
+typedef VkResult(VKAPI_PTR *PFN_vkConnectToServiceAddr)(const char *pName, uint32_t handle);
+typedef PFN_vkVoidFunction(VKAPI_PTR *PFN_vkInitializeConnectToServiceCallbackAddr)(PFN_vkConnectToServiceAddr);
+
+VKAPI_ATTR static VkResult VKAPI_CALL loader_fdio_get_service(const char *pName, uint32_t handle) {
+ zx_status_t status = fdio_service_connect(pName, handle);
+ if (status == ZX_OK) {
+ return VK_SUCCESS;
+ } else {
+ loader_log(NULL, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, "Failed to load service %s - error %d", pName, status);
+ return VK_ERROR_INITIALIZATION_FAILED;
+ }
+}
+
+void loader_initialize_icd_services(loader_platform_dl_handle handle) {
+ PFN_vkInitializeConnectToServiceCallbackAddr fp_initialize_connect_to_service_callback_addr;
+
+ fp_initialize_connect_to_service_callback_addr =
+ loader_platform_get_proc_address(handle, "vk_icdInitializeConnectToServiceCallback");
+ if (!fp_initialize_connect_to_service_callback_addr) {
+ // ICD isn't required to expose this entrypoint.
+ return;
+ }
+
+ fp_initialize_connect_to_service_callback_addr(&loader_fdio_get_service);
+}
diff --git a/loader/generated/vk_dispatch_table_helper.h b/loader/generated/vk_dispatch_table_helper.h
index 48257af..6e3ee52 100644
--- a/loader/generated/vk_dispatch_table_helper.h
+++ b/loader/generated/vk_dispatch_table_helper.h
@@ -209,6 +209,33 @@
static VKAPI_ATTR void VKAPI_CALL StubCmdBindPipelineShaderGroupNV(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline, uint32_t groupIndex) { };
static VKAPI_ATTR VkResult VKAPI_CALL StubCreateIndirectCommandsLayoutNV(VkDevice device, const VkIndirectCommandsLayoutCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkIndirectCommandsLayoutNV* pIndirectCommandsLayout) { return VK_SUCCESS; };
static VKAPI_ATTR void VKAPI_CALL StubDestroyIndirectCommandsLayoutNV(VkDevice device, VkIndirectCommandsLayoutNV indirectCommandsLayout, const VkAllocationCallbacks* pAllocator) { };
+#ifdef VK_USE_PLATFORM_FUCHSIA
+static VKAPI_ATTR VkResult VKAPI_CALL StubCreateBufferCollectionFUCHSIA(VkDevice device, const VkBufferCollectionCreateInfoFUCHSIA* pImportInfo, const VkAllocationCallbacks* pAllocator, VkBufferCollectionFUCHSIA* pCollection) { return VK_SUCCESS; };
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+static VKAPI_ATTR VkResult VKAPI_CALL StubSetBufferCollectionConstraintsFUCHSIA(VkDevice device, VkBufferCollectionFUCHSIA collection, const VkImageCreateInfo* pImageInfo) { return VK_SUCCESS; };
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+static VKAPI_ATTR VkResult VKAPI_CALL StubSetBufferCollectionBufferConstraintsFUCHSIA(VkDevice device, VkBufferCollectionFUCHSIA collection, const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo) { return VK_SUCCESS; };
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+static VKAPI_ATTR void VKAPI_CALL StubDestroyBufferCollectionFUCHSIA(VkDevice device, VkBufferCollectionFUCHSIA collection, const VkAllocationCallbacks* pAllocator) { };
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+static VKAPI_ATTR VkResult VKAPI_CALL StubGetBufferCollectionPropertiesFUCHSIA(VkDevice device, VkBufferCollectionFUCHSIA collection, VkBufferCollectionPropertiesFUCHSIA* pProperties) { return VK_SUCCESS; };
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+static VKAPI_ATTR VkResult VKAPI_CALL StubGetMemoryZirconHandleFUCHSIA(VkDevice device, const VkMemoryGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo, zx_handle_t* pZirconHandle) { return VK_SUCCESS; };
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+static VKAPI_ATTR VkResult VKAPI_CALL StubGetMemoryZirconHandlePropertiesFUCHSIA(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, zx_handle_t ZirconHandle, VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties) { return VK_SUCCESS; };
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+static VKAPI_ATTR VkResult VKAPI_CALL StubImportSemaphoreZirconHandleFUCHSIA(VkDevice device, const VkImportSemaphoreZirconHandleInfoFUCHSIA* pImportSemaphoreZirconHandleInfo) { return VK_SUCCESS; };
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+static VKAPI_ATTR VkResult VKAPI_CALL StubGetSemaphoreZirconHandleFUCHSIA(VkDevice device, const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo, zx_handle_t* pZirconHandle) { return VK_SUCCESS; };
+#endif // VK_USE_PLATFORM_FUCHSIA
#ifdef VK_ENABLE_BETA_EXTENSIONS
static VKAPI_ATTR VkResult VKAPI_CALL StubCreateAccelerationStructureKHR(VkDevice device, const VkAccelerationStructureCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkAccelerationStructureKHR* pAccelerationStructure) { return VK_SUCCESS; };
#endif // VK_ENABLE_BETA_EXTENSIONS
@@ -753,6 +780,42 @@
if (table->CreateIndirectCommandsLayoutNV == nullptr) { table->CreateIndirectCommandsLayoutNV = (PFN_vkCreateIndirectCommandsLayoutNV)StubCreateIndirectCommandsLayoutNV; }
table->DestroyIndirectCommandsLayoutNV = (PFN_vkDestroyIndirectCommandsLayoutNV) gpa(device, "vkDestroyIndirectCommandsLayoutNV");
if (table->DestroyIndirectCommandsLayoutNV == nullptr) { table->DestroyIndirectCommandsLayoutNV = (PFN_vkDestroyIndirectCommandsLayoutNV)StubDestroyIndirectCommandsLayoutNV; }
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ table->CreateBufferCollectionFUCHSIA = (PFN_vkCreateBufferCollectionFUCHSIA) gpa(device, "vkCreateBufferCollectionFUCHSIA");
+ if (table->CreateBufferCollectionFUCHSIA == nullptr) { table->CreateBufferCollectionFUCHSIA = (PFN_vkCreateBufferCollectionFUCHSIA)StubCreateBufferCollectionFUCHSIA; }
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ table->SetBufferCollectionConstraintsFUCHSIA = (PFN_vkSetBufferCollectionConstraintsFUCHSIA) gpa(device, "vkSetBufferCollectionConstraintsFUCHSIA");
+ if (table->SetBufferCollectionConstraintsFUCHSIA == nullptr) { table->SetBufferCollectionConstraintsFUCHSIA = (PFN_vkSetBufferCollectionConstraintsFUCHSIA)StubSetBufferCollectionConstraintsFUCHSIA; }
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ table->SetBufferCollectionBufferConstraintsFUCHSIA = (PFN_vkSetBufferCollectionBufferConstraintsFUCHSIA) gpa(device, "vkSetBufferCollectionBufferConstraintsFUCHSIA");
+ if (table->SetBufferCollectionBufferConstraintsFUCHSIA == nullptr) { table->SetBufferCollectionBufferConstraintsFUCHSIA = (PFN_vkSetBufferCollectionBufferConstraintsFUCHSIA)StubSetBufferCollectionBufferConstraintsFUCHSIA; }
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ table->DestroyBufferCollectionFUCHSIA = (PFN_vkDestroyBufferCollectionFUCHSIA) gpa(device, "vkDestroyBufferCollectionFUCHSIA");
+ if (table->DestroyBufferCollectionFUCHSIA == nullptr) { table->DestroyBufferCollectionFUCHSIA = (PFN_vkDestroyBufferCollectionFUCHSIA)StubDestroyBufferCollectionFUCHSIA; }
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ table->GetBufferCollectionPropertiesFUCHSIA = (PFN_vkGetBufferCollectionPropertiesFUCHSIA) gpa(device, "vkGetBufferCollectionPropertiesFUCHSIA");
+ if (table->GetBufferCollectionPropertiesFUCHSIA == nullptr) { table->GetBufferCollectionPropertiesFUCHSIA = (PFN_vkGetBufferCollectionPropertiesFUCHSIA)StubGetBufferCollectionPropertiesFUCHSIA; }
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ table->GetMemoryZirconHandleFUCHSIA = (PFN_vkGetMemoryZirconHandleFUCHSIA) gpa(device, "vkGetMemoryZirconHandleFUCHSIA");
+ if (table->GetMemoryZirconHandleFUCHSIA == nullptr) { table->GetMemoryZirconHandleFUCHSIA = (PFN_vkGetMemoryZirconHandleFUCHSIA)StubGetMemoryZirconHandleFUCHSIA; }
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ table->GetMemoryZirconHandlePropertiesFUCHSIA = (PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA) gpa(device, "vkGetMemoryZirconHandlePropertiesFUCHSIA");
+ if (table->GetMemoryZirconHandlePropertiesFUCHSIA == nullptr) { table->GetMemoryZirconHandlePropertiesFUCHSIA = (PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA)StubGetMemoryZirconHandlePropertiesFUCHSIA; }
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ table->ImportSemaphoreZirconHandleFUCHSIA = (PFN_vkImportSemaphoreZirconHandleFUCHSIA) gpa(device, "vkImportSemaphoreZirconHandleFUCHSIA");
+ if (table->ImportSemaphoreZirconHandleFUCHSIA == nullptr) { table->ImportSemaphoreZirconHandleFUCHSIA = (PFN_vkImportSemaphoreZirconHandleFUCHSIA)StubImportSemaphoreZirconHandleFUCHSIA; }
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ table->GetSemaphoreZirconHandleFUCHSIA = (PFN_vkGetSemaphoreZirconHandleFUCHSIA) gpa(device, "vkGetSemaphoreZirconHandleFUCHSIA");
+ if (table->GetSemaphoreZirconHandleFUCHSIA == nullptr) { table->GetSemaphoreZirconHandleFUCHSIA = (PFN_vkGetSemaphoreZirconHandleFUCHSIA)StubGetSemaphoreZirconHandleFUCHSIA; }
+#endif // VK_USE_PLATFORM_FUCHSIA
#ifdef VK_ENABLE_BETA_EXTENSIONS
table->CreateAccelerationStructureKHR = (PFN_vkCreateAccelerationStructureKHR) gpa(device, "vkCreateAccelerationStructureKHR");
if (table->CreateAccelerationStructureKHR == nullptr) { table->CreateAccelerationStructureKHR = (PFN_vkCreateAccelerationStructureKHR)StubCreateAccelerationStructureKHR; }
diff --git a/loader/generated/vk_layer_dispatch_table.h b/loader/generated/vk_layer_dispatch_table.h
index e7fb222..b148e15 100644
--- a/loader/generated/vk_layer_dispatch_table.h
+++ b/loader/generated/vk_layer_dispatch_table.h
@@ -694,6 +694,39 @@
PFN_vkCreateIndirectCommandsLayoutNV CreateIndirectCommandsLayoutNV;
PFN_vkDestroyIndirectCommandsLayoutNV DestroyIndirectCommandsLayoutNV;
+ // ---- VK_FUCHSIA_buffer_collection extension commands
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ PFN_vkCreateBufferCollectionFUCHSIA CreateBufferCollectionFUCHSIA;
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ PFN_vkSetBufferCollectionConstraintsFUCHSIA SetBufferCollectionConstraintsFUCHSIA;
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ PFN_vkSetBufferCollectionBufferConstraintsFUCHSIA SetBufferCollectionBufferConstraintsFUCHSIA;
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ PFN_vkDestroyBufferCollectionFUCHSIA DestroyBufferCollectionFUCHSIA;
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ PFN_vkGetBufferCollectionPropertiesFUCHSIA GetBufferCollectionPropertiesFUCHSIA;
+#endif // VK_USE_PLATFORM_FUCHSIA
+
+ // ---- VK_FUCHSIA_external_memory extension commands
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ PFN_vkGetMemoryZirconHandleFUCHSIA GetMemoryZirconHandleFUCHSIA;
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA GetMemoryZirconHandlePropertiesFUCHSIA;
+#endif // VK_USE_PLATFORM_FUCHSIA
+
+ // ---- VK_FUCHSIA_external_semaphore extension commands
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ PFN_vkImportSemaphoreZirconHandleFUCHSIA ImportSemaphoreZirconHandleFUCHSIA;
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ PFN_vkGetSemaphoreZirconHandleFUCHSIA GetSemaphoreZirconHandleFUCHSIA;
+#endif // VK_USE_PLATFORM_FUCHSIA
+
// ---- VK_KHR_ray_tracing extension commands
#ifdef VK_ENABLE_BETA_EXTENSIONS
PFN_vkCreateAccelerationStructureKHR CreateAccelerationStructureKHR;
diff --git a/loader/generated/vk_loader_extensions.c b/loader/generated/vk_loader_extensions.c
index da298e6..b53fb3a 100644
--- a/loader/generated/vk_loader_extensions.c
+++ b/loader/generated/vk_loader_extensions.c
@@ -757,6 +757,39 @@
table->CreateIndirectCommandsLayoutNV = (PFN_vkCreateIndirectCommandsLayoutNV)gdpa(dev, "vkCreateIndirectCommandsLayoutNV");
table->DestroyIndirectCommandsLayoutNV = (PFN_vkDestroyIndirectCommandsLayoutNV)gdpa(dev, "vkDestroyIndirectCommandsLayoutNV");
+ // ---- VK_FUCHSIA_buffer_collection extension commands
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ table->CreateBufferCollectionFUCHSIA = (PFN_vkCreateBufferCollectionFUCHSIA)gdpa(dev, "vkCreateBufferCollectionFUCHSIA");
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ table->SetBufferCollectionConstraintsFUCHSIA = (PFN_vkSetBufferCollectionConstraintsFUCHSIA)gdpa(dev, "vkSetBufferCollectionConstraintsFUCHSIA");
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ table->SetBufferCollectionBufferConstraintsFUCHSIA = (PFN_vkSetBufferCollectionBufferConstraintsFUCHSIA)gdpa(dev, "vkSetBufferCollectionBufferConstraintsFUCHSIA");
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ table->DestroyBufferCollectionFUCHSIA = (PFN_vkDestroyBufferCollectionFUCHSIA)gdpa(dev, "vkDestroyBufferCollectionFUCHSIA");
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ table->GetBufferCollectionPropertiesFUCHSIA = (PFN_vkGetBufferCollectionPropertiesFUCHSIA)gdpa(dev, "vkGetBufferCollectionPropertiesFUCHSIA");
+#endif // VK_USE_PLATFORM_FUCHSIA
+
+ // ---- VK_FUCHSIA_external_memory extension commands
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ table->GetMemoryZirconHandleFUCHSIA = (PFN_vkGetMemoryZirconHandleFUCHSIA)gdpa(dev, "vkGetMemoryZirconHandleFUCHSIA");
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ table->GetMemoryZirconHandlePropertiesFUCHSIA = (PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA)gdpa(dev, "vkGetMemoryZirconHandlePropertiesFUCHSIA");
+#endif // VK_USE_PLATFORM_FUCHSIA
+
+ // ---- VK_FUCHSIA_external_semaphore extension commands
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ table->ImportSemaphoreZirconHandleFUCHSIA = (PFN_vkImportSemaphoreZirconHandleFUCHSIA)gdpa(dev, "vkImportSemaphoreZirconHandleFUCHSIA");
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ table->GetSemaphoreZirconHandleFUCHSIA = (PFN_vkGetSemaphoreZirconHandleFUCHSIA)gdpa(dev, "vkGetSemaphoreZirconHandleFUCHSIA");
+#endif // VK_USE_PLATFORM_FUCHSIA
+
// ---- VK_KHR_ray_tracing extension commands
#ifdef VK_ENABLE_BETA_EXTENSIONS
table->CreateAccelerationStructureKHR = (PFN_vkCreateAccelerationStructureKHR)gdpa(dev, "vkCreateAccelerationStructureKHR");
@@ -1484,6 +1517,39 @@
if (!strcmp(name, "CreateIndirectCommandsLayoutNV")) return (void *)table->CreateIndirectCommandsLayoutNV;
if (!strcmp(name, "DestroyIndirectCommandsLayoutNV")) return (void *)table->DestroyIndirectCommandsLayoutNV;
+ // ---- VK_FUCHSIA_buffer_collection extension commands
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ if (!strcmp(name, "CreateBufferCollectionFUCHSIA")) return (void *)table->CreateBufferCollectionFUCHSIA;
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ if (!strcmp(name, "SetBufferCollectionConstraintsFUCHSIA")) return (void *)table->SetBufferCollectionConstraintsFUCHSIA;
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ if (!strcmp(name, "SetBufferCollectionBufferConstraintsFUCHSIA")) return (void *)table->SetBufferCollectionBufferConstraintsFUCHSIA;
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ if (!strcmp(name, "DestroyBufferCollectionFUCHSIA")) return (void *)table->DestroyBufferCollectionFUCHSIA;
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ if (!strcmp(name, "GetBufferCollectionPropertiesFUCHSIA")) return (void *)table->GetBufferCollectionPropertiesFUCHSIA;
+#endif // VK_USE_PLATFORM_FUCHSIA
+
+ // ---- VK_FUCHSIA_external_memory extension commands
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ if (!strcmp(name, "GetMemoryZirconHandleFUCHSIA")) return (void *)table->GetMemoryZirconHandleFUCHSIA;
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ if (!strcmp(name, "GetMemoryZirconHandlePropertiesFUCHSIA")) return (void *)table->GetMemoryZirconHandlePropertiesFUCHSIA;
+#endif // VK_USE_PLATFORM_FUCHSIA
+
+ // ---- VK_FUCHSIA_external_semaphore extension commands
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ if (!strcmp(name, "ImportSemaphoreZirconHandleFUCHSIA")) return (void *)table->ImportSemaphoreZirconHandleFUCHSIA;
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ if (!strcmp(name, "GetSemaphoreZirconHandleFUCHSIA")) return (void *)table->GetSemaphoreZirconHandleFUCHSIA;
+#endif // VK_USE_PLATFORM_FUCHSIA
+
// ---- VK_KHR_ray_tracing extension commands
#ifdef VK_ENABLE_BETA_EXTENSIONS
if (!strcmp(name, "CreateAccelerationStructureKHR")) return (void *)table->CreateAccelerationStructureKHR;
@@ -3429,28 +3495,6 @@
}
-// ---- VK_FUCHSIA_imagepipe_surface extension trampoline/terminators
-
-#ifdef VK_USE_PLATFORM_FUCHSIA
-VKAPI_ATTR VkResult VKAPI_CALL CreateImagePipeSurfaceFUCHSIA(
- VkInstance instance,
- const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo,
- const VkAllocationCallbacks* pAllocator,
- VkSurfaceKHR* pSurface) {
-#error("Not implemented. Likely needs to be manually generated!");
- return disp->CreateImagePipeSurfaceFUCHSIA(instance, pCreateInfo, pAllocator, pSurface);
-}
-
-VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateImagePipeSurfaceFUCHSIA(
- VkInstance instance,
- const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo,
- const VkAllocationCallbacks* pAllocator,
- VkSurfaceKHR* pSurface) {
-#error("Not implemented. Likely needs to be manually generated!");
-}
-
-#endif // VK_USE_PLATFORM_FUCHSIA
-
// ---- VK_EXT_buffer_device_address extension trampoline/terminators
VKAPI_ATTR VkDeviceAddress VKAPI_CALL GetBufferDeviceAddressEXT(
@@ -3609,6 +3653,106 @@
}
+// ---- VK_FUCHSIA_buffer_collection extension trampoline/terminators
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+VKAPI_ATTR VkResult VKAPI_CALL CreateBufferCollectionFUCHSIA(
+ VkDevice device,
+ const VkBufferCollectionCreateInfoFUCHSIA* pImportInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkBufferCollectionFUCHSIA* pCollection) {
+ const VkLayerDispatchTable *disp = loader_get_dispatch(device);
+ return disp->CreateBufferCollectionFUCHSIA(device, pImportInfo, pAllocator, pCollection);
+}
+
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+VKAPI_ATTR VkResult VKAPI_CALL SetBufferCollectionConstraintsFUCHSIA(
+ VkDevice device,
+ VkBufferCollectionFUCHSIA collection,
+ const VkImageCreateInfo* pImageInfo) {
+ const VkLayerDispatchTable *disp = loader_get_dispatch(device);
+ return disp->SetBufferCollectionConstraintsFUCHSIA(device, collection, pImageInfo);
+}
+
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+VKAPI_ATTR VkResult VKAPI_CALL SetBufferCollectionBufferConstraintsFUCHSIA(
+ VkDevice device,
+ VkBufferCollectionFUCHSIA collection,
+ const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo) {
+ const VkLayerDispatchTable *disp = loader_get_dispatch(device);
+ return disp->SetBufferCollectionBufferConstraintsFUCHSIA(device, collection, pBufferConstraintsInfo);
+}
+
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+VKAPI_ATTR void VKAPI_CALL DestroyBufferCollectionFUCHSIA(
+ VkDevice device,
+ VkBufferCollectionFUCHSIA collection,
+ const VkAllocationCallbacks* pAllocator) {
+ const VkLayerDispatchTable *disp = loader_get_dispatch(device);
+ disp->DestroyBufferCollectionFUCHSIA(device, collection, pAllocator);
+}
+
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+VKAPI_ATTR VkResult VKAPI_CALL GetBufferCollectionPropertiesFUCHSIA(
+ VkDevice device,
+ VkBufferCollectionFUCHSIA collection,
+ VkBufferCollectionPropertiesFUCHSIA* pProperties) {
+ const VkLayerDispatchTable *disp = loader_get_dispatch(device);
+ return disp->GetBufferCollectionPropertiesFUCHSIA(device, collection, pProperties);
+}
+
+#endif // VK_USE_PLATFORM_FUCHSIA
+
+// ---- VK_FUCHSIA_external_memory extension trampoline/terminators
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+VKAPI_ATTR VkResult VKAPI_CALL GetMemoryZirconHandleFUCHSIA(
+ VkDevice device,
+ const VkMemoryGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo,
+ zx_handle_t* pZirconHandle) {
+ const VkLayerDispatchTable *disp = loader_get_dispatch(device);
+ return disp->GetMemoryZirconHandleFUCHSIA(device, pGetZirconHandleInfo, pZirconHandle);
+}
+
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+VKAPI_ATTR VkResult VKAPI_CALL GetMemoryZirconHandlePropertiesFUCHSIA(
+ VkDevice device,
+ VkExternalMemoryHandleTypeFlagBits handleType,
+ zx_handle_t ZirconHandle,
+ VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties) {
+ const VkLayerDispatchTable *disp = loader_get_dispatch(device);
+ return disp->GetMemoryZirconHandlePropertiesFUCHSIA(device, handleType, ZirconHandle, pMemoryZirconHandleProperties);
+}
+
+#endif // VK_USE_PLATFORM_FUCHSIA
+
+// ---- VK_FUCHSIA_external_semaphore extension trampoline/terminators
+
+#ifdef VK_USE_PLATFORM_FUCHSIA
+VKAPI_ATTR VkResult VKAPI_CALL ImportSemaphoreZirconHandleFUCHSIA(
+ VkDevice device,
+ const VkImportSemaphoreZirconHandleInfoFUCHSIA* pImportSemaphoreZirconHandleInfo) {
+ const VkLayerDispatchTable *disp = loader_get_dispatch(device);
+ return disp->ImportSemaphoreZirconHandleFUCHSIA(device, pImportSemaphoreZirconHandleInfo);
+}
+
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreZirconHandleFUCHSIA(
+ VkDevice device,
+ const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo,
+ zx_handle_t* pZirconHandle) {
+ const VkLayerDispatchTable *disp = loader_get_dispatch(device);
+ return disp->GetSemaphoreZirconHandleFUCHSIA(device, pGetZirconHandleInfo, pZirconHandle);
+}
+
+#endif // VK_USE_PLATFORM_FUCHSIA
+
// ---- VK_KHR_ray_tracing extension trampoline/terminators
#ifdef VK_ENABLE_BETA_EXTENSIONS
@@ -4640,16 +4784,6 @@
return true;
}
- // ---- VK_FUCHSIA_imagepipe_surface extension commands
-#ifdef VK_USE_PLATFORM_FUCHSIA
- if (!strcmp("vkCreateImagePipeSurfaceFUCHSIA", name)) {
- *addr = (ptr_instance->enabled_known_extensions.fuchsia_imagepipe_surface == 1)
- ? (void *)CreateImagePipeSurfaceFUCHSIA
- : NULL;
- return true;
- }
-#endif // VK_USE_PLATFORM_FUCHSIA
-
// ---- VK_EXT_buffer_device_address extension commands
if (!strcmp("vkGetBufferDeviceAddressEXT", name)) {
*addr = (void *)GetBufferDeviceAddressEXT;
@@ -4738,6 +4872,66 @@
return true;
}
+ // ---- VK_FUCHSIA_buffer_collection extension commands
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ if (!strcmp("vkCreateBufferCollectionFUCHSIA", name)) {
+ *addr = (void *)CreateBufferCollectionFUCHSIA;
+ return true;
+ }
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ if (!strcmp("vkSetBufferCollectionConstraintsFUCHSIA", name)) {
+ *addr = (void *)SetBufferCollectionConstraintsFUCHSIA;
+ return true;
+ }
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ if (!strcmp("vkSetBufferCollectionBufferConstraintsFUCHSIA", name)) {
+ *addr = (void *)SetBufferCollectionBufferConstraintsFUCHSIA;
+ return true;
+ }
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ if (!strcmp("vkDestroyBufferCollectionFUCHSIA", name)) {
+ *addr = (void *)DestroyBufferCollectionFUCHSIA;
+ return true;
+ }
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ if (!strcmp("vkGetBufferCollectionPropertiesFUCHSIA", name)) {
+ *addr = (void *)GetBufferCollectionPropertiesFUCHSIA;
+ return true;
+ }
+#endif // VK_USE_PLATFORM_FUCHSIA
+
+ // ---- VK_FUCHSIA_external_memory extension commands
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ if (!strcmp("vkGetMemoryZirconHandleFUCHSIA", name)) {
+ *addr = (void *)GetMemoryZirconHandleFUCHSIA;
+ return true;
+ }
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ if (!strcmp("vkGetMemoryZirconHandlePropertiesFUCHSIA", name)) {
+ *addr = (void *)GetMemoryZirconHandlePropertiesFUCHSIA;
+ return true;
+ }
+#endif // VK_USE_PLATFORM_FUCHSIA
+
+ // ---- VK_FUCHSIA_external_semaphore extension commands
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ if (!strcmp("vkImportSemaphoreZirconHandleFUCHSIA", name)) {
+ *addr = (void *)ImportSemaphoreZirconHandleFUCHSIA;
+ return true;
+ }
+#endif // VK_USE_PLATFORM_FUCHSIA
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ if (!strcmp("vkGetSemaphoreZirconHandleFUCHSIA", name)) {
+ *addr = (void *)GetSemaphoreZirconHandleFUCHSIA;
+ return true;
+ }
+#endif // VK_USE_PLATFORM_FUCHSIA
+
// ---- VK_KHR_ray_tracing extension commands
#ifdef VK_ENABLE_BETA_EXTENSIONS
if (!strcmp("vkCreateAccelerationStructureKHR", name)) {
@@ -4907,12 +5101,6 @@
// ---- VK_EXT_debug_utils extension commands
} else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_DEBUG_UTILS_EXTENSION_NAME)) {
ptr_instance->enabled_known_extensions.ext_debug_utils = 1;
-
- // ---- VK_FUCHSIA_imagepipe_surface extension commands
-#ifdef VK_USE_PLATFORM_FUCHSIA
- } else if (0 == strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_FUCHSIA_IMAGEPIPE_SURFACE_EXTENSION_NAME)) {
- ptr_instance->enabled_known_extensions.fuchsia_imagepipe_surface = 1;
-#endif // VK_USE_PLATFORM_FUCHSIA
}
}
}
diff --git a/loader/generated/vk_loader_extensions.h b/loader/generated/vk_loader_extensions.h
index 5fefcf6..c46cc6d 100644
--- a/loader/generated/vk_loader_extensions.h
+++ b/loader/generated/vk_loader_extensions.h
@@ -445,7 +445,6 @@
uint8_t ext_acquire_xlib_display : 1;
uint8_t ext_display_surface_counter : 1;
uint8_t ext_debug_utils : 1;
- uint8_t fuchsia_imagepipe_surface : 1;
};
uint64_t padding[4];
};
diff --git a/loader/generated/vk_object_types.h b/loader/generated/vk_object_types.h
index 7ba6b1a..57fcdd1 100644
--- a/loader/generated/vk_object_types.h
+++ b/loader/generated/vk_object_types.h
@@ -75,7 +75,8 @@
kVulkanObjectTypeAccelerationStructureKHR = 36,
kVulkanObjectTypePerformanceConfigurationINTEL = 37,
kVulkanObjectTypeIndirectCommandsLayoutNV = 38,
- kVulkanObjectTypeMax = 39,
+ kVulkanObjectTypeBufferCollectionFUCHSIA = 39,
+ kVulkanObjectTypeMax = 40,
// Aliases for backwards compatibilty of "promoted" types
kVulkanObjectTypeDescriptorUpdateTemplateKHR = kVulkanObjectTypeDescriptorUpdateTemplate,
kVulkanObjectTypeSamplerYcbcrConversionKHR = kVulkanObjectTypeSamplerYcbcrConversion,
@@ -123,6 +124,7 @@
"AccelerationStructureKHR",
"PerformanceConfigurationINTEL",
"IndirectCommandsLayoutNV",
+ "BufferCollectionFUCHSIA",
};
// Helper array to get Vulkan VK_EXT_debug_report object type enum from the internal layers version
@@ -166,6 +168,7 @@
VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR_EXT, // kVulkanObjectTypeAccelerationStructureKHR
VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, // kVulkanObjectTypePerformanceConfigurationINTEL
VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, // kVulkanObjectTypeIndirectCommandsLayoutNV
+ VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA_EXT, // kVulkanObjectTypeBufferCollectionFUCHSIA
};
// Helper array to get Official Vulkan VkObjectType enum from the internal layers version
@@ -209,6 +212,7 @@
VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR, // kVulkanObjectTypeAccelerationStructureKHR
VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL, // kVulkanObjectTypePerformanceConfigurationINTEL
VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV, // kVulkanObjectTypeIndirectCommandsLayoutNV
+ VK_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA, // kVulkanObjectTypeBufferCollectionFUCHSIA
};
// Helper function to convert from VkDebugReportObjectTypeEXT to VkObjectType
@@ -291,6 +295,8 @@
return VK_OBJECT_TYPE_VALIDATION_CACHE_EXT;
} else if (debug_report_obj == VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT) {
return VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV;
+ } else if (debug_report_obj == VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA_EXT) {
+ return VK_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA;
}
return VK_OBJECT_TYPE_UNKNOWN;
}
@@ -375,6 +381,8 @@
return VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT;
} else if (core_report_obj == VK_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV) {
return VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT;
+ } else if (core_report_obj == VK_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA) {
+ return VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA_EXT;
}
return VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT;
}
diff --git a/loader/loader.c b/loader/loader.c
index 143be13..6603665 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -234,7 +234,7 @@
}
// Environment variables
-#if defined(__linux__) || defined(__APPLE__)
+#if defined(__linux__) || defined(__APPLE__) || defined(__Fuchsia__)
static inline bool IsHighIntegrity() {
return geteuid() != getuid() || getegid() != getgid();
@@ -258,6 +258,8 @@
// This algorithm is derived from glibc code that sets an internal
// variable (__libc_enable_secure) if the process is running under setuid or setgid.
return IsHighIntegrity() ? NULL : loader_getenv(name, inst);
+#elif defined(__Fuchsia__)
+ return loader_getenv(name, inst);
#else
// Linux
#if defined(HAVE_SECURE_GETENV) && !defined(USE_UNSAFE_FILE_SEARCH)
@@ -2253,12 +2255,16 @@
// TODO implement smarter opening/closing of libraries. For now this
// function leaves libraries open and the scanned_icd_clear closes them
- handle = loader_platform_open_library(filename);
+ handle = loader_platform_open_library_or_driver(filename, true);
if (NULL == handle) {
loader_log(inst, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0, loader_platform_open_library_error(filename));
goto out;
}
+#if defined(__Fuchsia__)
+ loader_initialize_icd_services(handle);
+#endif
+
// Get and settle on an ICD interface version
fp_negotiate_icd_version = loader_platform_get_proc_address(handle, "vk_icdNegotiateLoaderICDInterfaceVersion");
@@ -3724,12 +3730,14 @@
if (xdgdatadirs == NULL) {
xdgdata_alloc = false;
}
+#if !defined(__Fuchsia__)
if (xdgconfdirs == NULL || xdgconfdirs[0] == '\0') {
xdgconfdirs = FALLBACK_CONFIG_DIRS;
}
if (xdgdatadirs == NULL || xdgdatadirs[0] == '\0') {
xdgdatadirs = FALLBACK_DATA_DIRS;
}
+#endif
// Only use HOME if XDG_DATA_HOME is not present on the system
if (NULL == xdgdatahome) {
diff --git a/loader/loader.h b/loader/loader.h
index 5e94955..e346912 100644
--- a/loader/loader.h
+++ b/loader/loader.h
@@ -333,6 +333,9 @@
#ifdef VK_USE_PLATFORM_IOS_MVK
bool wsi_ios_surface_enabled;
#endif
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ bool wsi_imagepipe_surface_enabled;
+#endif
bool wsi_headless_surface_enabled;
#if defined(VK_USE_PLATFORM_METAL_EXT)
bool wsi_metal_surface_enabled;
@@ -527,4 +530,8 @@
VkStringErrorFlags vk_string_validate(const int max_length, const char *char_array);
+#if defined(__Fuchsia__)
+void loader_initialize_icd_services(loader_platform_dl_handle handle);
+#endif
+
#endif // LOADER_H
diff --git a/loader/vk_loader_platform.h b/loader/vk_loader_platform.h
index 7824e35..2913f7e 100644
--- a/loader/vk_loader_platform.h
+++ b/loader/vk_loader_platform.h
@@ -28,10 +28,14 @@
#include <winsock2.h>
#endif // _WIN32
+#if defined(__Fuchsia__)
+#include "dlopen_fuchsia.h"
+#endif // defined(__Fuchsia__)
+
#include "vulkan/vk_platform.h"
#include "vulkan/vk_sdk_platform.h"
-#if defined(__linux__) || defined(__APPLE__)
+#if defined(__linux__) || defined(__APPLE__) || defined(__Fuchsia__)
/* Linux-specific common code: */
// Headers:
@@ -102,14 +106,27 @@
// Dynamic Loading of libraries:
typedef void *loader_platform_dl_handle;
-static inline loader_platform_dl_handle loader_platform_open_library(const char *libPath) {
+static inline loader_platform_dl_handle loader_platform_open_library_or_driver(const char *libPath, bool driver) {
+#ifdef __Fuchsia__
+ return dlopen_fuchsia(libPath, RTLD_LAZY | RTLD_LOCAL, driver);
+#else
// When loading the library, we use RTLD_LAZY so that not all symbols have to be
// resolved at this time (which improves performance). Note that if not all symbols
// can be resolved, this could cause crashes later. Use the LD_BIND_NOW environment
// variable to force all symbols to be resolved here.
return dlopen(libPath, RTLD_LAZY | RTLD_LOCAL);
+#endif
}
-static inline const char *loader_platform_open_library_error(const char *libPath) { return dlerror(); }
+static inline loader_platform_dl_handle loader_platform_open_library(const char *libPath) {
+ return loader_platform_open_library_or_driver(libPath, false);
+}
+static inline const char *loader_platform_open_library_error(const char *libPath) {
+#ifdef __Fuchsia__
+ return dlerror_fuchsia();
+#else
+ return dlerror();
+#endif
+}
static inline void loader_platform_close_library(loader_platform_dl_handle library) { dlclose(library); }
static inline void *loader_platform_get_proc_address(loader_platform_dl_handle library, const char *name) {
assert(library);
diff --git a/loader/wsi.c b/loader/wsi.c
index cb59f5f..9c6a1d5 100644
--- a/loader/wsi.c
+++ b/loader/wsi.c
@@ -61,6 +61,9 @@
#ifdef VK_USE_PLATFORM_IOS_MVK
ptr_instance->wsi_ios_surface_enabled = false;
#endif // VK_USE_PLATFORM_IOS_MVK
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ ptr_instance->wsi_imagepipe_surface_enabled = false;
+#endif // VK_USE_PLATFORM_FUCHSIA
ptr_instance->wsi_display_enabled = false;
ptr_instance->wsi_display_props2_enabled = false;
#ifdef VK_USE_PLATFORM_METAL_EXT
@@ -114,6 +117,12 @@
continue;
}
#endif // VK_USE_PLATFORM_IOS_MVK
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_FUCHSIA_IMAGEPIPE_SURFACE_EXTENSION_NAME) == 0) {
+ ptr_instance->wsi_imagepipe_surface_enabled = true;
+ continue;
+ }
+#endif // VK_USE_PLATFORM_FUCHSIA
if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_EXT_HEADLESS_SURFACE_EXTENSION_NAME) == 0) {
ptr_instance->wsi_headless_surface_enabled = true;
continue;
@@ -1806,6 +1815,86 @@
pDisplayPlaneInfo->planeIndex, &pCapabilities->capabilities);
}
+#ifdef VK_USE_PLATFORM_FUCHSIA
+
+// This is the trampoline entrypoint for CreateImagePipeSurfaceFUCHSIA
+LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateImagePipeSurfaceFUCHSIA(VkInstance instance,
+ const VkImagePipeSurfaceCreateInfoFUCHSIA *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator,
+ VkSurfaceKHR *pSurface) {
+ const VkLayerInstanceDispatchTable *disp;
+ disp = loader_get_instance_layer_dispatch(instance);
+ VkResult res;
+
+ res = disp->CreateImagePipeSurfaceFUCHSIA(instance, pCreateInfo, pAllocator, pSurface);
+ return res;
+}
+
+// This is the instance chain terminator function for CreateImagePipeSurfaceFUCHSIA
+VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateImagePipeSurfaceFUCHSIA(VkInstance instance,
+ const VkImagePipeSurfaceCreateInfoFUCHSIA *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator,
+ VkSurfaceKHR *pSurface) {
+ VkResult vkRes = VK_SUCCESS;
+ VkIcdSurface *pIcdSurface = NULL;
+ uint32_t i = 0;
+
+ // Initialize pSurface to NULL just to be safe.
+ *pSurface = VK_NULL_HANDLE;
+ // First, check to ensure the appropriate extension was enabled:
+ struct loader_instance *ptr_instance = loader_get_instance(instance);
+ if (!ptr_instance->wsi_imagepipe_surface_enabled) {
+ loader_log(ptr_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,
+ "VK_FUCHSIA_imagepipe_surface extension not enabled. "
+ "vkCreateImagePipeSurfaceFUCHSIA not executed!\n");
+ vkRes = VK_ERROR_EXTENSION_NOT_PRESENT;
+ goto out;
+ }
+
+ // Next, if so, proceed with the implementation of this function:
+ pIcdSurface =
+ AllocateIcdSurfaceStruct(ptr_instance, sizeof(pIcdSurface->imagepipe_surf.base), sizeof(pIcdSurface->imagepipe_surf));
+ if (pIcdSurface == NULL) {
+ vkRes = VK_ERROR_OUT_OF_HOST_MEMORY;
+ goto out;
+ }
+
+ pIcdSurface->imagepipe_surf.base.platform = VK_ICD_WSI_PLATFORM_FUCHSIA;
+
+ // Loop through each ICD and determine if they need to create a surface
+ for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ if (icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) {
+ if (NULL != icd_term->dispatch.CreateImagePipeSurfaceFUCHSIA) {
+ vkRes = icd_term->dispatch.CreateImagePipeSurfaceFUCHSIA(icd_term->instance, pCreateInfo, pAllocator,
+ &pIcdSurface->real_icd_surfaces[i]);
+ if (VK_SUCCESS != vkRes) {
+ goto out;
+ }
+ }
+ }
+ }
+
+ *pSurface = (VkSurfaceKHR)(pIcdSurface);
+
+out:
+
+ if (VK_SUCCESS != vkRes && NULL != pIcdSurface) {
+ if (NULL != pIcdSurface->real_icd_surfaces) {
+ i = 0;
+ for (struct loader_icd_term *icd_term = ptr_instance->icd_terms; icd_term != NULL; icd_term = icd_term->next, i++) {
+ if ((VkSurfaceKHR)NULL != pIcdSurface->real_icd_surfaces[i] && NULL != icd_term->dispatch.DestroySurfaceKHR) {
+ icd_term->dispatch.DestroySurfaceKHR(icd_term->instance, pIcdSurface->real_icd_surfaces[i], pAllocator);
+ }
+ }
+ loader_instance_heap_free(ptr_instance, pIcdSurface->real_icd_surfaces);
+ }
+ loader_instance_heap_free(ptr_instance, pIcdSurface);
+ }
+
+ return vkRes;
+}
+#endif // VK_USE_PLATFORM_FUCHSIA
+
LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL
vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo,
VkSurfaceCapabilities2KHR *pSurfaceCapabilities) {
@@ -2119,6 +2208,15 @@
return true;
}
#endif // VK_USE_PLATFORM_IOS_MVK
+#ifdef VK_USE_PLATFORM_FUCHSIA
+
+ // Functions for the VK_FUCHSIA_imagepipe_surface extension:
+ if (!strcmp("vkCreateImagePipeSurfaceFUCHSIA", name)) {
+ *addr = ptr_instance->wsi_imagepipe_surface_enabled ? (void *)vkCreateImagePipeSurfaceFUCHSIA : NULL;
+ return true;
+ }
+
+#endif // VK_USE_PLATFORM_FUCHSIA
// Functions for the VK_EXT_headless_surface extension:
if (!strcmp("vkCreateHeadlessSurfaceEXT", name)) {
diff --git a/loader/wsi.h b/loader/wsi.h
index 314c983..c7e6eb0 100644
--- a/loader/wsi.h
+++ b/loader/wsi.h
@@ -42,6 +42,9 @@
#ifdef VK_USE_PLATFORM_MACOS_MVK
VkIcdSurfaceMacOS macos_surf;
#endif // VK_USE_PLATFORM_MACOS_MVK
+#ifdef VK_USE_PLATFORM_FUCHSIA
+ VkIcdSurfaceImagePipe imagepipe_surf;
+#endif // VK_USE_PLATFORM_FUCHSIA
#ifdef VK_USE_PLATFORM_METAL_EXT
VkIcdSurfaceMetal metal_surf;
#endif // VK_USE_PLATFORM_METAL_EXT
@@ -180,6 +183,10 @@
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetDisplayPlaneCapabilities2KHR(VkPhysicalDevice physicalDevice,
const VkDisplayPlaneInfo2KHR *pDisplayPlaneInfo,
VkDisplayPlaneCapabilities2KHR *pCapabilities);
+#ifdef VK_USE_PLATFORM_FUCHSIA
+VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateImagePipeSurfaceFUCHSIA(VkInstance instance, const VkImagePipeSurfaceCreateInfoFUCHSIA *pCreateInfo,
+ const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface);
+#endif
VKAPI_ATTR VkResult VKAPI_CALL terminator_GetPhysicalDeviceSurfaceCapabilities2KHR(
VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo,
diff --git a/scripts/loader_extension_generator.py b/scripts/loader_extension_generator.py
index a241d43..e83cbb4 100644
--- a/scripts/loader_extension_generator.py
+++ b/scripts/loader_extension_generator.py
@@ -41,6 +41,7 @@
'VK_KHR_swapchain',
'VK_KHR_display_swapchain',
'VK_KHR_get_display_properties2',
+ 'VK_FUCHSIA_imagepipe_surface',
'VK_KHR_get_surface_capabilities2']
ADD_INST_CMDS = ['vkCreateInstance',
diff --git a/vulkan.symbols.api b/vulkan.symbols.api
new file mode 100644
index 0000000..2291efa
--- /dev/null
+++ b/vulkan.symbols.api
@@ -0,0 +1,192 @@
+vkAcquireNextImage2KHR
+vkAcquireNextImageKHR
+vkAllocateCommandBuffers
+vkAllocateDescriptorSets
+vkAllocateMemory
+vkBeginCommandBuffer
+vkBindBufferMemory
+vkBindBufferMemory2
+vkBindImageMemory
+vkBindImageMemory2
+vkCmdBeginQuery
+vkCmdBeginRenderPass
+vkCmdBindDescriptorSets
+vkCmdBindIndexBuffer
+vkCmdBindPipeline
+vkCmdBindVertexBuffers
+vkCmdBlitImage
+vkCmdClearAttachments
+vkCmdClearColorImage
+vkCmdClearDepthStencilImage
+vkCmdCopyBuffer
+vkCmdCopyBufferToImage
+vkCmdCopyImage
+vkCmdCopyImageToBuffer
+vkCmdCopyQueryPoolResults
+vkCmdDispatch
+vkCmdDispatchBase
+vkCmdDispatchIndirect
+vkCmdDraw
+vkCmdDrawIndexed
+vkCmdDrawIndexedIndirect
+vkCmdDrawIndirect
+vkCmdEndQuery
+vkCmdEndRenderPass
+vkCmdExecuteCommands
+vkCmdFillBuffer
+vkCmdNextSubpass
+vkCmdPipelineBarrier
+vkCmdPushConstants
+vkCmdResetEvent
+vkCmdResetQueryPool
+vkCmdResolveImage
+vkCmdSetBlendConstants
+vkCmdSetDepthBias
+vkCmdSetDepthBounds
+vkCmdSetDeviceMask
+vkCmdSetEvent
+vkCmdSetLineWidth
+vkCmdSetScissor
+vkCmdSetStencilCompareMask
+vkCmdSetStencilReference
+vkCmdSetStencilWriteMask
+vkCmdSetViewport
+vkCmdUpdateBuffer
+vkCmdWaitEvents
+vkCmdWriteTimestamp
+vkCreateBuffer
+vkCreateBufferView
+vkCreateCommandPool
+vkCreateComputePipelines
+vkCreateDescriptorPool
+vkCreateDescriptorSetLayout
+vkCreateDescriptorUpdateTemplate
+vkCreateDevice
+vkCreateDisplayModeKHR
+vkCreateDisplayPlaneSurfaceKHR
+vkCreateEvent
+vkCreateFence
+vkCreateFramebuffer
+vkCreateGraphicsPipelines
+vkCreateImage
+vkCreateImagePipeSurfaceFUCHSIA
+vkCreateImageView
+vkCreateInstance
+vkCreatePipelineCache
+vkCreatePipelineLayout
+vkCreateQueryPool
+vkCreateRenderPass
+vkCreateSampler
+vkCreateSamplerYcbcrConversion
+vkCreateSemaphore
+vkCreateShaderModule
+vkCreateSharedSwapchainsKHR
+vkCreateSwapchainKHR
+vkDestroyBuffer
+vkDestroyBufferView
+vkDestroyCommandPool
+vkDestroyDescriptorPool
+vkDestroyDescriptorSetLayout
+vkDestroyDescriptorUpdateTemplate
+vkDestroyDevice
+vkDestroyEvent
+vkDestroyFence
+vkDestroyFramebuffer
+vkDestroyImage
+vkDestroyImageView
+vkDestroyInstance
+vkDestroyPipeline
+vkDestroyPipelineCache
+vkDestroyPipelineLayout
+vkDestroyQueryPool
+vkDestroyRenderPass
+vkDestroySampler
+vkDestroySamplerYcbcrConversion
+vkDestroySemaphore
+vkDestroyShaderModule
+vkDestroySurfaceKHR
+vkDestroySwapchainKHR
+vkDeviceWaitIdle
+vkEndCommandBuffer
+vkEnumerateDeviceExtensionProperties
+vkEnumerateDeviceLayerProperties
+vkEnumerateInstanceExtensionProperties
+vkEnumerateInstanceLayerProperties
+vkEnumerateInstanceVersion
+vkEnumeratePhysicalDeviceGroups
+vkEnumeratePhysicalDevices
+vkFlushMappedMemoryRanges
+vkFreeCommandBuffers
+vkFreeDescriptorSets
+vkFreeMemory
+vkGetBufferMemoryRequirements
+vkGetBufferMemoryRequirements2
+vkGetDescriptorSetLayoutSupport
+vkGetDeviceGroupPeerMemoryFeatures
+vkGetDeviceGroupPresentCapabilitiesKHR
+vkGetDeviceGroupSurfacePresentModesKHR
+vkGetDeviceMemoryCommitment
+vkGetDeviceProcAddr
+vkGetDeviceQueue
+vkGetDeviceQueue2
+vkGetDisplayModeProperties2KHR
+vkGetDisplayModePropertiesKHR
+vkGetDisplayPlaneCapabilities2KHR
+vkGetDisplayPlaneCapabilitiesKHR
+vkGetDisplayPlaneSupportedDisplaysKHR
+vkGetEventStatus
+vkGetFenceStatus
+vkGetImageMemoryRequirements
+vkGetImageMemoryRequirements2
+vkGetImageSparseMemoryRequirements
+vkGetImageSparseMemoryRequirements2
+vkGetImageSubresourceLayout
+vkGetInstanceProcAddr
+vkGetPhysicalDeviceDisplayPlaneProperties2KHR
+vkGetPhysicalDeviceDisplayPlanePropertiesKHR
+vkGetPhysicalDeviceDisplayProperties2KHR
+vkGetPhysicalDeviceDisplayPropertiesKHR
+vkGetPhysicalDeviceExternalBufferProperties
+vkGetPhysicalDeviceExternalFenceProperties
+vkGetPhysicalDeviceExternalSemaphoreProperties
+vkGetPhysicalDeviceFeatures
+vkGetPhysicalDeviceFeatures2
+vkGetPhysicalDeviceFormatProperties
+vkGetPhysicalDeviceFormatProperties2
+vkGetPhysicalDeviceImageFormatProperties
+vkGetPhysicalDeviceImageFormatProperties2
+vkGetPhysicalDeviceMemoryProperties
+vkGetPhysicalDeviceMemoryProperties2
+vkGetPhysicalDevicePresentRectanglesKHR
+vkGetPhysicalDeviceProperties
+vkGetPhysicalDeviceProperties2
+vkGetPhysicalDeviceQueueFamilyProperties
+vkGetPhysicalDeviceQueueFamilyProperties2
+vkGetPhysicalDeviceSparseImageFormatProperties
+vkGetPhysicalDeviceSparseImageFormatProperties2
+vkGetPhysicalDeviceSurfaceCapabilitiesKHR
+vkGetPhysicalDeviceSurfaceFormatsKHR
+vkGetPhysicalDeviceSurfacePresentModesKHR
+vkGetPhysicalDeviceSurfaceSupportKHR
+vkGetPipelineCacheData
+vkGetQueryPoolResults
+vkGetRenderAreaGranularity
+vkGetSwapchainImagesKHR
+vkInvalidateMappedMemoryRanges
+vkMapMemory
+vkMergePipelineCaches
+vkQueueBindSparse
+vkQueuePresentKHR
+vkQueueSubmit
+vkQueueWaitIdle
+vkResetCommandBuffer
+vkResetCommandPool
+vkResetDescriptorPool
+vkResetEvent
+vkResetFences
+vkSetEvent
+vkTrimCommandPool
+vkUnmapMemory
+vkUpdateDescriptorSetWithTemplate
+vkUpdateDescriptorSets
+vkWaitForFences