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/4558>
GstD3D11Memory *dmem;
ID3D11RenderTargetView *rtv = nullptr;
GstD3D11ClearRTVFunc clear_func = nullptr;
+ gboolean is_new_texture = TRUE;
device_handle = gst_d3d11_device_get_device_handle (device);
GST_ERROR_OBJECT (self, "Couldn't create texture");
return nullptr;
}
+ } else {
+ is_new_texture = FALSE;
}
mem =
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)