The last patch is a huge optimization to what is done in patch 2. Without that the sample is first copied from GPU to CPU each time wg_transform_read_mf() locks the buffer (allocating extra linear buffer on the way) and then copies the data back to GPU. That happens even if there is no sample available from wg_transform. With the last patch there is just one memory copy to the (write-only) locked DXGI surface buffer. And CPU to GPU texture transfer (which would be there anyway in most cases on software path as most of the apps are going to get the image to GPU anyway). In principle we could also skip the explicit staging texture and use _UpdateSubresource instead directly from h264 decoder, but this is currently not supported in wined3d for chroma formats and the overall difference between _UpdateSubresource and explicit mapped staging texture is not that great probably.
-- v2: winegstreamer: Pass temporary sample to wg_transform_read_mf() in h264 decoder. winegstreamer: Provide samples if DXGI device manager is set in h264 decoder. winegstreamer: Process MFT_MESSAGE_SET_D3D_MANAGER in h264 decoder. mf/tests: Test h264 decoder with dxgi device manager.