#
#asahi-gpu · 2023-08-16 12:46
alyssaBizarre mechanism
#asahi-gpu · 2023-08-16 12:46
alyssaInteresting... ok
#asahi-gpu · 2023-08-16 12:46
lina(We already have the core table in the UAPI so the driver has what it needs to do that)
#asahi-gpu · 2023-08-16 12:45
linabut not all cores exist in all GPUs so you want to remap to avoid wasting table space.
#asahi-gpu · 2023-08-16 12:45
linaMy guess given what we saw now is that it maps 1-4 blocks of stack space, each of which is encoded in a particular way (size/addr compressed together). It receives a structure that is basically an array of those pointers for each threadgroup(?) for each core that can be active at the same time, and indexes into it. There's also a core mapping table, since presumably the core IDs the shaders get are "raw"
#asahi-gpu · 2023-08-16 12:43
alyssawhat's the big picture of how that program is supposed to work?
#asahi-gpu · 2023-08-16 12:43
linaI already took a good look at how that works so at this point I think I only need the magic instructions/SRs to make it do something useful
#asahi-gpu · 2023-08-16 12:42
alyssaalright
#asahi-gpu · 2023-08-16 12:42
linaFor the helper program, if you can help get the mystery instructions into the backend I can try to implement the logic (I'm leaving all the buffers up to userspace, unlike macOS, so we can use our own structures/layouts, we don't have to copy theirs)
#asahi-gpu · 2023-08-16 12:41
linaalyssa: MR for the decoder stuff opened, I'll let you figure out when we merge the UAPI stuff but we might want to do it soonish? If you can validate the bindless sampler stuff, layered rendering is tested and the helper program thing is pretty obvious.
#asahi-gpu · 2023-08-16 12:29
alyssaIf you don't set any bits, it's a VDM nop :~)
#asahi-gpu · 2023-08-16 12:29
alyssaIt's a VDM catch-all command
#asahi-gpu · 2023-08-16 12:28
alyssa12:28 lina | Apparently the VDM barrier command is also return??
#asahi-gpu · 2023-08-16 12:28
alyssa:+1:
#asahi-gpu · 2023-08-16 12:28
alyssa12:28 lina | And I also figured out stream call/return, I can push some decoder stuff for that, since they use that.
#asahi-gpu · 2023-08-16 12:28
linaApparently the VDM barrier command is also return??
#asahi-gpu · 2023-08-16 12:28
linaAnd I also figured out stream call/return, I can push some decoder stuff for that, since they use that.
#asahi-gpu · 2023-08-16 12:27
linaThere is indeed a magic VA range for dynamic allocation and the messages you'd expect back&forth plus some management structures I didn't look at yet
#asahi-gpu · 2023-08-16 12:27
linaI also looked at mesh shaders, it's what you said - no magic CDM in VDM thing, just discrete compute...
#asahi-gpu · 2023-08-16 12:27
alyssaWheeee
#asahi-gpu · 2023-08-16 12:26
linaSeemed related to the helper program for compute but unclear
#asahi-gpu · 2023-08-16 12:26
linaAnd some mystery "no preemption" (maybe?) flag that would be nice to test
#asahi-gpu · 2023-08-16 12:26
linaAlso threw in the bindless sampler thing
#asahi-gpu · 2023-08-16 12:26
alyssa:p
#asahi-gpu · 2023-08-16 12:26
alyssaMe?!
#asahi-gpu · 2023-08-16 12:26
linaAll the helper programs are exposed in the UAPI now too, you just need to implement it ^^
#asahi-gpu · 2023-08-16 12:25
alyssanice
#asahi-gpu · 2023-08-16 12:25
linaLayered rendering is fixed, needed a kernel bugfix (missing one magic buffer) + all the strides in the UAPI for Z/S
#asahi-gpu · 2023-08-16 12:25
alyssa:+1:
#asahi-gpu · 2023-08-16 12:25
linaKernel update in the usual branch, agx/uapi-updates-202308 on top of your layered branch but it's just one commit you can cherry-pick
#asahi-gpu · 2023-08-16 12:25
alyssaahhhhh
#asahi-gpu · 2023-08-16 12:25
linaI did see it when bringing up G14X but I didn't make the connection that it was the same helper as always...
#asahi-gpu · 2023-08-16 12:24
alyssahow did we never notice it before?
#asahi-gpu · 2023-08-16 12:24
alyssaOh, interesting
#asahi-gpu · 2023-08-16 12:24
linaalyssa: The helper program. It's for all three.
#asahi-gpu · 2023-08-16 12:18
alyssaI thought the helper program was only for compute though, what sets up the stacks for graphics?
#asahi-gpu · 2023-08-16 12:18
alyssalina: ughhhhh :(
#asahi-gpu · 2023-08-16 09:06
linaThat suddenly makes a lot of sense though...
#asahi-gpu · 2023-08-16 09:06
linaBad news: It's actually setting up the stacks, so we get to implement all that if we want spilling ^^;;
#asahi-gpu · 2023-08-16 09:06
linaalyssa: Good news! I figured out what the helper program is for.
#asahi-gpu · 2023-08-16 08:55
iyesOkay thanks!
#asahi-gpu · 2023-08-16 08:54
_jannau__I don't know. you could ask in #dri-devel
#asahi-gpu · 2023-08-16 08:53
iyesWhere can I find general (non-asahi-specific) docs to help me learn and navigate around mesa's codebase, architecture, apis, dev workflows, etc?
#asahi-gpu · 2023-08-16 08:47
jannauanother reason for starting with opengl was that it clearly would have a driver which can be used
#asahi-gpu · 2023-08-16 08:47
iyesAnd what about general mesa developer documentation?
#asahi-gpu · 2023-08-16 08:47
iyesAwesome, will read it
#asahi-gpu · 2023-08-16 08:45
jannaudocumentation is in https://github.com/dougallj/applegpu, makes sense to (re-)read Alyssa's blog post on agx
#asahi-gpu · 2023-08-16 08:44
iyesI remember alyssa said that the Asahi project started out with GL and not Vulkan, because the existing frameworks/infra in mesa made it easy to implement GL, as it takes care of the peculiarities of the API and the hardware agnostic stuff
#asahi-gpu · 2023-08-16 08:43
iyes I mean, ofc it varies, some are very complex ... but let's say it is some smaller GL extension, not something huge like geometry shaders
#asahi-gpu · 2023-08-16 08:43
iyesBut speaking of which, (very naive question) how much work does it generally take to implement a GL extension, assuming the needed knowledge of the hardware is available / you aren't blocked on not understanding the hardware?

plus ›