Re:Halley: Lightweight Game Engine Written in C++14
by Const-me on Sunday February 24, 2019 @12:00PM
(#19239333)
Video playback is inefficient.
The code uses media foundation for decode (this part is good), but then it downloads NV12 data to system RAM, then uploads back to VRAM.
Better approach is making it work entirely on GPU. The simple way to implement that is to drop Windows 7 support already, and use IMFMediaEngine interface. That object decodes video directly into D3D 11 textures, with very little work required, doesn't even need any custom shaders.
The code uses media foundation for decode (this part is good), but then it downloads NV12 data to system RAM, then uploads back to VRAM.
Better approach is making it work entirely on GPU. The simple way to implement that is to drop Windows 7 support already, and use IMFMediaEngine interface. That object decodes video directly into D3D 11 textures, with very little work required, doesn't even need any custom shaders.
Here’s a working example: https://github.com/Const-me/vis_avs_dx/tree/master/avs_dx/Dx...