00:06androidui: unfortunately it seems almost every "virtio-pci" device uses a different interface for registering with the PCI itself
00:06androidui: meanwhile RVVM's pci interface is almost entirely different
00:06androidui: { vendor_id; device_id; class_code; prog_if; rev; irq_pin; bar[PCI_FUNC_BARS]; } pci_func_desc_t;
00:11androidui: idk how to port it ;-;
15:07zmike: eric_engestrom: maybe you https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/964
15:12eric_engestrom: zmike: sorry, I really don't know piglit's core code, can't review that :(
15:24eric_engestrom: soreau: (late reply to your question on friday about mesa!31725) I think daniels/zmike/ajax would be my go-to for dri+modifiers reviews
15:25zmike: that MR confuses and upsets me
15:32soreau: eric_engestrom: thanks
15:39soreau: zmike: daniels: ping for review on https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31725
21:45Company: jenatali: Can I pick your brain a bit about GTK on Windows?
21:45jenatali: Sure?
21:45Company: GTK is a GL or Vulkan app
21:46Company: on Wayland that is great, on Windows it's not
21:46Company: because Windows is all about DirectX
21:46jenatali: I mean, Windows supports GL and VK
21:46Company: also, because GL/Vulkan on WIndows are optimized around opaque fullscreen stuff and not about desktop apps
21:47Company: and I'd like to figure out how to get us closer to rendering on Windows
21:47jenatali: So what's the problem?
21:49Company: the first thing is that I don't understand how compositing works on Windows
21:49DemiMarie: Company: Can you use Mesa's Dozen?
21:49Company: like, I need to enable GDI to get transparency support?
21:49Ermine: ship with mesa's vk driver *ducks*
21:50jenatali: Ah, yeah ok I see the problem
21:50DemiMarie: jenatali: What would it take for Dozen to reach Vulkan 1.3 + enough extensions for OpenGL 4.6 via Zink?
21:50jenatali: Demi: A lot
21:51Company: there's also lots of stuff on Google about take DXGISwapChains and using EXT_external_objects to import them as backbuffer into GL
21:51jenatali: Okay well probably not too much to get close, but there's at least one minor feature in 1.3 that D3D doesn't spec, which is that memory footprint for textures must strictly decrease as the texture size decreases
21:51jenatali: Company: So fundamentally, Windows has 2 compositing models, similar to Linux. GDI is like X, there's a single global render order and compositing is done "as if" you were drawing to the screen, for the most part
21:53jenatali: And then there's the DWM (desktop window manager) and DComp (Direct Composition), which look like Wayland, and let you take advantage of the fact that the desktop is actually retained these days
21:54Company: should I think about DComp stuff as running in the compositor or in the client?
21:54jenatali: Fundamentally the problematic difference for you is that GL and VK drivers (typically) interact with the graphics kernel directly, through the publicly documented WDDM interface. D3D drivers interact with that through an abstraction on top of that interface, which lets D3D fill in some pieces
21:54jenatali: DComp has client APIs that let you tell the compositor what to do
21:55jenatali: For shared resources, specifically, GL/VK can open resources that D3D creates, but not the other way around. A GL/VK driver can open a resource because they see driver-specific data that the same driver stack wrote in another process. But for D3D to open a resource, it needs not just driver-specific data, but D3D-specific data
21:55Company: so I build a compositing graph of sorts and the compositor composites it - with a more powerful API than wl_surface + wp_viewport + whatever
21:56jenatali: And since the compositor runs on D3D, it can only open resources that D3D creates
21:56jenatali: Company: Correct
21:56jenatali: So for GL/Vk, their present model is that they open GDI surfaces in the client process and blit into them. For DComp, the model is that the client allocates and shares it to the compositor
21:57jenatali: Things like alpha transparency in GDI is... ugly. It's nicer in DComp but that does require having a D3D step in the way
21:57Company: I suppose what the drivers do depends on the flags you set when creating the swapchain?
21:57Company: and the features of the driver itself?
21:58Company: or when setting the pixelformat in WGL
21:58jenatali: It's more that on Windows, unlike Linux dmabufs which are just memory, shared resources marshal all of the metadata of creation properties (like format, width, height, pitch) along with the shared handle
21:58DemiMarie: jenatali: Is Dozen a solution to this problem?
21:58jenatali: So for D3D to figure out WTF you opened, it needs to have it in a D3D-understood format
21:58Company: right
21:58jenatali: Demi: Yes, Dozen uses a DXGI/DComp swapchain
21:59Company: so I would probably want to do some DComp setup inside GTK
21:59DemiMarie: jenatali: Do all of the major IHVs provide GL and Vulkan drivers on Windows?
21:59Company: and then let Vulkan/GL render into some offscreen and composite that
22:00Company: DemiMarie: yes, but lots of them target games
22:00jenatali: Demi: 3/4 IHVs provide GL (QC uses GLOn12). All 4 currently provide Vk, though QC only started with their latest iteration (Snapdragon X). Older QC generations require Dozen
22:01Company: jenatali: one thing I wondered while reading through this stuff - has there ever been talk about vkSwapChainCreateFromDXGISwapchain or some integration between the two?
22:01jenatali: GLOn12 is often more performant than the native GL drivers on Windows though...
22:02jenatali: Company: Our hope/goal is to get Vk to be able to layer on top of https://learn.microsoft.com/en-us/windows/win32/comp_swapchain/comp-swapchain-portal at some point
22:03DemiMarie: jenatali: did you see the presentation that showed using Mesa on WDDM?
22:03jenatali: Yeah I'm aware
22:03jenatali: It's cool stuff
22:03Company: to me that sounds like I want to move towards a DComp layer for GTK toplevels
22:04Company: and then plug the WGL buffer in there somehow
22:04Company: either by drawing to a swapchain buffer directly via EXT_external_object
22:04Company: or by creating a child HWND and letting WGL draw do that
22:05jenatali: yeah that sounds about right
22:05Company: which of the two sounds like it'd work better?
22:05Company:bets the answer is "depends on the driver"
22:06Company: and then I can use DComp to implement https://blog.gtk.org/2023/11/15/introducing-graphics-offload/
22:06Company: and make the equivalent of our DmabufTexture be a D3D12ResourceTexture
22:07Company: and then all I need to do is find a gsoc student to write a D3D renderer
22:08jenatali: EXT_external_object is tricky to get right. If you're directly sharing a D3D swapchain buffer, D3D needs to be the first writer into the resource every frame, otherwise you miss inserting the implicit sync 🤢 that prevents the GL/Vk writer from overwriting the surface while the compositor is reading from it
22:09jenatali: That sync is inserted by a special case in D3D when it detects a write. Which is why D3D12 doesn't allow UAV (storage image) to swapchain back buffers, because it's not detectable
22:09jenatali: The comp swapchain I linked doesn't have that egregious design flaw...
22:10jenatali: But, assuming you do that, then probably the sharing approach would be better
22:11Company: that sounds like the solution is to go with the child HWND first
22:11Company: and then add the comp swapchain as an optimization for when the right features are supported
22:12DemiMarie: Company: which features?
22:12Company: I can figure that out when I get there :)
22:14Company: jenatali: how do I solve the opacity problem?
22:15jenatali: Honestly I dunno
22:15jenatali: I work on D3D, I'm only familiar with windowing systems as far as it interacts there
22:15jenatali: The D3D team also owned DXGI at some point in the past but we've never owned DComp, that's the compositor team
22:15Company: for all I care, you work on Mesa, so you're paid to know about GL and Vulkan :p
22:16jenatali: Sure, the D3D team also owns the GL/VK integration into Windows
22:16DemiMarie: Company: is D3D an option?
22:17jenatali: Feel free to embed a static link of GLOn12 or ANGLE if you want
22:17Company: jenatali: doesn't D3D do transparency?
22:17jenatali: D3D only goes as far as rendering an alpha channel into a texture. How that gets interpreted by the compositor is something else
22:17jenatali: And then you have to deal with things like hit-testing
22:18Company: hit-testing is an entirely different task in GTK luckily for me
22:18Company: and also not really that relevant because nobody cares outside of maybe rounded corners
22:19DemiMarie: Ugh, rounded corners!
22:20Company: so my problem with Vulkan/GL and transparency is that they talk to WDDM and not to DComp - or rather, they don't allow me to influence how they talk to DComp and say "I would like transparency plz"
22:22jenatali: Moreso that they only know how to interact with GDI and not DComp, and getting GDI transparency is complicated
22:22Company: because my AMD driver only gives me VK_FORMAT_R8G8B8A8_UNORM but only COMPOSITE_ALPHA_OPAQUE_BIT_KHR
22:22jenatali: I think. Idk I haven't tried
22:23Company: that was helpful
22:23Company: thx
22:24jenatali: Glad I could help
22:29DemiMarie: Company: Is putting a D3D layer in between an option?
22:29Company: DemiMarie: the problem with D3D is that somebody needs to write that code
22:29DemiMarie: jenatali: What do you think about having Mesa someday be the official UMD for Windows?
22:29DemiMarie: Company: you?
22:30jenatali: It's not up to me
22:30Company: if I had a D3D renderer, I'd just use it - but I don't (yet?)
22:30jenatali: By which I mean, it's not up to us. We're not in the business of shipping drivers
22:30jenatali: Company: You can ship a GL->D3D layer?
22:30Company: yeah, that's an option
22:30DemiMarie: jenatali: GTK is moving to Vulkan.
22:31jenatali: So ship dzn?
22:31jenatali: It's all open source so it can be embedded if you want
22:31DemiMarie: (which reminds me that using Vulkan will e-waste some Arm boards that have hardware GL but only software VK)
22:31Company: GTK is supporting GL, GLES and Vulkan equally well atm
22:31DemiMarie: Company: thanks for the correction
22:32DemiMarie: Company: I was thinking of using D3D for a blit
22:32Company: us using Vulkan is mostly because people here thought that's the best default
22:32DemiMarie: Or rather having D3D create the resource and VK render into it.
22:32jenatali: I wouldn't complain about having a customer that might actually contribute improvements instead of just bug reports :P
22:32Company: jenatali: the GTK Windows code is in pretty rough state
22:33Company: jenatali: most of our apps are Linux only (or if they ship on Windows they care very little) and the 2 big ones - Inkscape and Gimp - were stuck on GTK2 for too long which made the Windows thing deteriorate
22:33Company: plus we used autotools and autotools and Windows don't mix
22:34jenatali: Ah yeah
22:34jenatali: I'm glad we started working with Mesa after the meson switch
22:34Company: I just decided this month to look at it again with meson's VSCode integration work, and I am pleasantly surprised
22:35Company: I think I can develop from inside VSCode
22:35Company: jenatali: how do you actually develop?
22:35Company: Mesa uses meson, too, after all
22:35jenatali: Meson to generate a VS project
22:37Company: and then when you do build system stuff you regenerate that VS project after every change?
22:37DemiMarie:hopes autotools is officially deprecated
22:37jenatali: Yeah, it's pretty quick
22:37DemiMarie: Ideally the VS project could regenerate itself as needed.
22:37Company: I should try VS
22:38jenatali: Demi: It does
22:38Company: it apparently has better debugging stuff - like an actual profiler
22:38jenatali: Indeed
22:38DemiMarie: jenatali: does it happen automatically if the Meson files are changed?
22:38DemiMarie:has not profiled in years
22:38jenatali: Yes
22:38DemiMarie: nice
22:39DemiMarie: Company: how much of GTK’s performance issues are uniformly slow code due to too much pointer chasing?
22:39Company: first we have to define what we mean with "GTK's performance issues"
22:40DemiMarie: you mentioned profiling, so I assumed you are interested in performance work
22:41Company: yeah, but that's mostly stuff like figuring out if the Windows backend code does something dumb
22:41Company: like using GDI when it should use DComp
22:42DemiMarie: I see. I was wondering if GObject is itself a major performance problem for GTK.
22:42Company: again, depends
22:42Company: I think GObject is much worse in terms of lacking modern language features that developers want who use bindings
22:42Company: GObject itself doesn't do very much
22:45Company: that's not quite true, but the way it's mainly used these days as an RTTI system, it isn't quite performance relevant
22:46Company: the problems with GObject happen when people use RAD stuff, because then the marshaling overhead can make things slow
22:47DemiMarie: Marshaling overhead?
22:48Company: when you use xml to bind your application state to GTK widget properties and have them update once per frame
22:48Company: for 100s or 1000s of widgets
22:49Company: like After Effects for example
22:56Company: DemiMarie: the biggest problems with GTK in terms of performance is that computers are so fast that nobody needs to care about it and then developers get hit with them using O(N^2) alogithms once somebody adds lots of whatever in their apps and get really surprised
22:57Company: ie GTK is rarely pushed to its limits