#
#asahi-gpu · 2022-12-16 04:07
alyssanpc == "no(n) perspective correct" == no_perspective in metal
#asahi-gpu · 2022-12-16 04:07
alyssa </struct>
#asahi-gpu · 2022-12-16 04:07
alyssa <field name="output_clip_planes" start="16" end="19" type="uint"/>
#asahi-gpu · 2022-12-16 04:07
alyssa <struct name="STATE_VARYING2" length="1">
#asahi-gpu · 2022-12-16 04:07
alyssa </struct>
#asahi-gpu · 2022-12-16 04:07
alyssa <field name="f16_linear" start="8" end="15" type="uint"/>
#asahi-gpu · 2022-12-16 04:06
alyssa <field name="f16_flat" start="16" end="23" type="uint"/>
#asahi-gpu · 2022-12-16 04:06
alyssa <field name="f16_npc" start="24" end="31" type="uint"/>
#asahi-gpu · 2022-12-16 04:06
alyssa <struct name="STATE_VARYING1" length="1">
#asahi-gpu · 2022-12-16 04:06
alyssa <field name="f32_linear" start="0" end="7" type="uint"/>
#asahi-gpu · 2022-12-16 04:06
alyssa </struct>
#asahi-gpu · 2022-12-16 04:06
alyssa <field name="f32_flat" start="8" end="15" type="uint"/>
#asahi-gpu · 2022-12-16 04:06
alyssa <field name="f32_npc" start="16" end="23" type="uint"/>
#asahi-gpu · 2022-12-16 04:06
alyssa <struct name="STATE_VARYING0" length="1">
#asahi-gpu · 2022-12-16 04:06
alyssaif you are lucky it will be exactly the same as STATE_VARYING0 and STATE_VARYING1 in
#asahi-gpu · 2022-12-16 04:06
alyssas/centroid/noperspective/
#asahi-gpu · 2022-12-16 04:05
alyssajust try all the (valid) combinations of float/half/int smooth/flat/centroid and it should? be easy to connect the dots
#asahi-gpu · 2022-12-16 04:04
alyssacorrect XML not "<<8" :p
#asahi-gpu · 2022-12-16 04:04
alyssalina: if you're going in the area, I'd appreciate some XML for the various varying words
#asahi-gpu · 2022-12-16 03:59
linaGuess I need more macOS investigation ^^
#asahi-gpu · 2022-12-16 03:57
linaStill doesn't work but I think we're getting somewhere
#asahi-gpu · 2022-12-16 03:57
linaOooh so with your patch, I can set the varying <<8 field and *not* crash. That's new I think!
#asahi-gpu · 2022-12-16 03:54
alyssalina: woof.
#asahi-gpu · 2022-12-16 03:49
linaBut now I wonder if combining them with some of the other things I tried last time would...
#asahi-gpu · 2022-12-16 03:49
linaAs for the flat shading ones... interestingly, they don't actually fix Darwinia!
#asahi-gpu · 2022-12-16 03:49
linaalyssa: Apparently I cherry-picked the depth/stencil export one but forgot to push...
#asahi-gpu · 2022-12-15 21:23
alyssaI think I want to map PIPE_USAGE_STAGING to writeback and everything else to write-combine and that should do what we want (including for readpix)
#asahi-gpu · 2022-12-15 21:16
alyssafreedreno uses transfer
#asahi-gpu · 2022-12-15 21:16
alyssazink uses blit, except for anv/radv where it uses compute
#asahi-gpu · 2022-12-15 21:14
alyssav3d uses blit based and says they don't want to for perf for glReadPixels because of the uncached read after.. hm
#asahi-gpu · 2022-12-15 21:13
handlerugI am not sure what is the key difference between M1 and M1 Max that makes it faster
#asahi-gpu · 2022-12-15 21:13
alyssairis uses blit-based everywhere
#asahi-gpu · 2022-12-15 21:13
alyssaIt's unclear whether blit-based texture transfer should be preferred on integrated GPUs... the gallium docs say blit-based for discrete GPUs and transfer-based for software rasterizers...
#asahi-gpu · 2022-12-15 21:13
alyssawhat's weird about that?
#asahi-gpu · 2022-12-15 21:12
handlerugthanks for the writeup and research!
#asahi-gpu · 2022-12-15 21:12
handlerugweird how it's much faster on mac mini
#asahi-gpu · 2022-12-15 21:12
alyssasure
#asahi-gpu · 2022-12-15 21:12
handlerugeh I thought I'd see if it also worked on this machine
#asahi-gpu · 2022-12-15 21:11
alyssabut YMMV :p
#asahi-gpu · 2022-12-15 21:11
alyssanot sure I recommend using that patch in general since it's had zero testing other than "grim is faster now" :p
#asahi-gpu · 2022-12-15 21:10
handlerugis building mesa to test the patch
#asahi-gpu · 2022-12-15 21:09
alyssa(including NEON support)
#asahi-gpu · 2022-12-15 21:09
alyssaI don't know enough about the various zlib forks to recommend one, it looks like Chromium is carrying a pile of patches of their own
#asahi-gpu · 2022-12-15 21:08
alyssamore to the point -- upstream zlib doesn't have NEON optimizations which will penalize png compression on arm systems
#asahi-gpu · 2022-12-15 21:05
alyssahttps://github.com/zlib-ng/zlib-ng is probably worth a try for #3
#asahi-gpu · 2022-12-15 21:02
alyssahttps://rosenzweig.io/wip.diff -- this enables blit based compression (solution for #1) and disables write caching (very blunt hammer to workaround #2, the proper fix requires plumbing some flags around the driver which isn't hard but needs some care)
#asahi-gpu · 2022-12-15 21:01
alyssa Solution: use JPEG with the JPEG hardware encoder.
#asahi-gpu · 2022-12-15 21:01
alyssa Solution: speed up zlib. https://dougallj.wordpress.com/2022/08/20/faster-zlib-deflate-decompression-on-the-apple-m1-and-x86/
#asahi-gpu · 2022-12-15 21:00
alyssa3. deflate is slow. With #1 and #2 solved, depending on the content grim still spends inordinate amounts of time in deflate() in zlib internal to libpng. That's not our fault, and with #1 and #2 fixed, using `grim -t ppm` instead is generally quite fast.
#asahi-gpu · 2022-12-15 20:59
alyssa Solution: allocate the staging resource as writeback (instead of write-combine), since we know that we will be reading from the CPU. The copy from framebuffer->staging happens on the GPU so the cache is ok there.

plus ›