2023-08-27
00:02i509vcbnir_load_global_constant can be used to read from a buffer, but how do I tell nir to store that value into some uniform registers?
00:05i509vcbI have sorted sysvals so that uniform registers can be assigned, but I need to load a value from the sysval buffer and store it in a uniform reg for use
00:09i509vcbhmm okay, so really the only usc_uniform call I'd probably do then is tell the driver where I uploaded the agxv_sysvals_whatever
00:09alyssain practice, the compiler will internally generate store_preamble instructions to optimize the load into a uniform, but that's completely invisible to the driver
00:09alyssaotoh, if you want to calculate layouts yourself, then you use usc_uniform in the driver and you have to emit load_preamble directly -- not load_global_constant
00:19i509vcb> agx_usc_uniform is then used to copy from that struct to uniform registers according to the layout that you picked earlier
00:19i509vcbBut from a theoretical performance standpoint loading that value into a uniform register would just generate an redundant mov?
00:20alyssa1. you do not assign uniforms, you just generate load_global_const and let the compiler go to town
00:20alyssa2. you do assign uniforms, and instead of generating load_global_const, you generate load_preamble and the compiler won't touch that
00:20chadmed has quit [Ping timeout: 480 seconds]
00:21i509vcbI guess the former sounds better from a maintaince standpoint since we already upload all the stuff into a buffer
00:22alyssaprobably not optimal for a produciton vk driver but the optimizations can come later easier
01:00as400 has quit [Remote host closed the connection]
01:02as400 has joined #asahi-gpu
01:52i509vcbI'm going to take moving over fully to the sysval buffer a little more slowly, I've found that trying to do push constants, descriptors and vbo stuff at the same time as num_workgroups to be a bit hard to test properly
02:09ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
02:13ourdumbfuture has joined #asahi-gpu
02:23chadmed has joined #asahi-gpu
02:30jeisom has quit [Ping timeout: 480 seconds]
02:36ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
02:39cylm has quit [Ping timeout: 480 seconds]
04:49i509vcbI *think* this lowering is correct, not sure why vulkan keeps saying I am loading (0, 0, 0) through: https://gist.github.com/i509VCB/fce24eb2825733cc4bfacef043b398ba
04:50i509vcbWhich in the case of load_num_workgroups is this: https://gist.github.com/i509VCB/b343bb352ecaad0f23245330359add54
04:50i509vcbThe base is intentionally hardcoded to 0 as I have shifted other things over in the uniform registers
05:15i509vcbI guess I learned what happens when you use agx_usc_uniform on the same uniform registers twice
05:17i509vcbstill doesn't fix the issue where if the sysval being loaded has a binding that isn't zero always fails...
05:23novafacing992 has joined #asahi-gpu
05:28novafacing9921 has joined #asahi-gpu
05:35novafacing992 has quit [Ping timeout: 480 seconds]
05:35novafacing9921 is now known as novafacing992
05:50crabbedhaloablut has joined #asahi-gpu
07:32i509vcbagxdecode.dump.0000 seems to tell me this about the first uniform which should be a pointer to a sysvals struct:
07:35i509vcbI'll also link the preamble's nir, the 32x3 load seems suspcious with %5 being 2 where it should be 8?
07:35i509vcbI'd expect 32x3 %15 = @load_constant_agx (%13, %5 (0x8)) (access=none, base=0, format=r32_uint, sign_extend=0)?
09:18albertobasaglia has joined #asahi-gpu
09:36Misthios has joined #asahi-gpu
10:31Mary has quit [Quit: The Lounge - https://thelounge.chat]
10:50systwi has quit [Ping timeout: 480 seconds]
10:51systwi has joined #asahi-gpu
10:52Mary has joined #asahi-gpu
10:56Mary has quit []
10:56Mary has joined #asahi-gpu
11:10Mary has quit [Quit: The Lounge - https://thelounge.chat]
11:11Mary has joined #asahi-gpu
11:17jeisom has joined #asahi-gpu
11:38Ndfkjhw4 has joined #asahi-gpu
11:42ourdumbfuture has joined #asahi-gpu
11:44albertobasaglia has quit [Ping timeout: 480 seconds]
12:09alyssathis would load the /address/ of the sysval, you need to wrap this whole thing in a load_const_agx
12:10alyssasince you put the address int he buffer and then you need to load from the address int he buffer
12:11alyssaagx_usc_uniform works like a memcpy: move the contents of this GPU memory into these uniforms
12:11alyssaif you want to put an address in a uniform, you need to pool_upload the address to the cmdbuf pool and pass /that/ address to usc_uniform
12:12alyssa(alternatively, you could pass the entirety of the sysval buffer to agx_usc_uniform and then use the load_sysval_agx you implemented above, without the load. but that is very chunky since you dont use most of those uniforms in a given pipeline, which is why the gl driver has the layout code.)
12:14cylm has joined #asahi-gpu
12:19ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
12:29ourdumbfuture has joined #asahi-gpu
12:47maria has quit [Read error: Connection reset by peer]
12:47maria has joined #asahi-gpu
13:03systwi has quit []
13:04systwi has joined #asahi-gpu
13:18Mary has quit [Quit: The Lounge - https://thelounge.chat]
13:18Mary has joined #asahi-gpu
13:51ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
13:55ourdumbfuture has joined #asahi-gpu
14:49ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
15:15lena6 has quit [Remote host closed the connection]
15:55mikee3000 has quit [Quit: WeeChat 3.8]
16:08jeisom has quit [Ping timeout: 480 seconds]
16:11DarkShadow4444 has quit [Quit: ZNC - https://znc.in]
16:11DarkShadow44 has joined #asahi-gpu
16:18mikee3000 has joined #asahi-gpu
16:47ourdumbfuture has joined #asahi-gpu
16:50nela has quit [Ping timeout: 480 seconds]
16:59nela has joined #asahi-gpu
17:17ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
17:33ourdumbfuture has joined #asahi-gpu
17:44ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
18:25Mary2 has joined #asahi-gpu
18:37Mary2 has quit []
18:57ourdumbfuture has joined #asahi-gpu
19:07ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
19:11flom84 has joined #asahi-gpu
19:28ourdumbfuture has joined #asahi-gpu
19:33crabbedhaloablut has quit []
19:36flom84 has quit [Ping timeout: 480 seconds]
20:16V has quit [Ping timeout: 480 seconds]
20:23ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
20:24V has joined #asahi-gpu
20:34ourdumbfuture has joined #asahi-gpu
20:40Z750 has quit [Quit: bye]
20:40Z750 has joined #asahi-gpu
20:40Z750 has quit []
20:41Z750 has joined #asahi-gpu
20:44ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
20:50amarioguy has joined #asahi-gpu
21:16jeisom has joined #asahi-gpu
21:24ourdumbfuture has joined #asahi-gpu
21:25chadmed has quit [Ping timeout: 480 seconds]
21:26akemin_dayo has quit [Ping timeout: 480 seconds]
21:48ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
22:10ourdumbfuture has joined #asahi-gpu
22:14darkapex has quit [Remote host closed the connection]
22:15darkapex has joined #asahi-gpu
22:20chadmed has joined #asahi-gpu
22:35cylm_ has joined #asahi-gpu
22:36cylm has quit [Ping timeout: 480 seconds]
23:01ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
23:09ourdumbfuture has joined #asahi-gpu
23:35ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]