Moving code around, post classic

Kenneth Graunke kenneth at
Sat Dec 18 09:20:39 UTC 2021

On Tuesday, December 7, 2021 12:26:29 PM PST Emma Anholt wrote:
> On Mon, Dec 6, 2021 at 3:50 PM Dylan Baker <dylan at> wrote:
> >
> > Classic is gone, and the cleanups have begun, obviously. There is
> > another cleanup that I had in mind, which is moving src/mesa into
> > src/gallium/frontends/mesa. This makes the build system a little
> > cleaner, as currently we do some bending over backwards to get gallium,
> > mesa, and their tests built in the right order. But that's a big ol `git
> > mv`, and when I proposed it Dave and Ilia suggested it would be best to
> > do all of the post-classic code motion at once. So, let's talk about
> > what we want to move, and where we want to move it.
> >
> > Among the suggestions we had were:
> >
> > 1. Move src/mesa into src/gallium/frontends/mesa (I have patches for
> >    this)
> >
> >    Seems like a pretty obvoius thing to do, given that all of the other
> >    gallium state trackers live there (OpenCL, video, d3d9, etc)
> >
> > 2. Move src/compiler/glsl into src/gallium/frontends/mesa as well
> >
> >     Given that there are now no? drivers that use GLSL-IR directly, it
> >     might make sense to move the glsl compiler into the mesa
> >     state_tracker, and just have that lower to TGSI or NIR, and treat
> >     GLSL-IR as an implementation detail of the OpenGL frontend.
> >
> >     Unfortunately, there are a lot of code outside of glsl that uses the
> >     linked list implementation in the glsl compiler, and not the on in
> >     util.
> >
> > 3. Move src/gallium* to src/
> >
> >     This was suggested, though given the existance of Vulkan, it wasn't
> >     clear that this was a good idea or not
> >
> > 4. What to do about the src/loader, src/glx, src/egl, src/mapi,
> >    src/glapi
> >
> >     These are all part of OpenGL, but not really part of gallium, but if
> >     we don't move src/gallium/* to src/ does it make sense to leave them
> >     in the root?
> FWIW, I'm mildly against moving src/mesa to src/gallium/frontends/mesa
> (or /gl would make more sense to me at that point).  That feels like a
> whole lot of gratuitous typing of longer paths to me, when GL feels
> like a pretty fundamental thing in the repo and not worth hiding way
> down there.

I'm also against moving src/mesa for the reasons that Dave and Emma
mention.  I'm not really a huge fan of any of the proposed mass-moves.

Moving files around can really be quite painful.  I'm still occasionally
digging through history for files moved from src/mesa/drivers/dri/i965 
to src/intel/compiler, and having to take extra steps there.  Which is
fine, because there was a very good reason for that move (we introduced
a Vulkan driver, and the compiler moved to be a shared component).

If we wanted to move src/loader, src/glx, src/egl, we could potentially
make those src/mesa/wsi/{egl,glx,loader}.  And maybe src/mesa/mapi.
But really, it seems like the benefit there is "less directories in src"
which I don't think is really worth it.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <>

More information about the mesa-dev mailing list