-
Notifications
You must be signed in to change notification settings - Fork 245
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
Embed core module in wasm build. #5569
Conversation
/format |
🌈 Formatted, please merge the changes from this PR |
"UInt", | ||
"Index", | ||
"Count", | ||
"UIndex", |
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.
How will this code get updated if the names these types change?
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.
There is not a good way to guard against that unfortunately. But we shouldn't be changing the names of these types.
tools/slang-cpp-extractor/parser.cpp
Outdated
"UIndex", | ||
"UCount", | ||
"PtrInt", | ||
"intptr_t"}; |
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.
There is also uintptr_t
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.
Done.
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.
Looks good to me
Format code for PR shader-slang#5569
This change allows us to embed prebuilt core module in WebAssembly.
The main issue being fixed here is that some of our AST nodes contain fields of type
Index
orUInt
, whose sizes are architecture dependent. This means that the serialized module produced from x64 build system won't correct load by the web assembly module, which is 32-bit. The fix is to get rid of these arch-dependent int types in AST nodes.To prevent future regression, the slang-cpp-extract application is updated to report an error if it sees an AST node field is of such types.