#
#asahi-gpu · 2021-01-11 02:19
krbtgtiirc wrt tiling: i think powervr/nvidia/apple are the biggestg users of it
#asahi-gpu · 2021-01-11 01:01
bloomHow could I forget?
#asahi-gpu · 2021-01-11 00:39
icecream95bloom: IIRC My NEON tiling routine was "only" about 3x faster
#asahi-gpu · 2021-01-11 00:36
bloomIf this is about your NEON routine, yes, you win, I'm over it, we both know you're better at writing tiling routines than me :P
#asahi-gpu · 2021-01-11 00:35
bloomicecream95: Oh, hello there.
#asahi-gpu · 2021-01-11 00:34
davidrysk[m]I wish we knew more about Apple's (CPU) microarchitecture. From what I can tell, they're still using the scheduler model that was intended for Cyclone (A7) in LLVM, and that chip had much less instruction level parallelism available.
#asahi-gpu · 2021-01-11 00:34
icecream95https://www.sevarg.net/generated/images/2021-qemu-m1/mbw-1200-b48fbb189.png
#asahi-gpu · 2021-01-11 00:32
bloomI don't think that should come as a surprise to anyone, memory performance is critical to both CPU and GPU performance, and if you want to kick ass at both for an SoC, optimizing the hell out of the memory access is a 2 for 1 deal..
#asahi-gpu · 2021-01-11 00:32
davidrysk[m]This was making the rounds the other day, but these tests are too elementary to really provide any interesting info
#asahi-gpu · 2021-01-11 00:32
davidrysk[m]https://lemire.me/blog/2021/01/06/memory-access-on-the-apple-m1-processor/
#asahi-gpu · 2021-01-11 00:32
bloomThe optimization reducing ALU while keeping memory access constant. So it seems not only is the ALU on the Mac all around faster, the memory is _so_ much better.
#asahi-gpu · 2021-01-11 00:31
bloomWhat's intriguing there is that the optimization helps only 4% on the Rockchip but 23% on the Apple.
#asahi-gpu · 2021-01-11 00:30
bloomOh, and by properly splitting out unaligned/aligned portions, the M1 gets the job done in 0.33s while the RK3399 is at ~1.58s
#asahi-gpu · 2021-01-10 23:59
bloomdavidrysk[m]: Every GPU does, that's not special :)
#asahi-gpu · 2021-01-10 23:57
davidrysk[m](in their WWDC talks on Metal and their GPUs)
#asahi-gpu · 2021-01-10 23:57
davidrysk[m]makes sense — Apple has been very specific that they use tiling heavily
#asahi-gpu · 2021-01-10 23:57
bloomNot sure how that compares to expected perf
#asahi-gpu · 2021-01-10 23:57
bloomdavidrysk[m]: 🎉
#asahi-gpu · 2021-01-10 23:57
davidrysk[m]:) nice!
#asahi-gpu · 2021-01-10 23:56
bloomso just under 4x faster
#asahi-gpu · 2021-01-10 23:56
bloomSingle-thread CPU/memory bound
#asahi-gpu · 2021-01-10 23:56
bloomAlso, curiousity got the better of me: my texture tiling benchmark runs in 1.649s on Rockchip RK3399 (an arm64 processor from ~5 years ago) and 0.43s on the Apple M1
#asahi-gpu · 2021-01-10 23:44
bloom^ The single best resource about texture tiling out there :)
#asahi-gpu · 2021-01-10 23:44
bloomhttps://fgiesen.wordpress.com/2011/01/17/texture-tiling-and-swizzling/
#asahi-gpu · 2021-01-10 23:44
bloomttps://fgiesen.wordpress.com/2011/01/17/texture-tiling-and-swizzling/
#asahi-gpu · 2021-01-10 23:39
bloom(Kudos to marcan for figuring out the swizzle pattern.)
#asahi-gpu · 2021-01-10 23:39
bloomBut it applies beautifully to M1!
#asahi-gpu · 2021-01-10 23:39
bloomIt's funny, all that reading I did on texture tiling algorithms for Mali never bore much fruit.
#asahi-gpu · 2021-01-10 03:33
bloomwe'll see how desperate I get ;)
#asahi-gpu · 2021-01-10 03:33
bloomlinkmauve: it's an option, but I'd rather stick with Metal if I can just to avoid indirections that might obscure hw behaviour
#asahi-gpu · 2021-01-10 03:18
linkmauveIf so, that might show you how to do the same operation.
#asahi-gpu · 2021-01-10 03:18
linkmauvebloom, can’t you still do OpenGL and have it translated to their Metal driver at runtime?
#asahi-gpu · 2021-01-10 02:58
bloomok, it rendered ok this time, let's see if it's actually linear..
#asahi-gpu · 2021-01-10 02:54
bloomSome combination of allowGPUOptimizedContents and usage should do the trick.
#asahi-gpu · 2021-01-10 02:53
bloomthinks she has it
#asahi-gpu · 2021-01-10 02:47
bloomI will admit Metal is a _lot_ easier to understand than GL.
#asahi-gpu · 2021-01-10 02:46
bloomLooks like I should be able to play games with IOSurface and GetBaseAddress
#asahi-gpu · 2021-01-10 02:45
bloom(I say almost because it's a completely trivial feature, but somehow Vivante [iirc] doesn't support it...)
#asahi-gpu · 2021-01-10 02:44
bloomI know the usual OpenGL tricks, not sure how to do them in Metal
#asahi-gpu · 2021-01-10 02:44
bloomWhich the GPU is almost certainly capable of, just a matter of coaxing the driver into doing it
#asahi-gpu · 2021-01-10 02:44
davidrysk[m]ahh
#asahi-gpu · 2021-01-10 02:44
bloomI'm more interested in the Metal side, rendering off-screen but to something linear / CPU visible
#asahi-gpu · 2021-01-10 02:43
bloomdavidrysk[m]: Right, they probably dropped it so they could pipe in framebuffer compression support quietly and without breaking any apps :)
#asahi-gpu · 2021-01-10 02:42
davidrysk[m]https://developer.apple.com/documentation/coregraphics/quartz_display_services/1807908-cgdisplaybaseaddress
#asahi-gpu · 2021-01-10 02:42
bloomdavidrysk[m]: That would've sufficed if it were in 11.0 :|
#asahi-gpu · 2021-01-10 02:40
davidrysk[m]or do you mean something else? :)
#asahi-gpu · 2021-01-10 02:39
davidrysk[m]bloom: Apple got rid of the getRawFrameBuffer call in, iirc, 10.14 or so
#asahi-gpu · 2021-01-10 02:38
bloom(Bit of an XY problem, trying to get a CPU visible framebuffer)
#asahi-gpu · 2021-01-10 02:35
bloom"On macOS, usage must not include the UsageRenderTarget option" Guess I'm out of luck...
#asahi-gpu · 2021-01-10 02:32
bloomDumping .contents of the buffer to a file and reinterpreting as a linear texture is showing some odd artefacts.

plus ›