Skip to content

Draft: freedreno/a6xx+: genXify

Rob Clark requested to merge robclark/mesa:fd/a7xx-prep into main

still incomplete (linker error about undefined reference to fd6_screen_init and fd7_screen_init, and haven't actually started dealing with the a6xx vs a7xx differences yet).. I just wanted to see how horrible using genX() would look. IMO it isn't great.

One alternative approach might be prelinked static libs, ie. combine all the fd6_*.o into a single object file and somehow (?) make fdN_screen_init() the only thing exported.. I didn't go too far down that path, since meson seems to only support this for gcc and not for llvm.

So I'm thinking a bit more about c++ template functions.. c++ has it's annoyances, but this approach would have the benefit of not needing to genX()ify things that are actually the same between gens just to avoid duplicate symbols. And it is a thing that decent IDEs will understand better than ifdef trickery. I'm not 100% about the register builders but rough handwavey idea is to:

  1. Add a7xx regs/etc in a6xx.xml, using variants to differentiate where needed. This is probably a sane idea regardless, given the similarity btwn a6xx and a7xx from register standpoint.
  2. Update gen_header.py to (:waves hands:) generate template pack functions in cases where there are register variations between gens

A side benefit would that this would make it easy to do something like si's cute draw_vbo() trick.

thoughts?

Merge request reports