[Mesa-dev] GLES1/2 and DRI drivers

Kristian Høgsberg krh at bitplanet.net
Mon Apr 12 09:39:08 PDT 2010


I've been looking into the GLES1/2 support in mesa and trying to
figure out how to make it work for DRI drivers as well.  The current
approach only works for gallium, and it works by compiling mesa core
as different state trackers.  Each state tracker is just a thin filter
on top of the public API and in the end, the result is essentially
three copies of the mesa state tracker that all load the same gallium
chipset driver to deal with the hardware.  As far as I understand it,

I would like to propose that we structure the code a bit differently,
specifically I would like to see a way where we can load one DRI
driver which can implement multiple GL APIs.  I understand that
gallium was designed to support mulitple APIs, however, in the case of
gl/gles1/gles2, there is a big overlap, and we can support all three
without different state trackers.

Specifically, what I'm thinking of is

 - the dri driver gets a new entry point that lets us create a context
for a specified API (along these lines:

 - mesa core becomes multi api aware, struct gl_context gets a new API field

 - move the es entry points from src/mesa/es into src/mesa/main

 - create src/gles1 and src/gles2 directories for compiling
libGLESv1.so and libGLESv2.so; basically glapi-es2 as a shared object

Obviously, we should keep the option to compile mesa state tracker as
gles1 or gles2 only for example (to allow building a small gles2-only
dri driver and to keep the current gallium setup working).

This is all still work in progress for me, but I'm curious what people
think of this approach.


More information about the mesa-dev mailing list