Skip to content

Enhancement: SDL_Process support for IPC capable of sending surfaces and textures #14506

@TheMadman

Description

@TheMadman

TL;DR:

Support for processes started by the SDL_Process API sending shared surfaces/textures to each other, including a synchronization primitive for read/write locking.

Description

I am currently writing a program that uses separate processes for plug-ins, and one of the things I want those plug-ins to be able to handle is rendering.

Linux and Windows both support shared memory and shared GPU memory, but do so very differently, so if I were to write it in a cross-platform way, the API would have to be quite constrained and opaque.

On the Linux and BSD sides, we can support sending both shared memory buffers and GPU memory as file descriptors on a Unix socket as ancillary data. We can use the socket itself to implement a simple protocol that indicates to the other side what the kind of message is.

On the Windows side, the story is a bit different, with shared memory and Direct3D shared heaps being objects created by one process at a given path, and with other processes opening that path to access it. This can be solved by the creating process sending paths to the opening process(es).

I don't know what the story is on other systems, like Apple's Metal or smartphone systems.

I'm currently implementing the Linux side of this. While I'm keeping in mind the differences between Linux and Windows with the API design, I don't currently have a Windows device to implement and test that side on.

If this is accepted, I'll create separate pull requests for smaller, individual feature implementations, otherwise I think the review would be cumbersome and there's a risk of work wasted.

Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions