#
✕ nick:alyssa
#asahi-gpu · 2023-06-14 20:54
alyssaor maybe today. i wonder how far I can get in a few minutes so I can stop thinking about it
#asahi-gpu · 2023-06-14 20:53
alyssa=)
#asahi-gpu · 2023-06-14 20:53
alyssabut that's for tomorrow
#asahi-gpu · 2023-06-14 20:52
alyssathere are times in driver dev to be clever and I don't think this is one
#asahi-gpu · 2023-06-14 20:52
alyssaand if anything ever hits this other than the CTS we can revisit
#asahi-gpu · 2023-06-14 20:52
alyssawhich I think should get similar performance, just with a dramatically worse (but still tolerable) memory footprint
#asahi-gpu · 2023-06-14 20:51
alyssainstead will do the Simplest Thing That Could Possibly Work
#asahi-gpu · 2023-06-14 20:51
alyssaFor now, I won't be implementing anything like what Apple does for this
#asahi-gpu · 2023-06-14 20:51
alyssaok, I've given this some thought
#asahi-gpu · 2023-06-14 20:28
alyssahaven't decided if I'm doing ths approach to eMRT though
#asahi-gpu · 2023-06-14 20:28
alyssaI guess messing with tile shader's imageblock stufff might help figure that out
#asahi-gpu · 2023-06-14 20:27
alyssawould like to know more about the structure of those last 3 sources ..
#asahi-gpu · 2023-06-14 20:25
alyssa fe: 09148604fc208000 st_tile r5l_r5h_r6l_r6h, u8norm, 1, xyzw, 64, 1337, 6
#asahi-gpu · 2023-06-14 20:25
alyssawell that's one the other is
#asahi-gpu · 2023-06-14 20:25
alyssathis is the weird st_tile
#asahi-gpu · 2023-06-14 20:25
alyssa e8: 09048604fc208000 st_tile r1l_r1h_r2l_r2h, u8norm, 1, xyzw, 64, 1337, 6
#asahi-gpu · 2023-06-14 20:19
alyssathen it image_write_blocks that
#asahi-gpu · 2023-06-14 20:19
alyssathen it loops over each pixel in the tile and st_tiles it with magic sources I don't understand yet
#asahi-gpu · 2023-06-14 20:15
alyssaFirst, it image_write_blocks each non-spilled target with the barriers interleaved as before
#asahi-gpu · 2023-06-14 20:07
alyssapartial store is the spiciest
#asahi-gpu · 2023-06-14 20:06
alyssapartial reload is the standard partial reload + usual fragment transform
#asahi-gpu · 2023-06-14 20:06
alyssaclear pipeline has the same fragment transform applied of course
#asahi-gpu · 2023-06-14 20:06
alyssastore pipeline becomes empty at any rate
#asahi-gpu · 2023-06-14 20:05
alyssaalthough we could use multiple draws to avoid the barriers. slower but whatever, that's not the bottleneck here :-p
#asahi-gpu · 2023-06-14 20:04
alyssathe only thing tile shaders are actually used for here (as opposed to regular fragment shaders) is the tile barriers
#asahi-gpu · 2023-06-14 20:04
alyssawhat 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
#asahi-gpu · 2023-06-14 20:03
alyssa10. done
#asahi-gpu · 2023-06-14 20:03
alyssa9. image_write_block from the tilebuffer to the spilled render target
#asahi-gpu · 2023-06-14 20:02
alyssa8. If thread_index_in_threadgroup != 0, skip 9. (That is, step 9 executes once per tile instead of once per pixel)
#asahi-gpu · 2023-06-14 20:02
alyssa7. Another threadgroup/tile barrier (to make sure all colours are written before proceeding)
#asahi-gpu · 2023-06-14 20:02
alyssa6. Store the colour into the tilebuffer, with a special sample mask source I haven't decoded
#asahi-gpu · 2023-06-14 20:01
alyssa5. Load the pixel colour from the buffer
#asahi-gpu · 2023-06-14 20:01
alyssa4. threadgroup (tile) barrier
#asahi-gpu · 2023-06-14 20:00
alyssa3. 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.
#asahi-gpu · 2023-06-14 19:59
alyssa2. If thread_index_in_threadgroup != 0, skip 3. (That is, step 3 executes once per tile instead of once per pixel)
#asahi-gpu · 2023-06-14 19:59
alyssa1. First it wait_pix 768, 3.. the big barrier needed
#asahi-gpu · 2023-06-14 19:58
alyssabut broadly:
#asahi-gpu · 2023-06-14 19:58
alyssanot going to go through this line by line
#asahi-gpu · 2023-06-14 19:56
alyssathis seems to involve dispatching a tile shader, because of course it does T_T
#asahi-gpu · 2023-06-14 19:55
alyssaSo... the more spicy half is how do you get that buffer back into the compressed render target
#asahi-gpu · 2023-06-14 19:52
alyssa* It's straightforward to address in software
#asahi-gpu · 2023-06-14 19:52
alyssa* It's naturally tiled, so the cache behaviour isn't horrible, although not as good as a real twiddled format
#asahi-gpu · 2023-06-14 19:51
alyssa* That buffer is pretty small in practice. a few kilobytes per byte of the format.
#asahi-gpu · 2023-06-14 19:50
alyssaWhat's nice about this scheme?
#asahi-gpu · 2023-06-14 19:49
alyssabuffer[core ID][concurrent tile ID][position in tile.y][position in tile.x]
#asahi-gpu · 2023-06-14 19:49
alyssathen instead of doing tilebuffer access, the fragment shader load/stores from
#asahi-gpu · 2023-06-14 19:49
alyssapixel_t buffer[# cores][max concurrent tiles per core][tile height][tile width];
#asahi-gpu · 2023-06-14 19:48
alyssathe driver allocates a buffer like:
#asahi-gpu · 2023-06-14 19:48
alyssawith all that information the actual lowering is nice and simple
#asahi-gpu · 2023-06-14 19:48
alyssa* special register 60 giving a coverage mask that's affected by.. I guess z/s testing maybe?

plus ›