Copied from this post:
I made an illustration of my 3D hardware acceleration architecture proposal:
It introduce new native Haiku API for rendered buffer producers and consumers. It works in a way similar to Media Kit. Application that will render 3D graphics with OpenGL or Vulkan will expose BufferProducer interface that can be connected to BufferConsumer interface providers such as screen of compositor that will mix multiple inputs to one output. Connection is represented by SwapChain object that owns rendering buffers and control buffer swapping process. Connected BufferProducer and BufferConsumer may be in separate processes.
OpenGL or Vulkan applications are not required to have a window, it may be connected to another process BufferConsumer or to some offscreen processing BufferConsumer such as video recorder or network transmitter.
One screen-global surface is used for
app_server 2D graphics so changes to
app_server architecture and increase of resource usage would be minimal.
app_server will provide clipping information to compositor by reusing BDirectWindow mechanism.
Applications do not directly talk to a compositor, it can request BufferConsumer interface for BWindow, BView or BScreen instead.
Project source code on GitHub: GitHub - X547/VideoStreams: Media Kit-like 3D hardware acceleration kit for Haiku.