-
Notifications
You must be signed in to change notification settings - Fork 7.3k
[directx-dxc] Make compatible with macOS #44649
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
|
@microsoft-github-policy-service agree |
|
The idea is to pull the source code from DirectXShaderCompiler, compile with local environment then copy the target binary files into packages directory. Possible issue(s):
Hope there's better solutions for above issues. |
|
@WangWeiLin-MV May I have some feedback? |
|
@walbourn are these changes OK to you? |
|
I don't know how sustainable macOS support is here unless it can be made to work like Linux. The use of submodules rather than other dependent ports feels highly problematic to me. |
The reason of not using dx-headers port is that the latest dx-headers lib doesn't work with dxc. Even in the latest commit of original DXC repo, the referenced dx-headers is still using the version from 2022. It's not my responsibility to fix such compatibility issue, I'm here only to offer a possible solution for the requirement of enabling dxc library on macOS. If there's a better solution, that would be providing an official build for macOS platform. Thank you. |
By the way, the directx-headers port is not supporting osx either. Using submodule under this specific circumstance won't cause conflict between versions of the same library. |
This underlines the problems with the current appproach: |
Thank you for the comment. Then I'm curious why the compiled dxc binaries for Windows and Linux could be imported securely? IIUC, those binary also used 'vendored copy' of directx headers because they are compiled from the same repo which is referring to this 2022 directx headers lib. If what you said could be a problem, so does on these existing contents. |
|
Indeed, the port avoids conflicts by not installing ("directx") headers. @walbourn The problems with building from source using new directx headers start with a lot of duplicate definitions in the Windows polyfill ( |
Well, this PR I'm submitting also avoided installation of DirectX headers. Those involved outdated dx headers module are only used during compilation stage in the package installation process. The installed files are basically the same as how the Linux's are. No dx headers would be installed to the package folder. If the solution for Linux is acceptable, I don't see any difference between this solution for macOS and the solution for Linux except for whether the binary files is compiled as an official release or by user's local device. The following is the installed file list in this solution: and these are the installed file in Linux solution: What could be wrong if the Linux's is acceptable while this macOS's isn't? |
This was meant to capture what you presented in more detail in the last post. i.e. there is nothing more wrong with the resulting osx installation than with the linux installation. Except that the long-term perspective of osx support is officially unclear at the moment. directx-headers installs
|
Got it, thanks. Then should I hang up this update until official maintainers fix-up such conflict? |
|
|
||
| # for macOS platform: | ||
| # The DirectX Headers module seems not working with the latest version | ||
| # Therefore we manually download the specific version according to the original DXC repo |
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.
Have you submitted fixes for the DirectXHeaders repo?
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.
No, I don't think it's a simple issue to fix and I currently don't have such ability to fix it. I found other's PR to fix such issue but seems like it was not replied. microsoft/DirectXShaderCompiler: Update directx headers to facilitate future updates #6856
|
I appreciate the improvements to use VCPKG packages instead of direct git clones. Can you clarify what the scenario is here for having this code run on macOS? DirectX 12 is supported on Windows and on Windows Subsystem for Linux, but it doesn't work at all on macOS. |
Well, as dxc now support compiling HLSL to SPIRV, it could be used with Vulkan on macOS. In my personal scenario, I'm writing one piece of shader code that could be applied to both DX12 and Vulkan on all platforms. |
BillyONeal
left a comment
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 approval is contingent on @walbourn also approving
|
I realized that Vulkan SDK installation has a copy of dxc binaries within. It's not necessary to import an external dxc library. |
Fixes #44644
./vcpkg x-add-version --alland committing the result.