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
I found the library is using texture copy inside AllocateReadOnlyTexture2D<T,TPixel>(), however the texture copy method is not exposed to public.
The idea is able to create a texture processing pipleline like this:
Upload ->CopyTo Texture -> Process Texture ->Readback result
Rationale
I'm trying to use ComputeSharp to build a fast image resize/resample pipeline for AI Model(ONNX) inference, the stream from video source is RGBA32 format, I wish I could use UploadTexutre2D to upload the stream then copy it to ReadOnlyTexture2D .
Proposed API
Add CopyTexture<TSource,TTarget>(Texture texture) to UploadTexture.
Drawbacks
TBD
Alternatives
Other thoughts
It is also suggested add a customer type mapper to allow map user data structure to DXPixelFormat just like DXGIFormatHelper. User can create UploadTexture/ReadOnlyTexture with the custom mapper to
Map ImageSharp pixel formats directly to DirectX PixelFormats without MemoryMarshal.Cast()
use DXGI_FORMAT_NV12 directly from DXVA GPU decoded video frame
example:
device.AllocateUploadTexture2D(ReadonlySpan buffer, int w, int h, DXGITypeMapper mapper );
Thanks
The text was updated successfully, but these errors were encountered:
Description (optional)
I found the library is using texture copy inside AllocateReadOnlyTexture2D<T,TPixel>(), however the texture copy method is not exposed to public.
The idea is able to create a texture processing pipleline like this:
Upload ->CopyTo Texture -> Process Texture ->Readback result
Rationale
I'm trying to use ComputeSharp to build a fast image resize/resample pipeline for AI Model(ONNX) inference, the stream from video source is RGBA32 format, I wish I could use UploadTexutre2D to upload the stream then copy it to ReadOnlyTexture2D .
Proposed API
Add CopyTexture<TSource,TTarget>(Texture texture) to UploadTexture.
Drawbacks
TBD
Alternatives
Other thoughts
It is also suggested add a customer type mapper to allow map user data structure to DXPixelFormat just like DXGIFormatHelper. User can create UploadTexture/ReadOnlyTexture with the custom mapper to
example:
device.AllocateUploadTexture2D(ReadonlySpan buffer, int w, int h, DXGITypeMapper mapper );
Thanks
The text was updated successfully, but these errors were encountered: