-
Notifications
You must be signed in to change notification settings - Fork 187
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
[WGSL] [WASM] Add reflection endpoints + Fix bit manipulation operations #5499
[WGSL] [WASM] Add reflection endpoints + Fix bit manipulation operations #5499
Conversation
saipraveenb25
commented
Nov 5, 2024
- Add necessary layout reflection endpoints to Slang API's WASM bindings.
- Emit parenthesis around bit-shift, bit-xor and bit-or operations to avoid WGSL compiler complaining about precendence issues.
@@ -386,6 +386,47 @@ HashedString* ComponentType::loadStrings() | |||
return hashedStrings; | |||
} | |||
|
|||
ProgramLayout* ComponentType::getLayout(unsigned int targetIndex) |
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 is going to making really hard in javascript to ensure all these reflection objects are explicitly delete()
'd when they are no longer in use.
We should instead just return a raw pointer to the layout without allocating a fresh object on the heap, and use allow_raw_pointers
in emscripten bind, to free the javascript side from the responsibility of manually calling delete().
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.
Okay, let me see if I can change up the wasm bindings
/format |
🌈 Formatted, please merge the changes from this PR |
@saipraveenb25 this PR is still not ready to merge, can you fix the formatting? |
@saipraveenb25 do you have plans to change the pointer ownership model in the wasm binding here? |
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.
need another formatting pass. You can setup vscode to perform a format-on-save, so you don't need to worry about formatting anymore.