GaryHuan9 / Echo

An awesome ray traced 3D renderer build in C# from scratch!
MIT License
18 stars 3 forks source link

[Feature Request] New Asynchronous API to Echo.Core.Common.Compute #49

Closed GaryHuan9 closed 1 year ago

GaryHuan9 commented 1 year ago

Is your feature request related to a problem? Please describe. The Echo.Core.Common.Compute namespace works well for our main parallel rendering workload, however it needs to be more flexible for other applications such as pre-render compute or post-processing compositing.

Describe the solution you'd like A new type of Operation<T> that supports the asynchronous programming paradigm through custom Task like async method wrappers.

Additional context https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.asyncvoidmethodbuilder

https://github.com/dotnet/roslyn/blob/main/docs/features/task-types.md

https://devblogs.microsoft.com/premier-developer/dissecting-the-async-methods-in-c/

GaryHuan9 commented 1 year ago

More useful links: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/attributes/general#asyncmethodbuilder-attribute

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-7.0/task-types