00:04mriesch: hm i guesshttps://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/tiny/repaper.c#L512 could serve as blueprint for that
06:01Company: hrm, either I am wrong or v3dv is wrong
06:02Company: I put a textures[N_TEXTURES_SPECIALIZATION_CONSTANT] into my shader
06:02Company: and set it to the max number of supported textures by the hardware
06:03Company: and then I use a large if/else ladder to index it
06:03Company: if (id < N_TEXTURES_SPECIALIZATION_CONSTANT && id == 3)
06:03Company: return texture (textures[3], pos);
06:03Company: else if (id < N_TEXTURES_SPECIALIZATION_CONSTANT && id == 4)
06:03Company: ...
06:04Company: and now I blew this up to 32 entires - but the rpi has 16 texture units
06:05Company: and it seems to implode because it looks like it's trying to lower the texture (textures[16..31]) calls
06:05Company: which should be dead code because the if (id < N_TEXTURES_SPECIALIZATION_CONSTANT) doesn't trigger
06:06Company: and then dead code elimination should get rid of it
06:06Company: is that a bug in v3dv or in my interpretation of how specialization constants work?
08:42pq: Company, how does 'id' get its value in the shader sources?
08:45javierm: mriesch: https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/solomon could also be an example for what you want to achieve
08:46Company: pq: input variable
08:46Company: so it's dynamically uniform, but not constant
08:48pq: but if it's uniform and not constant at shader compile time, then how could the shader compiler know it can do that dead code elimination?
08:50pq: maybe you need a #define'd constant for the max id instead of using id itself for the dead code thing?
08:52Company: it's Vulkan, so I can't #define
08:52Company: all I can do is use specialization constants
08:52pq: well, any way you set compile time constants there
08:52Company: that's why I'm asking about specialization constants
08:53Company: and their semantics
08:53pq: ok
08:53Company: if it turns out I need to know at spirv compile time, I'm a bit screwed, because I don't have a builtin spirv compiler
08:54Company: I compile the spirv at build time
09:00dj-death: Company: the way it's implemented right now is that specilization constants are just replaced with constants while parsing spirv if I remember correctly
09:00dj-death: Company: so it's a bit surprising that v3dv won't remove the dead branches
09:01Company: maybe it does the lowering before dead code elimination
09:01dj-death: Company: unfortunately that's stuff you need to debug looking at NIR optimization passes
09:01Company: but I'm also curious about what *should* happen
09:02Company: doesn't help if I fix v3dv and then other drivers have the same issue, too
09:02dj-death: Company: possible... but really DCE should run way before stuff gets lowered
09:02Company: particularly closed ones
09:03dj-death: maybe it's more subtle
09:03dj-death: it could be that the driver relies on the variable array size
09:03dj-death: code might be get culled, but the array size is not shrinked and ...
09:03Company: hehe
09:04Company: first I want to figure out what *should* happen
09:04dj-death: it's implementation specific at this point
09:05Company: I was hoping some spec says something about it
09:10Company: because otherwise I'd just limit myself to 16 texture units because that's required by the spec
09:11Company: and then I don't need to play around with specializations there
09:52wv: I'm still on imx53/mesa/freedreno. Investigating why I have some color shift when drawing pixels https://pasteboard.co/0pX8YFTrtrGh.png
09:53wv: But while investigating, we stumbled upon something strange/interesting. It appears that the last column and last row of a surface are always black
09:53wv: Whether that's on weston surfaces, or just via plain drm
09:54wv: but only on imx53. We verified on imx6 too, and the issue seems not to be apparent there (at first sight)
09:58tursulin: mlankhorst, mripard, tzimmermann: could you merge one single patch to drm-misc-next please? https://lists.freedesktop.org/archives/dri-devel/2023-November/429029.html is the patch in question
10:37hakzsam: anyone knows if more 23.2 releases will happen?
10:37cmichael: eric_engestrom, ^
10:42mripard: tursulin: I'm on it
10:42mripard: you don't have commit access to drm-misc?
10:42mriesch: javierm: cool, thanks for the pointer
11:20tursulin: mripard: thanks for merging it! no, I don't have commit access.
11:27dj-death: jenatali: any bad experience with header files in clc?
11:31dj-death: jenatali: I have this #include "libanv_shaders.h"
11:31dj-death: jenatali: and somehow clc is failing with this message :
11:31dj-death: error: error reading 'libanv_shaders'
11:32dj-death: weirdly missing the .h suffix
11:35Company: dj-death: your idea of looking at nir instructions was great, thx
11:35Company: not because it answered my question, but because it showed me a subtle bug in my code that lead to the code not being dead and therefor not being eliminated
11:35dj-death: Company: oh nice
11:36Company: so Mesa does eliminate the code just fine now
11:36Company: I'd still like to know if the spec requires it though
11:38dj-death: I don't think so
11:44alyssa: dj-death: libanv_shaders.h eh?
11:45dj-death: alyssa: yeah, giving it a try
11:45dj-death: alyssa: no clue as to why the GRL shaders just work and this one fails
11:45alyssa: wheeee.
11:45alyssa: good luck ^^
11:45alyssa: I didn't have any #include issues fwiw,
11:46alyssa: but why are you including the generated clc output from the cl code itself?
11:46dj-death: yeah, I have no idea...
11:46alyssa: that seems.. circular..
11:46dj-death: alyssa: I'm just include a shared header between the host/gpu stuff
11:46alyssa: libagx_shaders.h is generated at buildtime
11:46alyssa: so header name collision at the very least?
11:47dj-death: I'm generating libanv_shaders_code.h
11:47alyssa: ah
11:47dj-death: like clang is crapping itself double freeing data
11:47dj-death: wtf...
11:47alyssa: dj-death: are you setting include paths properly from meson.build?
11:47dj-death: yeah
11:48alyssa: alright..
11:48dj-death: fun fact, if I move the include to #include "plop.h"
11:48dj-death: it'll report an error
11:48dj-death: file not found
11:51alyssa: ?!
11:51dj-death: alyssa: https://paste.debian.net/1297314/
11:53alyssa: karolherbst: ^^
11:53karolherbst: pain
11:54karolherbst: let's see...
11:55dj-death: why am I not running into this with GRL??
11:55karolherbst: kinda looks like an llvm bug
11:55karolherbst: jenatali might have some ideas here ^^
11:56alyssa: dj-death: dumb but consider renaming the .h :p
11:56karolherbst: what version of llvm is that?
11:57karolherbst: anyway.. we just call unique_ptr::release on memory and then it's up to LLVM to manage that
11:57karolherbst: and it seems like it fails to do that
11:58karolherbst: I haven't seen an error like that with llvm-16
11:58karolherbst: and llvm-15 is EoL
11:58karolherbst: so you might want to file a bug against your distribution
11:58dj-death: oh...
11:59dj-death: this is something to do with --prefix apparently
11:59karolherbst: anyway.. you need to specify all include paths explicitly
11:59dj-death: yeah I did
12:00karolherbst: sooo
12:01karolherbst: generally in CL it's advised to provide all files as buffers in RAM, so scanning for real files could cause issues as that's not well tested
12:01alyssa: wfm.
12:01dj-death: yeah forget it
12:02dj-death: it's all about me failing to parse the -- I think
12:09dj-death: 232M /home/djdeath/src/mesa-src/mesa-test/build/src/intel/compiler/intel_clc
12:09dj-death: alyssa: is it as bad for you?
12:10dj-death: alright file generated
12:10dj-death: nice
12:10dj-death: lunch is deserved.
12:21mripard: tursulin: you should ask for one, you have done far more work than required :)
12:48alyssa: dj-death: no
12:48alyssa: alyssa@blossom:~$ du -h /home/alyssa/mesa/build/src/asahi/clc/asahi_clc
12:48alyssa: 17M /home/alyssa/mesa/build/src/asahi/clc/asahi_clc
12:57Company: success - finally got Vulkan running on the rpi. Though it does seem to fall over if the process wants to use both GL (with GStreamer) and Vulkan (with GTK)
13:05kusma: Does anyone know what to do when the CI has decided that the hardware jobs aren't needed (...but they totally are?) https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25968#note_2156549
13:05biju: jmondi: Could you please take a look at https://lore.kernel.org/dri-devel/20231102150744.28736-1-biju.das.jz@bp.renesas.com/T/#m0f70c6a7b678e8559c402fcb1914574758477ec
13:06alyssa: kusma: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26060
13:07alyssa: perhaps relevant
13:07kusma: Oooh
13:07kusma: Yeah, that's probably it. Thanks! I totally thought this was due to the source-deps rules
13:08kusma: Of course, the "upgrade expected to occur until"-window was way passed even when the MR was merged :P
13:10kusma: Oh, I get it. This one restores it. It's very Monday for me, it seems ;)
14:27dj-death: alyssa: maybe you have release build
14:28alyssa: dj-death: don't think so
14:44austriancoder: ci_run_n_monitor.sh aborts with KeyError: 'rustfmt' - I am the only one seeing this on current main?
15:02DavidHeidelberg: austriancoder: I'm not in a front of computer, but gallo[m] MR should solve that (it's a occasional issue)
15:03austriancoder: DavidHeidelberg: thx
15:03DavidHeidelberg: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25940
15:13gfxstrand: Moment of truth... Do all the containers rebuild properly and does NVK pass CI?
15:16gfxstrand: Ugh... Still not in pypi. I thought it was. My brain must have done an ADHD and got things screwed up.
15:21gfxstrand: daniels: How horrible would it be to point pip at a git sha for the container build?
15:21gfxstrand: Or a git tag, rather.
15:21gfxstrand: (But I'm fine with a SHA if that's better)
15:30daniels: gfxstrand: that's totally fine if it works - we already do it for e.g. ci-fairy
15:31daniels: just stick a comment above it saying 'this is 1.2rc2ish'?
15:33gfxstrand: daniels: Ok, cool
15:58gfxstrand: Time to try again...
16:08jfalempe: tzimmermann, after running some profiling on a server with aspeed, there are a lot of page faults. When I run glxgears, there are 100k pgfault/s, and 70% of the CPU is in this function: https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/drm_gem_shmem_helper.c#L509
16:09jfalempe: curiously, it's only when running Wayland, with Xorg, there are almost no page fault.
16:11tzimmermann: jfalempe, shmem does unmap pages ASAP
16:12tzimmermann: we'd need a shrinker to delay that
16:12tzimmermann: i once did a prototype, and I think there was a patchset on dri-devel to implement shrinker support for shmem helpers
16:13tzimmermann: on the difference between xorg and others, IDK
16:15jfalempe: tzimmermann, that means a kind of delayed unmap ?
16:16tzimmermann: jfalempe, exactly. we keep pages mapped . linux will call the shrinker callback if it needs free memory. then we unmap.
16:16tzimmermann: jfalempe, that looks like the patchset: https://patchwork.freedesktop.org/series/102550/
16:18jfalempe: tzimmermann, ok thanks, that looks a big task. I was also wondering if it's possible to map the whole buffer instead of 4k page at a time.
16:32gfxstrand: Well, the container built.
16:44gfxstrand: Ugh... the meson upgrade breaks the rusticl build
16:44gfxstrand: https://gitlab.freedesktop.org/mesa/mesa/-/jobs/51253570
16:44gfxstrand: karolherbst, dcbaker ^^
16:48gfxstrand: Looks like link_with isn't causing a dep to build
16:51alyssa: https://rosenzweig.io/uff.txt
16:51alyssa: karolherbst: dj-death: oh no.
16:51karolherbst: classic clang moments
16:52karolherbst: alyssa: `-I/home/alyssa/mesa/build/src/asahi/lib/.[`?
16:52karolherbst: why the .[?
16:52alyssa: uhh
16:52karolherbst: that one also a bit sus: -I/home/alyssa/mesa/src/asahi/lib/.
16:52alyssa: karolherbst: because i'm bad at typing
16:52karolherbst: :(
16:53alyssa: ok with that fixed it finds the file
16:53alyssa: but with valgrind spewing errors deep in llvm.
16:57gfxstrand: ugh... libgallium.a exists so meson is building it. It's just not linking in properly?!?
17:01karolherbst: alyssa: wanna fix llvm?
17:01karolherbst: :P
17:04gfxstrand: It has a `-l static:+verbatim=src/gallium/auxiliary/libgallium.a` flag
17:08karolherbst: odd
17:08gfxstrand: https://gitlab.freedesktop.org/mesa/mesa/-/jobs/51253570
17:08gfxstrand: Yeah, it's really strange. The file is right there.
17:09karolherbst: yeah...
17:09karolherbst: seems that way
17:13gfxstrand: IDK why NAK is okay but rusticl isn't
17:13karolherbst: maybe something with updated meson?
17:14karolherbst: never seen that error, so no idea
17:16gfxstrand: Yeah, it's definitely something with the meson update
17:17gfxstrand: Let's look at 1.2.1 does
17:22gfxstrand: Ugh... unresolved import `libc_rust_gen` with mesa/main and meson 1.2.1
17:22karolherbst: pain
17:22karolherbst: I think 1.2.1 was also broken?
17:22karolherbst: I'm on 1.2.3
17:29gfxstrand: Yeah, 1.2.3 doesn't work either
17:29karolherbst: mhhh
17:29karolherbst: odd
17:29karolherbst: `unresolved import `libc_rust_gen`` that sometimes happen if the lib was built with an older rust compiler
17:30karolherbst: tried a clean build?
17:30gfxstrand: But I just torched my build dir
17:30gfxstrand: Like rm -r _build
17:30karolherbst: mhhh
17:30karolherbst: pain
17:30karolherbst: mind pasting the entire log?
17:32gfxstrand: Oh, now it built. :rolling_eyes:
17:32gfxstrand: Okay, I see what's happening.
17:33gfxstrand: Meson started adding paths for link things
17:33gfxstrand: So the working version does `-l static=gallium -L src/gallium/auxiliary` but the new does `-l static=src/gallium/auxiliary -L src/gallium/auxiliary`
17:41gfxstrand: https://github.com/mesonbuild/meson/issues/12484
17:41gfxstrand: Guess we get to wait for more meson bugs to be fixed. :weary:
17:48ccr: :/
20:42dj-death: is there a way to tell a NIR variable represent both a sampler & texture?
20:45gfxstrand: Not easily, no.
20:46gfxstrand: I've tried to split that multiple times but failed to get it totally clean.
20:47dj-death: gfxstrand: hmm :(
20:48dj-death: gfxstrand: maybe you know a way to tell from NIR shader whether a particular binding will be used a image-only/sampler-only/image-sampler-combined?
20:48gfxstrand: dj-death: You can chase all the derefs.
20:48dj-death: gfxstrand: I thought I figured that out a while ago, but I must have forgotten
20:48dj-death: ah okay
20:48gfxstrand: dj-death: Even there, though, Vulkan lets you alias so you aren't just looking for NIR variables, you're looking for bindings.
20:48dj-death: for buffers it's easier
20:50dj-death: gfxstrand: so if a shader uses only a binding as a sampler, can you assume that maps exactly to a SAMPLER type decriptor?
20:50gfxstrand: Nope
20:50dj-death: dammit :)
20:50gfxstrand: Could still be a combined image/sampler and the image part is unused
20:51dj-death: alright then
20:51dj-death: oh
20:52dj-death: so I might be looking at a CTS bug then
20:52gfxstrand: combined image/samplers were a mistake, IMO
20:52dj-death: because if the descriptor is mutable and includes a COMBINED version
20:52dj-death: then it has to write it as combined
20:53dj-death: or there is an issue with descriptor buffers
20:54dj-death: if you create a layout with combined, write it as sampler
20:54dj-death: how is the implementation supposed to know where to find the data?
20:55dj-death: because the layout has space for image+sampler
20:55dj-death: but the vkGetDescriptorEXT() doesn't have the information about the layout
20:55dj-death: so it doesn't know that there is an additional offset for where to put the sampler
20:56gfxstrand: is combined allowed with descriptor buffer?
20:58dj-death: gfxstrand: I have a comment in Anv that says no :)
20:58dj-death: gfxstrand: but I can't find the reference in the spec
20:58dj-death: and validation layers don't scream
20:58gfxstrand: Ah, the eternal Vulkan spec issue...
20:59dj-death: I think it's allowed
20:59dj-death: proposals/VK_EXT_descriptor_buffer.adoc:Buffers containing `VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER` descriptors must have been created with both
21:00dj-death: I guess I'm off to write a spec bug
21:01gfxstrand: Yeah, they're definitely allowed
21:01gfxstrand: There's this weird array property that affects them.
21:02dj-death: I don't know that Anv can do combined-image-sampler with mutable and descriptor buffers
21:02dj-death: I mean the information to put/fetch the data in the right place just isn't there
22:02alyssa: i heard you like ci speedups https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26084