Skip to content

Add more preconditions for window system/rendering interface combinations

Simon McVittie requested to merge wip/smcv/graphics-preconditions into master
  • graphics: Add precondition checks on enum arguments

    We should fail early if the argument cannot possibly be a valid window system or rendering interface. The valid window systems are in the range 0 <= window_system < SRT_N_WINDOW_SYSTEMS, and the valid rendering interfaces follow the same pattern.

  • graphics: Diagnose impossible window system, rendering interface

  • graphics: Only allow EGL_X11 with a GL-based rendering interface

    EGL is specifically for OpenGL and OpenGL ES, so when we add Vulkan (or, hypothetically, other rendering interfaces), it would make no sense to request EGL_X11 in combination with a non-GL-based window system. The only combination that makes sense for Vulkan in the short term is (X11, VULKAN); if we later add support for non-X11 windowing systems like Wayland, then (WAYLAND, VULKAN) would also make sense.

  • graphics: Diagnose combination of GLX with non-GL as programming error

    The historical libGL.so.1 interface combines the GLX windowing system with "desktop" OpenGL, with no way to disentangle the rendering interface from the windowing system. wflinfo accepts the combination of --platform glx with --api gles2, but as can be seen from the resulting version string, it is actually printing information about "desktop" OpenGL instead.

Merge request reports