From 9363a0af42c6454cdd0cfffd11470c5840aa79fe Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Tue, 3 Sep 2024 20:10:42 +0900 Subject: [PATCH] dwrite: Allow unlimited number of in-flight d3d12 commands ... so that it can be controlled by global direct command queue. Part-of: --- .../sys/dwrite/gstdwriterender_d3d12.cpp | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/dwrite/gstdwriterender_d3d12.cpp b/subprojects/gst-plugins-bad/sys/dwrite/gstdwriterender_d3d12.cpp index 5bbf3f6e91..323513b085 100644 --- a/subprojects/gst-plugins-bad/sys/dwrite/gstdwriterender_d3d12.cpp +++ b/subprojects/gst-plugins-bad/sys/dwrite/gstdwriterender_d3d12.cpp @@ -32,8 +32,6 @@ GST_DEBUG_CATEGORY_EXTERN (dwrite_overlay_object_debug); #define GST_CAT_DEFAULT dwrite_overlay_object_debug -#define ASYNC_DEPTH 4 - /* *INDENT-OFF* */ using namespace Microsoft::WRL; @@ -85,7 +83,6 @@ struct GstDWriteD3D12RenderPrivate gst_clear_object (&device); prepared = FALSE; fence_val = 0; - scheduled = { }; } GstD3D12Device *device = nullptr; @@ -115,7 +112,6 @@ struct GstDWriteD3D12RenderPrivate ComPtr device11on12; ComPtr device11; ComPtr d3d11_context; - std::queue scheduled; }; /* *INDENT-ON* */ @@ -324,13 +320,6 @@ gst_dwrite_d3d12_render_draw_layout (GstDWriteRender * render, } } - if (priv->scheduled.size () >= ASYNC_DEPTH) { - auto fence_to_wait = priv->scheduled.front (); - priv->scheduled.pop (); - gst_d3d12_device_fence_wait (priv->device, - D3D12_COMMAND_LIST_TYPE_DIRECT, fence_to_wait); - } - GstBuffer *layout_buf = nullptr; gst_buffer_pool_acquire_buffer (priv->layout_pool, &layout_buf, nullptr); if (!layout_buf) { @@ -374,7 +363,6 @@ gst_dwrite_d3d12_render_draw_layout (GstDWriteRender * render, 1, &args, fence_data, 0, nullptr, nullptr, D3D12_COMMAND_LIST_TYPE_DIRECT, &priv->fence_val); - priv->scheduled.push (priv->fence_val); gst_d3d12_memory_set_fence (dmem, gst_d3d12_device_get_fence_handle (priv->device, D3D12_COMMAND_LIST_TYPE_DIRECT), priv->fence_val, FALSE); @@ -397,13 +385,6 @@ gst_dwrite_d3d12_render_blend (GstDWriteRender * render, GstBuffer * layout_buf, return FALSE; } - if (priv->scheduled.size () >= ASYNC_DEPTH) { - auto fence_to_wait = priv->scheduled.front (); - priv->scheduled.pop (); - gst_d3d12_device_fence_wait (priv->device, - D3D12_COMMAND_LIST_TYPE_DIRECT, fence_to_wait); - } - GstD3D12Frame out_frame; if (!gst_d3d12_frame_map (&out_frame, &priv->info, output, GST_MAP_WRITE_D3D12, GST_D3D12_FRAME_MAP_FLAG_RTV)) { @@ -543,8 +524,6 @@ gst_dwrite_d3d12_render_blend (GstDWriteRender * render, GstBuffer * layout_buf, gst_d3d12_command_queue_set_notify (cq, priv->fence_val, FENCE_NOTIFY_MINI_OBJECT (fence_data)); - priv->scheduled.push (priv->fence_val); - for (guint i = 0; i < gst_buffer_n_memory (output); i++) { auto dmem = (GstD3D12Memory *) gst_buffer_peek_memory (output, i); gst_d3d12_memory_set_fence (dmem, fence, priv->fence_val, FALSE);