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

Compile Slang to web assembly. #5092

Closed
csyonghe opened this issue Sep 17, 2024 · 7 comments
Closed

Compile Slang to web assembly. #5092

csyonghe opened this issue Sep 17, 2024 · 7 comments
Assignees
Labels
goal:client exploration Speculative work for a potential use case.

Comments

@csyonghe
Copy link
Collaborator

No description provided.

@csyonghe csyonghe added this to the Q3 2024 (Summer) milestone Sep 17, 2024
@bmillsNV bmillsNV added the goal:forward looking Feature needed at a later date, not connected to a specific use case. label Sep 17, 2024
@jkwak-work
Copy link
Collaborator

What would take to get this working?

@csyonghe
Copy link
Collaborator Author

  1. Setup emscripten build toolchain and use it to build the slang.dll
  2. Fix all compile errors and system library dependencies so things to work. Mostly we need some work on the filesystem calls.
  3. Figure out how to export slang.dll symbols as web assembly interfaces. C functions should work just fine but we need a way to export all of our COM interfaces to something callable from javascript.
  4. Integrate this into CI and make our releases include webassembly builds.
  5. Figure out how to reduce our stdlib to not include decls not needed for webgpu so the total binary size is small, targetting <5MB.

@tangent-vector
Copy link
Contributor

tangent-vector commented Sep 18, 2024

For (5) in the list there, we could conceivably walk the decl hierarchy and strip out any public API that isn’t usable on that target based on capabilities. We should be able to strip the IR for the stdlib the same basic way.

@aleino-nv
Copy link
Collaborator

This all makes sense but why is this in the current sprint? This is needed for WGSL/MS4 and we are working on MS1 now.

@csyonghe
Copy link
Collaborator Author

We put it in current sprint because we think the intrinsic work would be done soon with Jay and me helping, so we can free you to work on this early.

@csyonghe
Copy link
Collaborator Author

@aleino-nv After you've done with the misc intrinsics, the only pieces left are just textures and atomics, which will be implemented by Jay and me. There isn't much we can do about testing without rhi, and I consider vertex/fragment support to be lower risk than web-assembly compilation, so let's try to derisk things early.

@jkwak-work jkwak-work added goal:client exploration Speculative work for a potential use case. and removed goal:forward looking Feature needed at a later date, not connected to a specific use case. labels Sep 18, 2024
@aleino-nv
Copy link
Collaborator

Split into #5115 #5116 #5117 #5118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
goal:client exploration Speculative work for a potential use case.
Projects
None yet
Development

No branches or pull requests

5 participants