Skip to content

Is there a way to access raw handles for components? #3698

Description

@jdu

Short info header:

  • GFX version: 0.6.0+
  • OS: All
  • GPU: All

Is there way to expose the raw handle for things like the Device in order "shim" libraries into gfx-rs?

For example the skulpin project using rafx, can get a raw handle to instance, device, etc.. to pass into skia-safe to bind to a skia BackendContext. You can see how skulpin does this here https://github.com/aclysma/skulpin/blob/master/skulpin-renderer/src/skia_support.rs#L48 with rafx.

Is there a way to get a passable handle from gfx-rs to perform something similar in order to allow shimming of skia into the gfx-backend-* I've looked through the docs a fair bit and tried a few different things, but i'm coming up empty-handed to see how I could achieve this.

Activity

  1. kvark commented on Mar 25, 2021

    @kvark
    Member

    There is no portable way to get the raw handles off gfx-rs objects, since there isn't always 1:1 mapping to anything under the API. Instead, each backend can expose its own raw APIs as needed. For example, Vulkan Instance could make the inner here public:

    inner: ash::Instance,

    If you make a list of things you'd need exposed, we can make sure they are available.

  2. jdu commented on Mar 25, 2021

    @jdu
    Author

    I'll have a look at what exactly needs to be made public and see if I can come up with a concrete list based on the different backends. I can do PRs to the individual backends to mark the items public if that's easier than dumping a list here and you can approve/reject depending on whether it aligns with the project.

  3. kvark commented on Mar 25, 2021

    @kvark
    Member

    The PRs are definitely preferred and much appreciated. Thank you!

  4. zmerp commented on May 15, 2021

    @zmerp
    Contributor

    I'm also interested in this. Personally I would use this to connect gfx-hal with OpenXR, OpenVR (driver API) and FFmpeg hardware acceleration API. Integrating these APIs directly into gfx-hal would not make much sense to me.

  5. added a commit that references this issue on May 20, 2021
  6. added a commit that references this issue on Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions