summaryrefslogtreecommitdiff
path: root/subprojects
diff options
context:
space:
mode:
authorSeungha Yang <seungha@centricular.com>2023-05-05 21:53:44 +0900
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2023-05-05 13:18:06 +0000
commit7b6f7e6e3694c5577af6074fab37c17687190b24 (patch)
tree5fbe0bbe683f575ec765c47dad1a022258e26c6f /subprojects
parent7d9747490bb111dc17753bd0d468ae560a6ba3c3 (diff)
downloadgstreamer-7b6f7e6e3694c5577af6074fab37c17687190b24.tar.gz
d3d11memory: Don't clear wrapped texture memory
The external texture may hold already rendered scene and therefore it should not be cleared in alloc method Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4554>
Diffstat (limited to 'subprojects')
-rw-r--r--subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.cpp b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.cpp
index dd529f0951..d1084460be 100644
--- a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.cpp
+++ b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.cpp
@@ -1606,6 +1606,7 @@ gst_d3d11_allocator_alloc_internal (GstD3D11Allocator * self,
GstD3D11Memory *dmem;
ID3D11RenderTargetView *rtv = nullptr;
GstD3D11ClearRTVFunc clear_func = nullptr;
+ gboolean is_new_texture = TRUE;
device_handle = gst_d3d11_device_get_device_handle (device);
@@ -1615,6 +1616,8 @@ gst_d3d11_allocator_alloc_internal (GstD3D11Allocator * self,
GST_ERROR_OBJECT (self, "Couldn't create texture");
return nullptr;
}
+ } else {
+ is_new_texture = FALSE;
}
mem =
@@ -1622,6 +1625,10 @@ gst_d3d11_allocator_alloc_internal (GstD3D11Allocator * self,
if (!mem)
return nullptr;
+ /* Don't clear external texture */
+ if (!is_new_texture)
+ return mem;
+
/* Clear with YUV black if needed and possible
* TODO: do this using UAV if RTV is not allowed (e.g., packed YUV formats) */
if ((desc->BindFlags & D3D11_BIND_RENDER_TARGET) == 0)