00:01fdobridge: <gfxstrand> https://gitlab.freedesktop.org/gfxstrand/mesa/-/blob/nak/main/src/nouveau/compiler/nak_nir_lower_tex.c#L83
00:01fdobridge: <gfxstrand> Yup! NAK already has it.
00:08fdobridge: <airlied> yeah I type a little, but I think I ran into RA 😛
00:12fdobridge: <airlied> https://gitlab.freedesktop.org/airlied/mesa/-/commits/nouveau-codegen-texclamp-wip is @mhenning or @karolherbst care to figure it out
00:24fdobridge: <karolherbst🐧🦀> is it guarenteed that the clamp is constant?
00:26fdobridge: <karolherbst🐧🦀> @airlied I think some of codegen expects that there is no array source and things mess up 🙂
00:30fdobridge: <gfxstrand> I don't think that's guaranteed, no.
00:31fdobridge: <gfxstrand> NAK also handles offsets properly. 😝
00:32fdobridge: <karolherbst🐧🦀> this entire tex handling is madness, for me that's already reason alone to ditch it for something new...
00:33fdobridge: <karolherbst🐧🦀> anyway..
00:33fdobridge: <karolherbst🐧🦀> I doubt it will be simple to add to codegen without a lot amount of pain
00:33fdobridge: <karolherbst🐧🦀> ehh wait...
00:34fdobridge: <karolherbst🐧🦀> ohh no, it's actually simple
00:34fdobridge: <karolherbst🐧🦀> @airlied you have to adjust the code adding a zero source
00:35fdobridge: <karolherbst🐧🦀> I think this entire `if (i->tex.useOffsets) {` branch needs to be updated
00:36fdobridge: <karolherbst🐧🦀> you know what... with nir all this stuff is actually simple to implement
00:36fdobridge: <karolherbst🐧🦀> I think I'll spend some time to ditch _all_ that nonsense lowering and move it inside from_nir
00:36fdobridge: <karolherbst🐧🦀> and just emit the correct order from the start
00:36fdobridge: <karolherbst🐧🦀> I.. just have to figure out what that all is on each gen
00:38fdobridge: <karolherbst🐧🦀> uhh.. maybe there is more which needs to be changed
00:39fdobridge: <karolherbst🐧🦀> maybe I just start with volta+ and then move back gen by gen until it's all working
00:41fdobridge: <karolherbst🐧🦀> but first, we should enable some more `nir_lower_tex_options` flags and drop some code there
00:46fdobridge: <karolherbst🐧🦀> I also wonder why we even have `TEX_TARGET_RECT` in codegen...
00:59fdobridge: <mhenning> there's plenty of dead code sprinkled throughout codegen
00:59fdobridge: <mhenning> just to keep you on your toes
00:59fdobridge: <karolherbst🐧🦀> yeah though I think `TEX_TARGET_RECT` was always like.. not useful
01:12fdobridge: <airlied> @karolherbst I took a look for missing array index, I think RA had one bug fixing it didn't help
01:13fdobridge: <airlied> @gfxstrand I got NAK from black gears to white gears on the sascha gears demo with a NAK fragment program 😛
01:26fdobridge: <esdrastarsis> I was going to say this lol
01:26fdobridge: <esdrastarsis> I mean, they are black but becomes white sometimes
01:27fdobridge: <esdrastarsis> https://cdn.discordapp.com/attachments/1034184951790305330/1140456536737583174/20230813_22h25m28s_grim.jpeg
01:27fdobridge: <esdrastarsis> I was going to say I was testing this too lol (edited)
01:41fdobridge: <airlied> I made them white on front with a small bit of red flash inside. :-p
01:45fdobridge: <gfxstrand> :evil_gears:
03:13fdobridge: <airlied> @gfxstrand should the barycentric interp happen for NONE as well as SMOOTH?
03:16fdobridge: <gfxstrand> I don't remember. I think so. Whenever we have `load_interpolated_input`, it's interpolated. If it's flat, it's just `load_input`.
03:19fdobridge: <airlied> pushed to the same MR
03:40fdobridge: <esdrastarsis> I think `INTERP_MODE_NONE` causes a regression in the triangle example
03:51fdobridge: <airlied> it's incorrect before that, just less obviously from what I can see
04:02fdobridge: <airlied> also I think the IPA encoding crossed the streams
04:05fdobridge: <airlied> not sure if the .. ranges are inclusive
04:27fdobridge: <airlied> smashing the delays to 15 fixes triangle and gears
04:28fdobridge: <airlied> NVK_DEBUG=serial that is
04:35fdobridge: <esdrastarsis> It fixes all examples that have rendering issues lol
04:48fdobridge: <airlied> just smashing delays to 15 doesn't help it needs some of other sched fields
04:49fdobridge: <esdrastarsis> You mean the values of the sched fields that you changed in the MR?
04:51fdobridge: <airlied> nope, I just pushed a "gfxstrand tells me I'm wrong" fix to the MR
04:52fdobridge: <airlied> gears/triangle/texture all seem to work with it
05:00jtgd: Just curious, what is fdobridge bridging to/from?
05:00fdobridge: <airlied> discord
05:01jtgd: thx
05:57fdobridge: <![NVK Whacker] Echo (she) 🇱🇹> Interesting
06:20fdobridge: <airlied> I've also got a nvk-nak-hacks2 where I'm doing some small bit of dev, @gfxstrand I can MR them, but probably separate to the one I have now
06:24fdobridge: <![NVK Whacker] Echo (she) 🇱🇹> What would be needed to support nir_intrinsic_terminate?
06:34fdobridge: <airlied> I've no real idea, the discard/demote/terminate differences and what nvidia hw does are currently outside my knowledge
06:40fdobridge: <airlied> it might just be a matter of lowering them to kill, or there might be a different opcode which @karolherbst might have knowledge of
06:41fdobridge: <airlied> @gfxstrand the texture clamp test passed on nak
06:42fdobridge: <![NVK Whacker] Echo (she) 🇱🇹> For some reason SuperTuxKart needs nir_intrinsic_terminate with Zink (or it just crashes)
07:08fdobridge: <airlied> you could try just calling the kill paths to see how far it gets
07:14fdobridge: <![NVK Whacker] Echo (she) 🇱🇹> I tried using the same path as discard and demote in codegen (OP_DISCARD) but there was missing graphics
07:17fdobridge: <![NVK Whacker] Echo (she) 🇱🇹> So maybe scalar_block_layout implementation is required (or I just used the wrong path)?
07:32fdobridge: <airlied> no idea what the hw opcodes do, so as I said it might just need another path
09:08fdobridge: <karolherbst🐧🦀> it's all the same
09:14fdobridge: <karolherbst🐧🦀> soo.. the KILL instruction on nvidia disables all direct side effects (like memory stores), but the threads still participates in quads operates (like texture lod stuff)
10:53HdkR: I love that KILL works like that, it's so good
10:54HdkR: None of these shenanigans of messing with the execution masks for zombie threads for handling barycentrics or whatever :D
10:56fdobridge: <karolherbst🐧🦀> though the nir terminate instruction might require a full stop of the thread, but.... Might have to call `EXIT` instead here? Just no idea what that means in terms of doing it randomly
10:56fdobridge: <karolherbst🐧🦀> though `EXIT` is for the entire warp
10:57fdobridge: <karolherbst🐧🦀> or rather, it's just a special `KILL`
12:07fdobridge: <mohamexiety> iirc I did this a few months ago while I was playing with it and it failed the CTS
12:09fdobridge: <karolherbst🐧🦀> maybe we need proper lowering for terminate then
12:14fdobridge: <![NVK Whacker] Echo (she) 🇱🇹> I tried OP_EXIT and it didn't yield much results either
12:28fdobridge: <![NVK Whacker] Echo (she) 🇱🇹> 🤔
12:28fdobridge: <![NVK Whacker] Echo (she) 🇱🇹> https://cdn.discordapp.com/attachments/1034184951790305330/1140623026350735411/Screenshot_20230814_152820.png
12:29fdobridge: <rhed0x> at least the shadow map works 🙃
17:45fdobridge: <karolherbst🐧🦀> So I need this actually, because the CL CTS tests it:
17:45fdobridge: <karolherbst🐧🦀> ```
17:45fdobridge: <karolherbst🐧🦀> bool a_var[2] = { INIT_VAR(1), INIT_VAR(1) };
17:45fdobridge: <karolherbst🐧🦀> volatile global bool* p_var = &a_var[1];
17:45fdobridge: <karolherbst🐧🦀> ```
17:45fdobridge: <karolherbst🐧🦀>
17:45fdobridge: <karolherbst🐧🦀> ehh wait.. is that even legal code
17:45fdobridge: <karolherbst🐧🦀> ehh
17:45fdobridge: <karolherbst🐧🦀> wanted to post this somewhere else.. too late 😄
17:47fdobridge: <karolherbst🐧🦀> ahh yes, it's global if not speciifed
18:24fdobridge: <karolherbst🐧🦀> clang disagrees: `input.cl:6:37: error: initializer element is not a compile-time constant`
18:25fdobridge: <karolherbst🐧🦀> ehh
18:25fdobridge: <karolherbst🐧🦀> the error is something else, I messed up the first time: `input.cl:6:31: error: variable length arrays are not supported in OpenCL`
21:05fdobridge: <karolherbst🐧🦀> mhhh.. but I guess the spir-v could still do it
21:06fdobridge: <karolherbst🐧🦀> I wonder if spec constants are the answer here....
21:10fdobridge: <karolherbst🐧🦀> yeah... I have a brilliant idea (famous last words)
21:10fdobridge: <karolherbst🐧🦀> Faith will hate me for it
21:11fdobridge: <karolherbst🐧🦀> uhhh.... it doesn't work
21:13fdobridge: <karolherbst🐧🦀> I have another stupid idea
21:14fdobridge: <karolherbst🐧🦀> I already hate this feature