Silk.NET icon indicating copy to clipboard operation
Silk.NET copied to clipboard

Improve string marshalling performance by using performant .NET APIs

Open Perksey opened this issue 4 years ago • 0 comments

The following discussion from #505 should be resolved:

Please forward to Utf8.FromUtf16 on >= netcore3.0 Something like

#if NET5_0
Debug.Assert(Utf8.FromUtf16(input, span, out _, out convertedBytes, true, true) == OperationStatus.Done);
#endif

We probably don't care for the returned status, it can only be done, or theoretically, DestinationTooSmall but that can only happen if GetMaxSizeOf fails. (If you don't think this is fit for this PR, do just reference this in a new issue, and I'll get back to it asap, we absolutely need to track this though, perf of the string marshalling is miserable)

Perksey avatar Jun 07 '21 19:06 Perksey