Skip to content

WIP: nine: Initial v3d support

Martell requested to merge martell/mesa:v3d-nine into main

I used !7001 (closed) as a reference and cherry-picked the common commits after reading through #3606 earlier today.

Update: we have triangle_SDL example rendering correctly 🎉 Triangle_SDL_NINE

All development was done on the pi itself which is kind of cool!

Setup notes

Meson config arguments

meson --prefix /home/pi/local-install --libdir lib -Dplatforms=x11 -Dvulkan-drivers=broadcom -Ddri-drivers= -Dgallium-drivers=v3d,vc4,kmsro,swrast -Dgallium-nine=true -Dbuildtype=debug _build .

Xnine repo Patch for Xnine example

Command to run Xnine example NINE_DEBUG=warn MESA_DEBUG=1 V3D_DEBUG=warn DRI_PRIME=1 ./triangle_SDL

Status

I've never worked on MESA before and I probably don't have nearly enough context on everything that is going on to even be attempting this 😆 I did however manage to refresh my gdb/lldb skills with this exercise and some dx setup.

I'm probably going to have to lean on suggestions from @icecream95 and @itoral or some other mesa devs before I debug and progress further

Resolved issues:

  • the NINE_DEBUG flag does not seem to do anything - Was a set of string options =help lists them
  • without the DRI_PRIME flag the application tries to use the VC4 driver instead of V3D - VC4 and kmsro resolved this
  • dri3 fails every time on xcb_request_check after calling xcb_dri3_pixmap_from_buffer_checked - trace included trace.txt - was related to not setting up VC4 correctly

Current issues:

  • is skipping surface creation correct on empty frame buffer -> the driver seems to assume there will always be 4?
  • is emit_stores broken because we only have 1 frame buffer or is it unrelated - I need to do a lot of reading to get up to speed - pointers welcome
Edited by Martell

Merge request reports