Skip to content

gallium: add cap to set up the supported OpenGL version

Juan A. Suárez requested to merge jasuarez/mesa:review/glversion-cap into main

This MR basically adds a new capability PIPE_CAP_GL_VERSION that allows a driver define the supported OpenGL version, instead of relying on Mesa find it out.

The reason for this is because as consequence of landing NV_conditional_render in V3D, the driver moved from OpenGL 2.1 to OpenGL 3.1.

But some tests were failing, and after investigating them, turned out that there were some details requested by the spec that our driver don't fulfil:

  • Some of the rendering formats required for OpenGL 3.x are not supported by our hardware. I've tried to address this issue through !22082 (closed).

  • Some of the piglit shadow samples tests were failing because they were based on cubemap texturing, which in OpenGL is non-seamless (if you support proper extension you can enable seamless, but by default is non-seamless). But in OpenGL ES is the other way around: the cubemap texturing is seamless by default, and our hardware only implements this.

  • It could be more other cases that I did not spot so far.

So two options: either add all those checks somewhat in Mesa so it takes them in account when computing the supported OpenGL version, or just go with the easiest path: allow the driver to directly expose the supported version through a capability, instead of relying on Mesa core.

For the former option, there's !22082 (closed), though it doesn't implement the check for the seamless stuff. And as I'm not sure if we want with adding more and more checks in Mesa, I just propose this easiest path.

By the way, I'm only covering the case of OpenGL version. For OpenGL ES, so far Mesa is working fine on computing the supported version. If in the future want to add something similar, we could add a similar capability.

Merge request reports