Skip to content

Renderer redesign

Simon Ser requested to merge github/fork/ascent12/render into master

Created by: ascent12

This is a complete overhaul and redesign of wlr_renderer, to what I believe is a more sane interface and hopefully allow for more optimisations in the renderer. I'm posting this now to allow for comments on the general design of it before I get too far.

Interesting differences:

  • We actually use vertices to pick a position, instead of trying to cram everything in a matrix.
    A user wouldn't need to pass a matrix at all if they didn't want to.
  • We use EGL images for every texture, even if we wouldn't actually need to. I think this will allow us to have fewer special cases for different types of textures.
    Also, using EGL_MESA_image_dma_buf_export, it may be possible to push smaller buffers to other GPUs and allow for true Multi-GPU rendering. I need to investigate this more, though.
  • Adding data to a texture and allocating a texture is now the same operation. There are no "invalid" textures.
  • It uses GL_KHR_debug, which I mentioned ages ago in #55 (closed).
    The error messages are significantly better, but we lose the exact line number of which function called it. You can get the function name by commenting the line disabling GL_DEBUG_TYPE_PUSH_GROUP_KHR, but it spams the crap out of the log.
  • Removal of global state.

Just a few notes before you read the code:

  • It's not feature complete
  • The old wlr_renderer has not been removed yet.
    To prevent name collisions, I've named the new ones wlr_render and wlr_tex. wlr_renderer needs to be detangled from some of the components before I can properly remove it.
  • It does not use some kind of wrapper interface to allow for multiple backend types: it's GLES2 only. I would argue that we don't need multiple implementations, but it's just like this because I can't be bothered writing all of the boilerplate. It can be added back later if it's something we want to keep.
  • There is no public header. I'll write a proper one later.

Merge request reports