#
…

2023-06-14

00:00ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
00:02Z750 has quit [Quit: Ping timeout (120 seconds)]
00:03Z750 has joined #asahi-gpu
00:27ourdumbfuture has joined #asahi-gpu
00:59nsklaus has quit [Ping timeout: 480 seconds]
01:15thelounge606 has quit [Remote host closed the connection]
01:17cr1901 has quit [Quit: Leaving]
01:17cr1901 has joined #asahi-gpu
01:22cr1901 has quit []
01:23cr1901 has joined #asahi-gpu
01:26cr1901 has quit []
01:27cr1901 has joined #asahi-gpu
01:34lonjil2 has quit []
01:34lonjil has joined #asahi-gpu
01:40cr1901_ has joined #asahi-gpu
01:40cr1901_ has quit [Remote host closed the connection]
01:42possiblemeatball has quit [Quit: Quit]
01:58ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
02:37cr1901 has quit [Read error: Connection reset by peer]
02:41cr1901 has joined #asahi-gpu
02:46ourdumbfuture has joined #asahi-gpu
03:03ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
03:06odak_ has quit [Quit: odak_]
03:06ourdumbfuture has joined #asahi-gpu
03:25pyropeter3 has joined #asahi-gpu
03:26ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
03:27pyropeter2 has quit [Ping timeout: 480 seconds]
03:45amarioguy has quit [Remote host closed the connection]
05:06odak_ has joined #asahi-gpu
06:41odak_ has quit [Quit: odak_]
06:42odak_ has joined #asahi-gpu
06:56hightower2 has joined #asahi-gpu
06:58mlp has quit [Read error: Connection reset by peer]
07:24flibit has joined #asahi-gpu
07:26linaLooked at the Emacs issue and it's Xwayland/X11... I think it's another rendering loop, but Xorg doesn't like running under apitrace so I can't really check...
07:27flibitijibibo has quit [Ping timeout: 480 seconds]
07:27linaalyssa: Have you ever used apitrace with X?
07:29nimprod3l has joined #asahi-gpu
07:32zzywysm has quit [Ping timeout: 480 seconds]
07:35bcrumb has joined #asahi-gpu
07:36bcrumb has quit []
07:37bcrumb has joined #asahi-gpu
07:38bcrumb has quit []
07:40bcrumb has joined #asahi-gpu
07:43nimprod3l has quit [Quit: Leaving]
08:11linaFigured it out... it's a driver bug
08:11linaWe claim to support texture barriers but we don't (and can't without special handling)...
08:11bcrumb has quit [Quit: WeeChat 3.8]
08:19bcrumb has joined #asahi-gpu
08:22bcrumb has quit []
08:26bcrumb has joined #asahi-gpu
08:37bcrumb has quit [Quit: WeeChat 3.8]
08:38bcrumb has joined #asahi-gpu
08:38bcrumb has quit []
08:44bcrumb has joined #asahi-gpu
08:46linafirefox: ../src/asahi/compiler/agx_performance.c:30: agx_occupancy_for_register_count: Assertion `!"" "Register count must be less than the maximum"' failed.
08:46linaalyssa: Is that one expected?
09:06bcrumb has quit [Quit: WeeChat 3.8]
09:07odak_ has quit [Quit: odak_]
09:07odak_ has joined #asahi-gpu
10:01nsklaus has joined #asahi-gpu
11:08cylm has joined #asahi-gpu
11:12alyssa has joined #asahi-gpu
11:12alyssalina: sleepy nya nya nya nya nya nya nya nya nya bat man
11:13alyssa 07:27 <lina> alyssa: Have you ever used apitrace with X?
11:13alyssaYeah there's some awful incantation to do it that I can never remember
11:16alyssa 08:46 <lina> firefox: ../src/asahi/compiler/agx_performance.c:30: agx_occupancy_for_register_count: Assertion `!"" "Register count must be less than the maximum"' failed.
11:17alyssaI admit that's a terrible error message but what that means is that "this shader needs to spill registers and there's no spilling implemented"
11:17alyssafirefox has worked fine for me so I wonder how that one reproduced
11:17alyssalike I believe it, some webrender shaders are chunky
11:47thelounge6065 has joined #asahi-gpu
11:47as400 has quit [Remote host closed the connection]
11:59ourdumbfuture has joined #asahi-gpu
12:20odak_ has quit [Quit: odak_]
12:30odak_ has joined #asahi-gpu
12:35ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
12:38ourdumbfuture has joined #asahi-gpu
12:47odak_ has quit [Ping timeout: 480 seconds]
14:06linaalyssa: 3ec: c17fbf33 sample_mask 255, 63
14:07linais that... right?
14:14yamii has joined #asahi-gpu
14:14yamii_ has quit [Read error: Connection reset by peer]
14:21alyssathat's fine
14:21alyssaare you still live?
15:28ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
15:29ourdumbfuture has joined #asahi-gpu
15:30flibit has quit []
16:03ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
16:12mlp has joined #asahi-gpu
16:15mlp has quit []
16:15mlp has joined #asahi-gpu
16:16linaalyssa: Do we really support GL_EXT_multisampled_render_to_texture already? That's the implicit resolve stuff, right?
16:16linaAt least I remember we didn't do it for depth yet...
16:16alyssafor colour render targets it should Just Work
16:17alyssafor depth buffers I thought it did but I could've been wrong
16:17alyssathere are like, no tests for this ...
16:17alyssathere's an unmerged piglit that has problems on other drivers
16:17linaSteven says it's broken and that's why MSAA didn't work when I tested it earlier
16:17linaI can try turning it off and see if it fixes it...
16:17mlp has quit []
16:17mlp has joined #asahi-gpu
16:17alyssaI would believe it
16:18alyssashould be easy to fix hopefully if it's broken
16:18stevenYeah, Lina was noticing that the MSRTT path for MSAA in Darwinia didn't have a visual difference (and I saw that locally too). Using the traditional blit-to-resolve path instead works fine of course
16:18alyssaif you could do that I'd appreciate it!
16:18linaBTW, the Ultra thing was an MSAA interaction, there may be more lurking... but I think this is the only one relevant for clustering. So if there's anything else with tiling and MSAA, you'll see it on M1.
16:18lina(Kernel side)
16:18alyssaregardless I can't help with msrtt
16:18alyssaif you don't/can't fix it, i'll merge your disable patch
16:19linaThere is exactly one number calculated based on FB tile dimensions that is only relevant for clustering and it needed to be *samples
16:19alyssa has left #asahi-gpu [#asahi-gpu]
16:21stevenIs it functionally possible to specify a multisampled texture with a sample count of 1 (i.e. effectively making it single-sampled despite being GL_TEXTURE_2D_MULTISAMPLE)? If so I kind of wonder if it's as simple the sample count not propagating all the way through
16:24i509vcb has joined #asahi-gpu
16:26nimprod3l has joined #asahi-gpu
16:32ourdumbfuture has joined #asahi-gpu
16:37hightower2 has quit [Ping timeout: 480 seconds]
16:38alyssa has joined #asahi-gpu
16:38alyssaI have not really tested this
16:38alyssabut yknow. should work. probably
16:38linaI just finished the kernel fix! Reviewing now ^^
16:39* alyssarunning through CTS now
16:39stevenalyssa: thank you! looking now
16:39alyssaas predicted, it's not a quickfix
16:39alyssaand I expect that code to regress performance somewhat
16:39alyssawe can recover that later. correctness first.
16:40alyssalina: i must say i would not have had the persistence to work through the Darwinia side of this
16:40alyssawe make a good team, you and me :~)
16:42stevenfirst line of lower_sample_mask_write is "return false" but there's a bunch of changes after it -- was that return intentional?
16:43alyssaprobably not
16:43alyssayep definitely not
16:44linaalyssa: Confirmed it fixes Darwinia ^^
16:44alyssalina: hold on i fixed the thing steven pointed out
16:44alyssatry again with the fix :-D
16:44alyssa(I repushed)
16:44steventhanks alyssa!
16:45linaStill works!
16:45alyssaI'll revisit this post-CTS to deal with the performance hit
16:47alyssabut CTS seems happy with this if you are
16:50possiblemeatball has joined #asahi-gpu
16:52alyssaso eMRT is up next
16:52alyssabut first, lunch
16:52alyssa has quit [Quit: leaving]
16:57nimprod3l has quit [Remote host closed the connection]
17:00nimprod3l has joined #asahi-gpu
17:01linaTested all the discard cases, works ^^
17:11aafeke_ has joined #asahi-gpu
17:13nimprod3l has quit [Quit: Leaving]
17:29hightower2 has joined #asahi-gpu
17:41aafeke_ has quit [Quit: aafeke_]
17:41ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
18:20cylm has quit [Ping timeout: 480 seconds]
18:55ourdumbfuture has joined #asahi-gpu
18:58possiblemeatball has quit [Quit: Quit]
19:07as400 has joined #asahi-gpu
19:20c10l484 has quit []
19:21c10l484 has joined #asahi-gpu
19:44alyssa has joined #asahi-gpu
19:44alyssaI'm combing through a trace of emrt this afternoon
19:44alyssaI have a good handle on the transform they're doing for the fragment shaders
19:44alyssaIDK if we'll do the same thing. But understanding first.
19:44alyssait relies on a few hardware features to work:
19:45alyssa* special register 20 given the core (or cluster? what's the difference?) index
19:45alyssalina already found that one
19:45alyssa(and documented it)
19:45alyssa* special register 32 giving a sort of tile ID
19:45alyssathis one is pretty subtle
19:45alyssain each core (cluster?), there can be multiple tiles being processed concurrently
19:46alyssaup to max_concurrent_tiles
19:46alyssasr32 assigns an ID to each tile from 0 to max_concurrent_tiles - 1, such that each concurrently processed tile has a unique index
19:47alyssa* thread_position_in_threadgroup.xy defined in fragment shaders as relative to the current tile
19:47alyssa* threads_per_threadgroup defined in fragment shaders as the tile size
19:48alyssa* special register 60 giving a coverage mask that's affected by.. I guess z/s testing maybe?
19:48alyssawith all that information the actual lowering is nice and simple
19:48alyssathe driver allocates a buffer like:
19:49alyssapixel_t buffer[# cores][max concurrent tiles per core][tile height][tile width];
19:49alyssathen instead of doing tilebuffer access, the fragment shader load/stores from
19:49alyssabuffer[core ID][concurrent tile ID][position in tile.y][position in tile.x]
19:50alyssaWhat's nice about this scheme?
19:51alyssa* That buffer is pretty small in practice. a few kilobytes per byte of the format.
19:52alyssa* It's naturally tiled, so the cache behaviour isn't horrible, although not as good as a real twiddled format
19:52alyssa* It's straightforward to address in software
19:54c10l484 has quit []
19:55alyssaSo... the more spicy half is how do you get that buffer back into the compressed render target
19:55c10l484 has joined #asahi-gpu
19:56alyssathis seems to involve dispatching a tile shader, because of course it does T_T
19:58alyssanot going to go through this line by line
19:58alyssabut broadly:
19:59alyssa1. First it wait_pix 768, 3.. the big barrier needed
19:59alyssa2. If thread_index_in_threadgroup != 0, skip 3. (That is, step 3 executes once per tile instead of once per pixel)
20:00alyssa3. For each render target in the tilebuffer, do an image_write_block interleaved with a memory_barrer 0, 2, 10 (f5a2). It's not clear to me why the barriers are needed.
20:01alyssa4. threadgroup (tile) barrier
20:01alyssa5. Load the pixel colour from the buffer
20:02alyssa6. Store the colour into the tilebuffer, with a special sample mask source I haven't decoded
20:02Guest3100 has joined #asahi-gpu
20:02alyssa7. Another threadgroup/tile barrier (to make sure all colours are written before proceeding)
20:02alyssa8. If thread_index_in_threadgroup != 0, skip 9. (That is, step 9 executes once per tile instead of once per pixel)
20:03Guest3100 has quit [Remote host closed the connection]
20:03alyssa9. image_write_block from the tilebuffer to the spilled render target
20:03alyssa10. done
20:03Malaph has joined #asahi-gpu
20:04alyssawhat makes this a bit tricky is that we don't have tile shaders implemented, and neither GL nor VK has tile shaders so I'm not inclined to change that until we have a 'real' use case
20:04alyssathe only thing tile shaders are actually used for here (as opposed to regular fragment shaders) is the tile barriers
20:05alyssaalthough we could use multiple draws to avoid the barriers. slower but whatever, that's not the bottleneck here :-p
20:06alyssastore pipeline becomes empty at any rate
20:06alyssaclear pipeline has the same fragment transform applied of course
20:06alyssapartial reload is the standard partial reload + usual fragment transform
20:07alyssapartial store is the spiciest
20:15alyssaFirst, it image_write_blocks each non-spilled target with the barriers interleaved as before
20:19alyssathen it loops over each pixel in the tile and st_tiles it with magic sources I don't understand yet
20:19alyssathen it image_write_blocks that
20:25alyssa e8: 09048604fc208000 st_tile r1l_r1h_r2l_r2h, u8norm, 1, xyzw, 64, 1337, 6
20:25alyssathis is the weird st_tile
20:25systwi_ has quit [Ping timeout: 480 seconds]
20:25alyssawell that's one the other is
20:25mlp has quit [Read error: Connection reset by peer]
20:25alyssa fe: 09148604fc208000 st_tile r5l_r5h_r6l_r6h, u8norm, 1, xyzw, 64, 1337, 6
20:26mlp has joined #asahi-gpu
20:27systwi has joined #asahi-gpu
20:27alyssawould like to know more about the structure of those last 3 sources ..
20:28alyssaI guess messing with tile shader's imageblock stufff might help figure that out
20:28alyssahaven't decided if I'm doing ths approach to eMRT though
20:51alyssaok, I've given this some thought
20:51alyssaFor now, I won't be implementing anything like what Apple does for this
20:51alyssainstead will do the Simplest Thing That Could Possibly Work
20:52alyssawhich I think should get similar performance, just with a dramatically worse (but still tolerable) memory footprint
20:52alyssaand if anything ever hits this other than the CTS we can revisit
20:52alyssathere are times in driver dev to be clever and I don't think this is one
20:53alyssabut that's for tomorrow
20:54alyssaor maybe today. i wonder how far I can get in a few minutes so I can stop thinking about it
21:07ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
21:09possiblemeatball has joined #asahi-gpu
21:12Malaph has quit []
21:32ourdumbfuture has joined #asahi-gpu
22:00* alyssakeeps lowering the bar to produce the Easiest Possible Implementation
22:00alyssaI just want to pass CTS, yo
22:01alyssabindless images, sure why not, I already implement those
22:01alyssawhy not use em
22:01alyssa("Slow?" "Shhh")
22:04alyssait doesn't need to be fast
22:04alyssait just needs to work
22:11possiblemeatball has quit [Quit: Quit]
23:14nsklaus has quit [Ping timeout: 480 seconds]
…