#asahi-gpu · 2023-03-03 19:31
alyssayeah, I'm copying your existing logic#asahi-gpu · 2023-03-03 19:31
alyssaoh#asahi-gpu · 2023-03-03 19:31
alyssaHm?#asahi-gpu · 2023-03-03 19:07
linaI'm not sure how bad that would be but I can see it being anywhere from a perf issue to a deadlock issue.#asahi-gpu · 2023-03-03 19:07
linaalyssa: Make sure to keep the writer_syncobj clear in that path somehow, that's important (without it you could end up importing the wrong fence on export, we don't want to import if there is no current writer)#asahi-gpu · 2023-03-03 19:03
alyssaProbably faster too#asahi-gpu · 2023-03-03 19:03
alyssaAvoid a can of worms that way#asahi-gpu · 2023-03-03 19:03
alyssaI'm just going to remove the hash table#asahi-gpu · 2023-03-03 18:57
alyssas/explicit//#asahi-gpu · 2023-03-03 18:56
linaStory of explicit sync: cargo cult code from other drivers then realize they're all broken ^^ (first panfrost, then iris/xe)#asahi-gpu · 2023-03-03 18:55
linaOh yeah the fence stuff is definitely broken in panfrost (at least the missing null checks in fence_reference) FYI#asahi-gpu · 2023-03-03 18:54
alyssain panfrost#asahi-gpu · 2023-03-03 18:54
alyssaoh ugh ok this is very broken#asahi-gpu · 2023-03-03 18:52
alyssaget some sleep, sis :)#asahi-gpu · 2023-03-03 18:52
alyssahaha alright :)#asahi-gpu · 2023-03-03 18:52
linaYou get to figure this one out ^^#asahi-gpu · 2023-03-03 18:51
linaI had enough crazy memory safety issues today... (see MR, you have no idea how long I spent tracking down that state tracker/blitter interaction one and deciding how to fix it...)#asahi-gpu · 2023-03-03 18:50
alyssahow did this work before#asahi-gpu · 2023-03-03 18:46
alyssaso this is busted#asahi-gpu · 2023-03-03 18:45
alyssaoh because we're reference counting BOs, but not resources#asahi-gpu · 2023-03-03 18:44
alyssause-after-free, yeet0#asahi-gpu · 2023-03-03 18:44
alyssa==53478== by 0x5FC1687: ??? (in /home/alyssa/mesa/build/src/gallium/targets/dri/asahi_dri.so)#asahi-gpu · 2023-03-03 18:44
alyssa==53478== at 0x4889F94: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)#asahi-gpu · 2023-03-03 18:44
alyssa==53478== Block was alloc'd at#asahi-gpu · 2023-03-03 18:44
alyssa==53478== by 0x5DDD3DF: ??? (in /home/alyssa/mesa/build/src/gallium/targets/dri/asahi_dri.so)#asahi-gpu · 2023-03-03 18:44
alyssa==53478== at 0x4887B40: free (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)#asahi-gpu · 2023-03-03 18:43
alyssa==53478== Address 0x7b45180 is 128 bytes inside a block of size 480 free'd#asahi-gpu · 2023-03-03 18:43
alyssa==53478== at 0x5FBD6F0: ??? (in /home/alyssa/mesa/build/src/gallium/targets/dri/asahi_dri.so)#asahi-gpu · 2023-03-03 18:43
alyssa==53478== Invalid read of size 8#asahi-gpu · 2023-03-03 18:43
alyssasigh, C#asahi-gpu · 2023-03-03 18:43
alyssahappens running dEQP-GLES31.functional.compute.*#asahi-gpu · 2023-03-03 18:43
alyssalina: rsrc->bo can be corrupted in agx_batch_cleanup#asahi-gpu · 2023-03-03 18:31
alyssaThat's not what we're looking for but it gives a sense that AGX might have an analogous reg#asahi-gpu · 2023-03-03 18:30
alyssathe addressmode. When set to 0, HW will be seemless, ie, ignore addressmode, filter between faces at the edges/corners#asahi-gpu · 2023-03-03 18:30
alyssaPixel data master. Disable filtering over edges/corners for CEM. When set to 1, HW will be seemfull, ie, always stay in the current map, always honour#asahi-gpu · 2023-03-03 18:30
alyssaTAG_CEMEDGE_DONTFILTER#asahi-gpu · 2023-03-03 18:30
alyssaRGX has this bit#asahi-gpu · 2023-03-03 18:27
alyssaI can implement the workarounds if needed but I'd much rather not#asahi-gpu · 2023-03-03 18:27
alyssareally hoping AGX has a TPU control register that can toggle this behaviour tbh#asahi-gpu · 2023-03-03 18:20
alyssaRGX has a TPU control register, maybe AGX does too, idk#asahi-gpu · 2023-03-03 18:19
alyssaIDK#asahi-gpu · 2023-03-03 18:19
alyssait's entirely possible that there's, like, a bit in some control register to toggle this behaviour#asahi-gpu · 2023-03-03 18:18
alyssaso it's hard to say what's actually happening here#asahi-gpu · 2023-03-03 18:18
alyssaand I don't see the Apple Metal blob fixing this up#asahi-gpu · 2023-03-03 18:18
alyssaHowever.. I don't see any references to this issue in Metal docs nor MoltenVK nor ANGLE#asahi-gpu · 2023-03-03 18:17
alyssawhich is very much not great but not catastrophic#asahi-gpu · 2023-03-03 18:17
alyssathe only solution I can come up with for Vulkan is duplicating samplers to have a regular version and a cube map version, and toggle between the two in the shader depending on whether loading from a cube map or not#asahi-gpu · 2023-03-03 18:16
alyssafor VK it'll be a bit more annoying because we have no way of knowing whether a given sampler is for a cube map or not#asahi-gpu · 2023-03-03 18:16
alyssa'll be ok#asahi-gpu · 2023-03-03 18:15
alyssaadd a hack in mesa/st to fix up the wrap mode and it