Mir

Code review comment for lp://qastaging/~afrantzis/mir/buffer-bind-to-render-image

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

To illustrate that renderers and core need not change for new drivers/platforms:

class GLBuffer : public Buffer
class LinearBuffer : public Buffer // addressable with a stride etc
class VkBuffer : public Buffer

class ShmBuffer : public LinearBuffer
class DirectFBBuffer : public LinearBuffer

class GBMBuffer : public GLBuffer
class NvidiaGLBuffer : public GLBuffer
class NvidiaVkBuffer : public VkBuffer
class AndroidBuffer : public GLBuffer

Mesa driver:
   GLBuffer allocate_gl_buffer(); // returns GBMBuffer

Android driver:
   GLBuffer allocate_gl_buffer(); // returns AndroidBuffer

Nvidia driver:
   GLBuffer allocate_gl_buffer(); // returns NvidiaGLBuffer
   VkBuffer allocate_vk_buffer(); // returns NvidiaVkBuffer

libmirplatform:
   LinearBuffer allocate_linear_buffer(); // returns ShmBuffer usually

Drivers could optionally override with their own:
   LinearBuffer allocate_linear_buffer();
but it's generally not required or even recommended in most cases.

DirectFB:
   LinearBuffer allocate_linear_buffer(); // might return a DirectFBBuffer

Renderers:
   GL/GLES: Understands GLBuffer and LinearBuffer
   Vulkan: Understands VkBuffer and LinearBuffer
   Joe's cool software blitter: Understands LinearBuffer

New renderers are only required for new graphics languages, which are quite rare.

« Back to merge proposal