mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
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>
This commit is contained in:
parent
7d9747490b
commit
7b6f7e6e36
1 changed files with 7 additions and 0 deletions
|
@ -1606,6 +1606,7 @@ gst_d3d11_allocator_alloc_internal (GstD3D11Allocator * self,
|
||||||
GstD3D11Memory *dmem;
|
GstD3D11Memory *dmem;
|
||||||
ID3D11RenderTargetView *rtv = nullptr;
|
ID3D11RenderTargetView *rtv = nullptr;
|
||||||
GstD3D11ClearRTVFunc clear_func = nullptr;
|
GstD3D11ClearRTVFunc clear_func = nullptr;
|
||||||
|
gboolean is_new_texture = TRUE;
|
||||||
|
|
||||||
device_handle = gst_d3d11_device_get_device_handle (device);
|
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");
|
GST_ERROR_OBJECT (self, "Couldn't create texture");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
is_new_texture = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
mem =
|
mem =
|
||||||
|
@ -1622,6 +1625,10 @@ gst_d3d11_allocator_alloc_internal (GstD3D11Allocator * self,
|
||||||
if (!mem)
|
if (!mem)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
|
/* Don't clear external texture */
|
||||||
|
if (!is_new_texture)
|
||||||
|
return mem;
|
||||||
|
|
||||||
/* Clear with YUV black if needed and possible
|
/* Clear with YUV black if needed and possible
|
||||||
* TODO: do this using UAV if RTV is not allowed (e.g., packed YUV formats) */
|
* TODO: do this using UAV if RTV is not allowed (e.g., packed YUV formats) */
|
||||||
if ((desc->BindFlags & D3D11_BIND_RENDER_TARGET) == 0)
|
if ((desc->BindFlags & D3D11_BIND_RENDER_TARGET) == 0)
|
||||||
|
|
Loading…
Reference in a new issue