-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Platform: add D3D12 to modulemap #35221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
CC: @egorzhdan |
@swift-ci please test |
@swift-ci please test |
Can we unlock these too? To make sure they are all compatible with the same version of Swift. XInput XINPUT1_4.DLL |
Sure, that seems reasonable; got a pointer to the docs for the covered API? |
Discussion: Should we place this module at |
Consideration: There’re many APIs in Windows which has many patches (for example,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works well for me (SourceKit produces a valid generated Swift interface for this submodule), however, I would agree with @stevapple's suggestion on naming: MSDN lists this header under "Direct3D 12 Graphics", could this submodule be located under WinSDK.Direct3D
or WinSDK.DirectX
?
Yes, if we are adding the remainder of the DirectX APIs, it makes sense to organize them as @stevapple was pointing out. Although, I plan on only doing the minimum for the requested set. The organization of the modules has been somewhat ... difficult, at least in the past, so I tend to do the most minimal evolution of the module. |
I think the bigger problem is about versioning the same API set (as for the case of |
@stevapple you cannot - the user is responsible for handling the version compatibility checking. That is one of the problems with not having control over the platform. The best you can do is augment the information with APINotes. |
To be a bit more clear, we already have the ability to have conditional versioning on Windows: if #available(Windows 10.0.18362) {
...
} else {
...
} I haven't made much use of the deployment target handling as of yet, but I don't see why that would not afford us the necessary support for the version checking. We can continue to bump the minimum supported SDK, but as long as the runtime can be backdeployed to 17763, I think that we are okay. The annotations would need to be per-API, but we could add availability information as an APINotes supplement to validate on deployment targets. The reason for the 17763 support to continue is that it is a LTSC release with support until 1/9/2029, and was the first version that I had targeted (due to missing APIs for UWP support in the earlier releases needed to support Dispatch and backtracing). This allows us to continue to deploy to various targets - the current implementation was carefully considered in order to be able to support Windows desktop (laptops/tablets/desktops), XBox, HoloLens, and Windows Phone. |
@STREGAsGate - I've added the DXCore bindings, but note that they are not usable. It requires the C++ interop to be functional, which is currently not fully working on Windows. There are problems with the modules (which is also why I prefer keeping the changes to the modules minimal) which prevent the C++ interop tests from even running on Windows with an updated environment. Once the module is well formed enough to allow the C++ interop to be used with a modern SDK, you should be able to use it with |
@swift-ci please test |
@swift-ci please test Windows platform |
Build failed |
Okay, we don't actually need DXCore. The functionality I would need is also found in DXGI so we could add that instead. We do also need to add D3d12SDKLayers though, which is where all the debug and validation tools appear to be. |
I mean we may introduce such headers with This is the best solution I’ve come up with. I don’t like the idea of bumping minimum target version either. Oppositely, we should lower the bound to use a Swift application. |
I don't think that we need the |
@swift-ci please test Linux platform |
Sry I edited my comment instead of posting again. |
Sorry for the silly request, while I could try to fish out the docs, I want to make sure that I get the correct header. Would you mind sharing a pointer to MSDN for the API surface so I can cross-check and validate the module setup? |
No prob. I think these are what you want. |
It seems that we should be okay with additional link directives to pick up the import libraries. The |
Add the module definitions for: - Direct3D v12 - XAudio 2.9 - XInput 1.4 Additionally, add the following, unusable modules: - DXCore DXCore requires C++ Support (C++11 or newer to be precise) and is not yet available until C++ interop can be made to work fully.
@swift-ci please test |
@swift-ci please smoke test macOS platform |
@swift-ci please test Windows platform |
Does this need any change in the VS2017 CI machines? Seems that at least |
Add the DirectX 12 header to the modulemap for the Windows SDK.
Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.
Resolves SR-NNNN.