I am writing an application using DirectX11 Direct2D, part of which is loading and drawing sequence of image files in realtime (video overlay). The size of these image files vary (100x100 ~ 2000x2000 x RGBA). There will be optiziations, preloading(prebuffering) logic, but I want to understand what is the proper/best practice/method to do this.
Here is the current workflow, I follow:
1. Load file with WIC,
2. Convert to PBGRA bitmap (optional),
3. Lock the WIC pixels,
4. Create D2D1Bitmap using this pixel data
However, this seems to be a slow procedure. It bottlenecks at point #4 - transfering pixel data to the VRAM. So I am looknig for a faster way (ie - what is the fastest one).
So, is there a way to load image, in a form of texture, or other way, directly as a DirectX resource, so I can minimize the time for the whole process/iteration ?
Thanks in advance