2021-04-12
00:05macc24 has quit [Ping timeout: 260 seconds]
00:07artemist has quit [Ping timeout: 260 seconds]
00:08artemist has joined #asahi-gpu
00:10bloomThis corresponds to the trig identity cos(x) = sin(x + pi/2) = sin(x + tau/4), so we expect that u0 = 2pi = tau
00:15bloomSo the first thing we do in either sin or cos is divide by tau to change from radians to "times around the circle"
00:16bloomObservation 2: The next few instructions are the sequence floor/fsub. We immediately recognize this as the fract(...) function. This is again what we'd expect -- fsin/fcos are periodic, with period 2pi, which is now period 1 after the above change of units.
00:17bloomThere are special one-op instructions dparametrized as 0b1010 and 0b1110... call them F and G
00:18bloomand reading off, we see take that angle 0 <= x < 1 and calculate... G(F(4 * x)) * F(4 * x)
00:19bloomThe multiplication by four is just another change of units. Now the fraction is angle within a quadrant, and the integer part is the quadrant. This is natural enough given the quadrant (anti)symmetries we have with sin.
00:20bloomAll we're doing is a series of reductions to make G and F as simple as possible. Or rather, as small as possible -- they're probably lookup tables.
00:21bloom2. Using a compute shader test (I believe dougallj has a script for this), run each op in isolation and dump the results. Then plot them and see what happens.
00:23bloom(There's no magic for tan. It's just computing fsin and fcos and dividing them. Just looks funny due to aggressive scheduling.)
00:28dougallyeah, maybe 1 is the way to go for now? (i do have a script that i have technically done something like this with, but it'll be a lot easier once we've made more progress on everything else)
00:29dougallbut yeah, it's a nice self-contained challenge for anyone interested in numerics if people want to try :)
00:30bloomdougall: https://gitlab.freedesktop.org/mesa/mesa/-/blob/master/src/panfrost/bifrost/bifrost_compile.c#L1471-1517 this was fun to write
00:39odmir has quit [Remote host closed the connection]
00:40odmir has joined #asahi-gpu
00:44odmir has quit [Ping timeout: 246 seconds]
01:11odmir has joined #asahi-gpu
01:20bloomno clue on the extended fields, although IIRC you have a clever way to determine those that I don't :p
01:27bloomrather you have to wait until the app is actually drawing things and potentially have to recompile many times with different shader "keys" - combinations of "leaky" state
01:28blooma number of architectures are specificalluy designed to eliminate all shader variants in e.g. core OpenGL ES
01:28bloomApple has gone the other end... why? well, because they can - Metal requires all this info at pipeline create time anyway, so why not use it? /s
01:45odmir has quit [Ping timeout: 240 seconds]
02:56phiologe has quit [Ping timeout: 250 seconds]
02:58phiologe has joined #asahi-gpu
02:58bloomAlso, while obviously I can't enforce this, I kindly ask y'all not to make a splash about that before I can get around to blogging ;-P
03:02bloomok, now it doesn't fault but there are crazy colours, guessing I screwd up the register alloc
03:12mxw39 has joined #asahi-gpu
03:15bloomld_vary is up next at which point I can start writing real shaders and implementing the heaps of ALU needed for anything interesting
04:15j`ey_ has joined #asahi-gpu
04:20mofux[m] has quit [*.net *.split]
04:20meiji163[m] has quit [*.net *.split]
04:20izzyisles[m] has quit [*.net *.split]
04:20winocm has quit [*.net *.split]
04:20j`ey has quit [*.net *.split]
04:38winocm has joined #asahi-gpu
04:39meiji163[m] has joined #asahi-gpu
04:39izzyisles[m] has joined #asahi-gpu
04:39mofux[m] has joined #asahi-gpu
05:25mxw39 has quit [Quit: Konversation terminated!]
05:26mxw39 has joined #asahi-gpu
05:37mxw39 has quit [Quit: Konversation terminated!]
05:38mxw39 has joined #asahi-gpu
06:12the-mentor3 has quit [Quit: The Lounge - https://thelounge.chat]
06:15the-mentor3 has joined #asahi-gpu
06:43mxw39 has quit [Quit: Konversation terminated!]
06:44mxw39 has joined #asahi-gpu
07:29j`ey_ is now known as j`ey
07:29j`ey has quit [Changing host]
07:29j`ey has joined #asahi-gpu
09:10cwabbott has joined #asahi-gpu
09:28jaalsa has joined #asahi-gpu
09:56macc24 has joined #asahi-gpu
13:57odmir has joined #asahi-gpu
14:01odmir has quit [Ping timeout: 240 seconds]
14:57artemist has quit [Quit: artemist]
18:34radex has joined #asahi-gpu
19:23kendfinger has joined #asahi-gpu
21:29vlixa has quit [Remote host closed the connection]
21:42vlixa has joined #asahi-gpu
22:15jixbo has joined #asahi-gpu
22:40HeN has quit [Quit: Connection closed for inactivity]
23:12jixbo has quit [Quit: jixbo]