#
✕ nick:alyssa
#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:54
alyssalina: woof.
#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
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
alyssasure
#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: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.
#asahi-gpu · 2022-12-15 20:59
alyssa2. Read from write-combine memory (i.e. uncached) from the CPU. The framebuffer, as well as the staging resource used with the blit, are both write-combine which makes readback from the CPU very slow.
#asahi-gpu · 2022-12-15 20:58
alyssa Solution: prefer blit-based texture transfer. Most texture transfers will use a staging blit internally anyway for compression, or worse tile on the CPU, so this is probably good in practice.
#asahi-gpu · 2022-12-15 20:57
alyssa1. Format conversion. Because we don't prefer blit-based texture transfer*, mesa/st falls back to software conversion. This would be more efficiently done on the GPU, especially once we have framebuffer compression with the DCP (we don't yet).
#asahi-gpu · 2022-12-15 20:56
alyssaThere are three slowdowns here:
#asahi-gpu · 2022-12-15 20:56
alyssahandlerug: Okay, I've looked at the trace and reproduced similar issues locally
#asahi-gpu · 2022-12-15 20:17
alyssa(You can preview it with `sysprof screenshot.trace`)
#asahi-gpu · 2022-12-15 20:17
alyssaCan you install `sysprof`, run `sysprof-cli screenshot.trace`, run grim (with Celeste or foot), ctrl-c out of `sysprof-cli` and send me the resulting screenshot.trace file?
#asahi-gpu · 2022-12-15 20:16
alyssahandlerug: yes that's indeed excessive
#asahi-gpu · 2022-12-15 19:53
alyssaapparently I do have interesting things in agx/next that I forgot about
#asahi-gpu · 2022-12-15 19:53
alyssaand 2a094ba5b8d ("asahi,agx,nir: Implement depth and stencil export") for good measure
#asahi-gpu · 2022-12-15 19:52
alyssaand e643d9b6937 ("asahi: Identify XML for more flatshading controls")
#asahi-gpu · 2022-12-15 19:52
alyssaI thought that was already merged upstream >.>

plus ›