d3d11: Don't hold staging texture
authorSeungha Yang <seungha@centricular.com>
Sat, 3 Oct 2020 09:53:46 +0000 (18:53 +0900)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Sun, 4 Oct 2020 15:44:03 +0000 (15:44 +0000)
commitf35eeaa02b71fbd017ffc4b1032cee41a0d54e2f
tree370632e1f8db344b303bfbe1fd422170b401f07f
parent899f9978f5a3d6094d24f17b815f953a2f54ce0b
d3d11: Don't hold staging texture

Staging texture is used for memory transfer between system and
gpu memory. Apart from d3d11{upload,download} elements, however,
it should happen very rarely.

Before this commit, d3d11bufferpool was allocating at least one
staging texture in order to calculate cpu accessible memory size,
and it wasn't freed for later use of the texture unconditionally.
But it will increase system memory usage. Although GstD3D11memory
object is implemented so that support CPU access, most memory
transfer will happen in d3d11{upload,download} elements.

By this commit, the initial staging texture will be freed immediately
once cpu accessible memory size is calculated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1627>
sys/d3d11/gstd3d11bufferpool.c
sys/d3d11/gstd3d11memory.c
sys/d3d11/gstd3d11memory.h
sys/d3d11/gstd3d11utils.c
sys/d3d11/gstd3d11utils.h