Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loader: Support latest Fuchsia build #1660

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gnoliyil
Copy link
Contributor

This change merges the Fuchsia-forked Vulkan-Loader branch into the upstream. Most of the changes were previously authored and reviewed by @jbauman42 (left Google) and @cdotstout .

Since last update (#478), there has been significant changes to the way for Vulkan Loader to get manifests and the way for Vulkan ICDs to get I/O access to GPU devices. Also, Fuchsia has completely dropped C bindings for the FIDL API which dlopen_fuchsia.c uses.

This change makes the following changes:

  • Add loader_extensions_fuchsia.{cc,h}. This allows the Vulkan Loader to provide a way to allow I/O to GPU devices to the ICDs it opens.

    The extended ICD API is defined in Fuchsia RFC-205: Vulkan Loader and it's implemented on ICDs like Fuchsia's Intel Mesa ICD.

  • Access data and manifest files from manifest file system FD:

    The Fuchsia Vulkan loader service provides manifests using a service-provided virtual file system. It creates these filesystems based on the contents of multiple ICD packages and services it receives through devfs. As a result, they must be constructed using a filesystem serving library and don't reflect anything on-disk (see Fuchsia RFC-205 Section "Filesystem serving" for details).

    The service-provided file system can be only opened as an FD using Fuchsia's FDIO library. Thus, in order to read manifest files located in a directory opened as an FD, we need to add a parent_dir_fd param to the functions that read files, including loader_get_json and add_data_files.

  • Migrated to the C++ FIDL bindings.

    The old C bindings are not supported anymore and have been deleted from the Fuchsia tree. This change migrates dlopen_fuchsia to use the C++ wire bindings which is part of the Fuchsia SDK.

Test: libvulkan builds on Fuchsia with the changes above.
Bug: https://fxbug.dev/378964821

@ci-tester-lunarg
Copy link

Author gnoliyil not on autobuild list. Waiting for curator authorization before starting CI build.

1 similar comment
@ci-tester-lunarg
Copy link

Author gnoliyil not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg
Copy link

Author gnoliyil not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg
Copy link

Author gnoliyil not on autobuild list. Waiting for curator authorization before starting CI build.

1 similar comment
@ci-tester-lunarg
Copy link

Author gnoliyil not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg
Copy link

Author gnoliyil not on autobuild list. Waiting for curator authorization before starting CI build.

1 similar comment
@ci-tester-lunarg
Copy link

Author gnoliyil not on autobuild list. Waiting for curator authorization before starting CI build.

This change merges the Fuchsia-forked Vulkan-Loader branch into
the upstream.

Since last update (KhronosGroup#478), there has been significant changes to
the way for Vulkan Loader to get manifests and the way for Vulkan
ICDs to get I/O access to GPU devices. Also, Fuchsia has completely
dropped C bindings for the FIDL API which `dlopen_fuchsia.c` uses.

This change makes the following changes:

* Add `loader_extensions_fuchsia.{cc,h}`. This allows the Vulkan
  Loader to provide a way to allow I/O to GPU devices to the ICDs
  it opens.

  The extended ICD API is defined in https://fuchsia.dev/fuchsia-src/
  contribute/governance/rfcs/0205_vulkan_loader and it's implemented
  on ICDs like Fuchsia's Intel Mesa ICD:
  https://fuchsia.googlesource.com/third_party/mesa/+/main/src/intel/
  vulkan/anv_magma.c

* Access data and manifest files from manifest file system FD:

  The Fuchsia Vulkan loader service provides manifests using a
  service-provided virtual file system. It creates these filesystems
  based on the contents of multiple ICD packages and services it
  receives through devfs. As a result, they must be constructed
  using a filesystem serving library and don't reflect anything
  on-disk (see https://fuchsia.dev/fuchsia-src/contribute/governance/
  rfcs/0205_vulkan_loader#filesystem_serving for details).

  The service-provided file system can be only opened as an FD using
  Fuchsia's FDIO (https://fuchsia.googlesource.com/fuchsia/+/main/sdk/
  lib/fdio) library. Thus, in order to read manifest files located
  in a directory opened as an FD, we need to add a `parent_dir_fd`
  param to the functions that read files, including `loader_get_json`
  and `add_data_files`.

* Migrated to the C++ FIDL bindings.

  The old C bindings are not supported anymore and have been deleted
  from the Fuchsia tree. This change migrates `dlopen_fuchsia` to use
  the C++ wire bindings (https://fuchsia.dev/fuchsia-src/reference/
  fidl/bindings/cpp-bindings) which is part of the Fuchsia SDK.

Test: libvulkan builds on Fuchsia with the changes above.
Bug: https://fxbug.dev/378964821

Change-Id: I2af9f677d706d07193aecd2dcc4640ec602b138f
@ci-tester-lunarg
Copy link

Author gnoliyil not on autobuild list. Waiting for curator authorization before starting CI build.

1 similar comment
@ci-tester-lunarg
Copy link

Author gnoliyil not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 377418.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2924 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2924 passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants