#
✕ nick:alyssa
#asahi-gpu · 2023-03-07 12:58
alyssaand not stable
#asahi-gpu · 2023-03-07 12:58
alyssa'since it is not safe to do so'
#asahi-gpu · 2023-03-07 12:57
alyssa....uh
#asahi-gpu · 2023-03-07 12:57
alyssalina: "Blit command support will be added in a future driver"
#asahi-gpu · 2023-03-07 12:42
alyssa(otoh, as far as I can tell, Mali-G610 was uniquely designed around supporting multiDrawIndirect and that's it ;P)
#asahi-gpu · 2023-03-07 12:42
alyssabut it's still a really steep cliff you fall off as soon as you leave the comfy confines of what the hw designers intended
#asahi-gpu · 2023-03-07 12:42
alyssaand perf will be ok unless the app goes crazy with this stuff
#asahi-gpu · 2023-03-07 12:42
alyssanone of this is *challenging*, mind you
#asahi-gpu · 2023-03-07 12:40
alyssaand then the compute kernel will just patch the link target based on the query result
#asahi-gpu · 2023-03-07 12:40
alyssain the control stream after emitting the compute, always emit a stream link and put all the draws to predicate in a new control stream
#asahi-gpu · 2023-03-07 12:39
alyssathis compute kernel though isn't too horrible, thankfully
#asahi-gpu · 2023-03-07 12:39
alyssa(feel free to replace "Compute kernel" with "internal vertex shader" if you want this to all happen on the VDM, btw)
#asahi-gpu · 2023-03-07 12:39
alyssaunless there's a sufficiently general conditional stream link, we again need to dispatch a compute kernel for this
#asahi-gpu · 2023-03-07 12:38
alyssaon AGX, this is a lot more tricky
#asahi-gpu · 2023-03-07 12:38
alyssa(*Mali-G610, older Malis this all suuuucks far worse tha AGX)
#asahi-gpu · 2023-03-07 12:38
alyssaLOAD the result of the query and branch over the draws based on the result
#asahi-gpu · 2023-03-07 12:38
alyssaon Mali, this is really easy!
#asahi-gpu · 2023-03-07 12:37
alyssaanother notable one, conditional rendering, which lets you predicate draws on an occlusion query passing
#asahi-gpu · 2023-03-07 12:37
alyssa(but Metal's "GPU indirect buffers" are exactly this, and if MoltenVK supports multiDrawIndirect - dont remember if they do - it's with this)
#asahi-gpu · 2023-03-07 12:37
alyssa(which is kinda horrible, because you need to plumb the draw ID into the shaders as a special uniform, but changing the uniform state means re-emitting a whole pile of shader state. it can be done with a "clone and patch" technique, or with a sufficient horrible compute kernel. but it's not nice.)
#asahi-gpu · 2023-03-07 12:35
alyssaso either we don't do multiDrawIndirect, or we implement it with a compute kernel that generates a control stream with all the draws at runtime and then stream_links to it
#asahi-gpu · 2023-03-07 12:35
alyssaon AGX, we have no way to express a loop, it's not turing complete by itself
#asahi-gpu · 2023-03-07 12:34
alyssaon Mali-G610, the driver implements this with a loop in the command stream
#asahi-gpu · 2023-03-07 12:34
alyssanotably, multiDrawIndirect, which is like draw indirect but now draws an arbitrary number of draws indirectly with the draw count loaded from memory
#asahi-gpu · 2023-03-07 12:33
alyssabut if you have an API requirement that the hw doesn't accommodate, you're kinda screwed
#asahi-gpu · 2023-03-07 12:33
alyssathere's hardware support for a few important types of indirects, where there's a special control word to do an indirect draw or whatever
#asahi-gpu · 2023-03-07 12:33
alyssagenerally this means that AGX is easier to program -- and the AGX control stream is a lot more compact than the Mali command stream -- but there's a pretty low ceiling for what you can do with AGX in terms of indirection
#asahi-gpu · 2023-03-07 12:31
alyssabut that has general purpose "load/store registers from/to memory" instructions, conditional branching based on the values of registers, a simple integer ALU, etc
#asahi-gpu · 2023-03-07 12:31
alyssae.g. Mali-G610 exposes an entire Turing-complete-by-design ISA where the state vector is passed in registers that the driver sets with MOV_IMM32 instructions
#asahi-gpu · 2023-03-07 12:30
alyssathis is very different than GPUs with real command streams,
#asahi-gpu · 2023-03-07 12:30
alyssait's just a bunch of control packets one after the other, plus a link command to jump between control streams
#asahi-gpu · 2023-03-07 12:29
alyssathe distinction being, it isn't executed / interpeted in any meaningful way, it's not structured as commands or bytecode or anything
#asahi-gpu · 2023-03-07 12:29
alyssa*GX actually has a "control stream" in powervr lingo, not a command stream
#asahi-gpu · 2023-03-07 12:28
alyssalina: nit, "the VDM level (in the GPU command stream)"
#asahi-gpu · 2023-03-07 05:54
alyssanini
#asahi-gpu · 2023-03-07 05:54
alyssafiiiiine
#asahi-gpu · 2023-03-07 05:54
alyssahttps://rosenzweig.io/I is with your patch
#asahi-gpu · 2023-03-07 05:54
alyssalina: Nope, still no good
#asahi-gpu · 2023-03-07 05:49
alyssa(OK, I hit the issue with firefox in sway on the older kernel. good to know it's not just gnome)
#asahi-gpu · 2023-03-07 05:48
alyssais that portable?
#asahi-gpu · 2023-03-07 05:47
alyssabecause even in an unsafe{} block it is literally never legal to get raw bytes of repr(Rust)
#asahi-gpu · 2023-03-07 05:47
alyssastill feels like this is a footgun API
#asahi-gpu · 2023-03-07 05:47
alyssaor is this happening in an unsafe{} block with a botched SAFETY comment?
#asahi-gpu · 2023-03-07 05:47
alyssawhat I mean is, how is it ever sound to get the raw bytes of a repr(Rust) struct
#asahi-gpu · 2023-03-07 05:45
alyssaim kinda surprised rust doesn't catch this sort of bug
#asahi-gpu · 2023-03-07 05:42
alyssasway + stk is fine
#asahi-gpu · 2023-03-07 05:42
alyssaIDK why it's only happening with gnome
#asahi-gpu · 2023-03-07 05:41
alyssahttps://rosenzweig.io/Image.gz
#asahi-gpu · 2023-03-07 05:40
alyssano
#asahi-gpu · 2023-03-07 05:39
alyssamore missing repr(C)?

plus ›