-
-
Notifications
You must be signed in to change notification settings - Fork 400
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
Should Silk.NET.Shaderc depend on Silk.NET.Shaderc.Native? #2007
Comments
I guess I have a similar question for Silk.NET.Vulkan and Silk.NET.Vulkan.Loader.Native. 🤔 |
It makes sense not to depend on the native package. It's a similar reason as to why the OpenAL native package is separate too. Many systems (especially on the Linux side) already contain the vulkan, spirv, openal etc libraries, so there's no real point in including the native packages. And also, some people like to provide their own versions of the libraries instead. Doing it this way gives the developer a choice on what to do, rather than it being forced by the library itself. |
This is a very good question. On one hand, we prefer the route of least surprise, which would be an argument for referencing the native package (everywhere except Linux that is, where it's expected that it's on the system or otherwise provided by a package manager). On the other hand, we don't want users who aren't using the native binaries to have to pull them in - they're beefy packages. It's worth noting for Vulkan specifically Khronos are very explicit in expecting this to be system-provided - we only introduced the loader native package for MoltenVK originally. I don't know where I stand here, because things like Assimp reference their native packages. @Beyley what do you think? cc @Khitiara as you're good at turning tech feelings and decisions into comprehensible sentences. |
Yeah, I think there are good arguments both ways here. For my part, I value consistency very highly. If that means not referencing native packages from any managed packages by default, I'm totally okay with that too. Perhaps it might be possible to have Silk throw an exception nudging users towards the relevant |
Most linux distros do not package shaderc, spirv-reflect or spirv-cross in shared library form (and obviously no other OS does at all either), so it makes sense we should reference the native package by default for these. |
Just noting that I'm happy to send a PR to fix up references once there's consensus and a decision from the maintainers on which managed packages should reference their native counterpart. Might be a good time to check all the published packages and make all the adjustments in one go? FWIW, here are some of my thoughts, incorporating comments in this issue so far:
|
I feel like this is probably the minority case, but I agree it's a use case that should be accommodated. The good news is that people who care about this can just do something like: <PackageReference Include="Silk.NET.GLFW" Version="2.20.0" ExcludeAssets="native" /> I just tested this with and without the |
These allow you to use D3D9/11 natively on linux (no wine) in Silk.NET, you just have to install the package and configure your GetApi call. Agree that it should be optional
Given Dawn's recent advancements in spec compliance, i'd feel happier if we provided Dawn native libraries and made those the default, with WGPU as an option for those who want it. But that will be something a contributor can tackle, since thats quite a big task that i personally dont have the time for right now.
it's of my opinion we should reference ALSoft for OpenAL, no one uses other implementations
100% in agreement here.
It depends on the driver for OpenGLES support. All major drivers do support it though (anything which can do D3D12 can do GL/GLES in Windows 11 through a translation layer provided by the OS). |
DXVK is primarily used on Linux given that Linux does not readily have a DirectX implementation. The non-Linux binaries are provided for posterity.
Noone's added it yet. The particular community contributor was only interested in iOS at that time, so only added it for iOS and iOS-like platforms; expecting to be used with AOT.
The Creative implementation is still quite actively used and is most notably made available as an auto-installable prerequisite in Valve's Steamworks. In addition, there are other bona fide implementations (such as MojoAL which is OpenAL-on-SDL).
Apple's implementation is good in that it forwards to the happy path/native APIs for macOS, and can be assumed to be of high quality despite it being relatively unchanged since icculus originally wrote it. However, it does not include all of the other functionality that OpenAL Soft provides in their own extensions. It depends what the developer is after, and because of this choice I don't think we should pull this in by default.
We continued the discussion wrt Steam Audio in our Discord. Notably Steam Audio doesn't actually play audio, it just encodes it, you still need something to receive the audio stream. We are undecided on how we want to proceed.
Windows can have native support. Most of the time one attempts to use OpenGLES on desktop explicitly because of ANGLE, which provides a relatively high quality trimmed down version of OpenGL implemented on top of other native APIs such as Direct3D, Vulkan, or Metal. More often than not it is used to create contexts in Direct3D-exclusive environments, or in environments where you can't trust the native OpenGL driver to be high quality. Notably all major browsers ship with ANGLE. ANGLE however is a minority implementation of OpenGLES, so it wouldn't make sense to pull this in by default.
I agree, Shaderc will always be the only implementation of the Shaderc API in all use cases, so it makes sense to pull this in by default. Ditto for the others.
While we introduced it for MoltenVK, the loader functions on all platforms. The
WGPU is not the only implementation of WebGPU, Dawn is also a very common implementation. In addition, in some cases the implementation included in Emscripten is used. Given that it is not the only implementation, and different implementations have differing appropriateness depending on needs (similar to OpenAL), I don't believe it should be pulled in by default. |
Note that these are just my personal opinions as a non-maintainer. @Beyley is the maintainer for 2.X and, along with the other maintainers, makes these decisions. |
Thanks for the feedback and clarifications! I agree with most points raised. It seems there's agreement on Shaderc, SPIRV.Cross, and SPIRV.Reflect, so I'll send a PR for those.
Didn't know DXVK supported that; that's pretty cool.
Ah, that's unfortunate. 😞 It seems like it still has some features (e.g. the physics-based propagation) that makes it worthwhile, though. (But I guess this is getting a bit off-topic.) |
I just happened to notice that Silk.NET.Shaderc does not pull in Silk.NET.Shaderc.Native as a dependency.
Obviously I can easily reference the latter myself, but it seems to usually be the case that the managed Silk.NET packages pull in their native counterparts as dependencies, so I wonder if this is intentional or just an oversight?
The text was updated successfully, but these errors were encountered: