Skip to content
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

Build SwiftShader native package for win-arm64 #2066

Closed
alexrp opened this issue Apr 13, 2024 · 4 comments · Fixed by #2143
Closed

Build SwiftShader native package for win-arm64 #2066

alexrp opened this issue Apr 13, 2024 · 4 comments · Fixed by #2143
Labels
Milestone

Comments

@alexrp
Copy link
Collaborator

alexrp commented Apr 13, 2024

This can't be done currently because of errors like this:

D:\a\Silk.NET\Silk.NET\build\submodules\SwiftShader\third_party\llvm-10.0\configs\windows\include\llvm\Config\llvm-config.h(44,1): error C1189: #error:  "unknown architecture" [D:\a\Silk.NET\Silk.NET\build\submodules\SwiftShader\build\third_party\llvm-10.0\llvm.vcxproj]

This is happening because of this code in SwiftShader's llvm-config.h which isn't handling Arm64:

https://github.com/google/swiftshader/blob/62c59c41e194c288c06739788bb0aad3c86b19bf/third_party/llvm-10.0/configs/windows/include/llvm/Config/llvm-config.h#L17-L23

Which then causes this error to happen:

https://github.com/google/swiftshader/blob/62c59c41e194c288c06739788bb0aad3c86b19bf/third_party/llvm-10.0/configs/windows/include/llvm/Config/llvm-config.h#L44

This should be fairly easy to patch on our end.

While doing this, we should also consider building SwiftShader with LLVM 16 instead of 10 (the default).

@alexrp alexrp added the enhancement New feature or request label Apr 13, 2024
@alexrp alexrp self-assigned this Apr 13, 2024
@Perksey
Copy link
Member

Perksey commented Apr 13, 2024

In our experience upgrading LLVM versions without dedicated engineering effort to do so always has unforeseen consequences. Recommend waiting for upstream to update here.

@alexrp
Copy link
Collaborator Author

alexrp commented Apr 14, 2024

Turns out this requires more build hackery than expected. I'll see how annoying the contribution process is and send some patches upstream if it's not too much.

@alexrp alexrp mentioned this issue Apr 14, 2024
38 tasks
@alexrp
Copy link
Collaborator Author

alexrp commented Apr 14, 2024

@alexrp
Copy link
Collaborator Author

alexrp commented Apr 15, 2024

Landed upstream: https://swiftshader.googlesource.com/SwiftShader/+/1eaac56def92dfadfb2f49695c7d3c5cd1e1274d%5E%21/

Just need to wait for the fix to flow to the GitHub mirror, then we can update our submodule and start building for win-arm64.

@alexrp alexrp added this to the 2.X milestone Apr 18, 2024
@alexrp alexrp removed their assignment Apr 22, 2024
Perksey added a commit that referenced this issue Apr 23, 2024
* Fix #2026

* Fix #2000, closes #2005

* Fix #2010

* Fix added AL bug (good thing we had tests!)

* Fix #1500

* Undo any unintentional changes

* Add nint overloads for things like VertexAttribPointer

* Fix build errors

* Add more standard cursor shapes

* Upversion natives where necessary

* Patch notes for 2.21

* Reorder literally a single line

* Incorporate #2143/#2066/#2090 in patch notes

* Implement IsExtensionPresent for WGL

* nit

* OpenXR updates?

* Fix flawed constant parsing for Vk/XR

* Add openxr to patch notes

* Update patch notes for 2.21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment