From: Philip Rebohle Subject: Re: [PATCH] d3d12: Check for VK_KHR_external_fence_capabilities before using VkPhysicalDeviceIDProperties. Message-Id: <6a667399-da5e-28fd-5dee-25a709ad43ed@tu-dortmund.de> Date: Fri, 26 Feb 2021 00:33:17 +0100 In-Reply-To: References: <20210224205842.591939-1-z.figura12@gmail.com> <4b8621f3-b9a8-0101-33aa-3b60c11ff0bc@codeweavers.com> <1ab2f18e-7b35-caf9-4af7-e0ff6c976233@froggi.es> Am 25.02.21 um 23:17 schrieb Zebediah Figura (she/her): > On 2/25/21 3:59 PM, Philip Rebohle wrote: >> Am 25.02.21 um 17:38 schrieb Zebediah Figura (she/her): >>> On 2/25/21 10:18 AM, Joshua Ashton wrote: >>>> On 2/25/21 4:01 PM, Zebediah Figura (she/her) wrote: >>>>> On 2/25/21 7:00 AM, Joshua Ashton wrote: >>>>>> There is no reason to. This is core in Vulkan 1.1. >>>>>> >>>>>> You should just use a newer API version. >>>>>> There is no relevant driver that doesn't support this. >>>>> >>>>> Mesa's v3dv is an example of a driver that does not support Vulkan >>>>> 1.1. >>>> >>>> That is not relevant hardware: >>>> It is not capable of supporting D3D12. >>> >>> If it's capable of supporting vkd3d, it's capable of supporting d3d12 >>> ;-) >>> >>> (Granted, the former may actually not be the case, for lack of >>> KHR_shader_draw_parameters. I don't know if that's possible to >>> implement.) >>> >>> More to the point, though, there are more salient reasons to support >>> Vulkan 1.0: drivers not yet written (e.g. there is not yet a free NVidia >>> or Mali driver, nor a conformant software driver), drivers whose latest >>> versions are not accessible (e.g. the last version of MoltenVK that can >>> be built for MacOS Mojave only supports Vulkan 1.0), hardware which may >>> not be capable of supporting Vulkan 1.1 (if any exists), and less >>> painful bisection of Vulkan drivers down to old versions. Compared with >>> the cost of adding a couple lines, and that only because I happened to >>> run the validation layers, I'm not particularly inclined to believe >>> dropping support for Vulkan 1.0 is a worthwhile trade. >> >> If anyone ever asked me why vkd3d-proton exists as a fork, this would be >> a perfect example. >> >> The point Josh is trying to make here is that any new-ish driver project >> will of course be aiming for Vulkan 1.0 conformance with a limited >> feature set before adding all the optional stuff that was added later, >> simply because it's easier and faster to bring up. v3dv reached this >> point three months ago. It already supports a bunch of features that >> were promoted to Vulkan 1.1 such as the external memory stuff, but is >> still missing some others. It'll get there eventually. >> >> Thing is, the feature set that these young implementations provide is >> barely enough to support a D3D9 feature set, and that is if you emulate >> basic functionality like block-compressed textures because the Vulkan >> implementation doesn't even support those (v3dv can't due to hardware >> limitations, Swiftshader could but doesn't, etc.). If we're *very* >> generous, we're looking at a subset of D3D11 FL11_0 functionality with >> loads of inefficient hacks to make things like D3D11_DSV_READ_ONLY_DEPTH >> work, recompiling compute shaders with the exact view formats in mind >> because shaderStorageWriteWithoutFormat isn't supported, and the list >> could go on forever, there's so much that these drivers just do not >> support yet in any reasonable way. And god beware if anyone actually >> tries to use geometry shaders. >> >> For D3D12 you can't even emulate all the missing stuff. The binding >> model just doesn't give you enough information at the time command lists >> are being recorded to work around any of this. That is, if you actually >> implement it correctly and support update-after-bind semantics and >> descriptor indexing, which are not optional in D3D12. >> >> Has anyone other than Józef actually done any sort of research into how >> the API works and evaluated what kind of baseline feature set is >> required to drive a translation layer? The "Vkd3d known issues" page on >> winehq itself provides more than enough insight on why a baseline Vulkan >> 1.0 implementation simply cannot run this API even remotely reasonably. >> There are solutions to most of them nowadays, but a lot of the upstream >> vkd3d code has been written before those were available. >> >> I can sort of understand MoltenVK on Mojave as a somewhat valid reason >> to keep an old code path around, provided that there actually some D3D12 >> content working on that combination in the first place, but instead of >> making D3D work properly on platforms which *do* provide a good enough >> Vulkan environment, now we're discussing a feature that was promoted to >> the core Vulkan spec *three years ago* to cater to platforms that can't. >> >> And then people are wondering why we don't try to work with upstream >> anymore. > > Cards on the table, then: I really don't know what I'm talking about. > > I look at this code and say, "I don't know the consequences of making > that extension, or Vulkan 1.1, mandatory, but checking for the > extension's presence looks like a right solution and is easy." > vkd3d-proton exists as a fork because, for better or for worse, there > are those of us who are not willing to settle for that. > > My mistake here is trying to defend my choice on what I think are the > appropriate devil's-advocate grounds. Trouble is: I really don't know > what I'm talking about. I certainly haven't done that research you're > asking about. But as far as I see, vkd3d-proton also exists because both > sides got fed up with the other not responding to their concerns and > decided to stop interacting. Given the choice I'll make the mistake of > trying to fix that, at the risk of making some pretty bad arguments. > [Because someone has to, and no one else will.] > > The concern of changes like requiring 1.1 (and, more importantly, > dropping all the 1.0-specific code and feature checks) making it harder > to bisect was the only one that was actually raised to me as a salient > point; the others were my own points and should probably be ignored. If > nothing else, maybe we can argue about that part? Harder to bisect what though? I guess for MVK you do have a point there since Vulkan 1.1 support is still somewhat recent there, but the value of this will deminish as time passes (also, there's a boatload of other issues with trying to run D3D12 on Metal, but that's being discussed on the MVK issue tracker so I'm not going to go into detail on that front; safe to say that Metal itself is unfortunately not a very good API for layering purposes). For Mesa it's already not really useful to bisect very old issues in my experience; ancient Mesa versions are hard to build due to the LLVM build-time requirement as well and the drivers have seen significant changes since then as well (new compiler, tons of issues being caused by LLVM itself, etc). Unless a regression has happened within the last two or so major releases, it's probably more productive to just post a RenderDoc capture or small test case to reproduce an issue with and move on. Now arguably your patch doesn't really do anything that would mandate switching to 1.1; what really blew my fuse here is that in order to work around a validation layer bug you were asked to check for a ubiquitous extension from over four years ago instead of an equally ubiquitous extension from over three and a half years ago which also happens to be the one that validation is actually complaining about. One might ask if it's worth working around a validation bug that's likely to get fixed properly at some point in the first place, but in all fairness, there's arguments to be made for it especially if it has consequences other than some annoying log spew. FWIW, 1.1 turned out to be necessary to support Shader Model 6 (which is actively being used in newer D3D12 content, and was actually the last thing we *tried* to upstream with Hans-Kristian's dxil-spirv library, go figure), subgroup operations in particular, since there's no equivalent extension you can just enable on a 1.0 device, which left all the 1.0 fallback code there to rot and be a maintenance burden. Vulkan is still an evolving ecosystem and D3D12 is a moving target with new things being tacked on in every major Windows release, compromises for driver/hardware support will have to be made at some point as newer features get adopted. - Philip > >> >> - Philip >> >>> >>>> >>>> - Joshie 🐸✨ >>>> >>>>> >>>>>> >>>>>> - Joshie 🐸✨ >>>>>> >>>>> >>>> >>> >>> >> >