You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[browser][JSImport] Support for marshaling float memory views #97380
Thankyou for looking at this. Taking a quick look at the various WASM doco and the WebGPU API, the ability to move data across the .Net/WASM/JavaScript divide with as little ceremony and no transformation is important for performant apps. If we want C# to be a top contender we have to deal with this.
What is stopping the full range of javascript TypedArrays being supported? (sans clamped ones)?
This is not exhaustive list, but I guess if you understand the pattern you will be able to follow it and find all places.
What is stopping the full range of javascript TypedArrays being supported? (sans clamped ones)?
Other priorities, and also so far nobody asked for it. If you plan to work on it, please start with float and see if you can deliver that before you broaden your scope.
Just to make it clear, what you get for double already is TypedArray, it's view or simple wrapper around it.
Activity
pavelsavara commentedon Jan 23, 2024
cc @eeegs
eeegs commentedon Jan 24, 2024
Please include arrays too - float[].
Thankyou for looking at this. Taking a quick look at the various WASM doco and the WebGPU API, the ability to move data across the .Net/WASM/JavaScript divide with as little ceremony and no transformation is important for performant apps. If we want C# to be a top contender we have to deal with this.
What is stopping the full range of javascript TypedArrays being supported? (sans clamped ones)?
Can we discuss the mechanisms involved?
pavelsavara commentedon Jan 24, 2024
Added above.
Mostly, this could be nice copy & paste PR from contributor (hint hint ..).
You just follow example of
double.There is
C# public API of the runtime in
System.Runtime.InteropServices.JavaScript, this needs to pass API review process.Update the code generator.
C# methods for the generated code marshaler
Update the JS side of the marshaler for array, segment
update unit tests, more
update docs,
This is not exhaustive list, but I guess if you understand the pattern you will be able to follow it and find all places.
Other priorities, and also so far nobody asked for it. If you plan to work on it, please start with
floatand see if you can deliver that before you broaden your scope.Just to make it clear, what you get for
doublealready isTypedArray, it's view or simple wrapper around it.