d3d11: Suppress some warning debug messages

* Don't warn for live object, since ID3D11Debug itself seems to be
  holding refcount of ID3D11Device at the moment we called
  ID3D11Debug::ReportLiveDeviceObjects(). It would report live object
  always
* Device might not be able to support some formats (e.g., P010)
  especially in case of WARP device. We don't need to warn about that.
* gst_d3d11_device_new() can be used for device enumeration. Don't warn
  even if we cannot create D3D11 device with given adapter index therefore.
* Don't warn for HLSL compiler warning. It's just noise and
  should not be critical thing at all

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1986>
This commit is contained in:
Seungha Yang 2021-01-27 04:34:13 +09:00
parent 657370a91c
commit 0b0bf1b0bf
2 changed files with 15 additions and 7 deletions

View file

@ -212,6 +212,13 @@ gst_d3d11_device_d3d11_debug (GstD3D11Device * device,
hr = ID3D11InfoQueue_GetMessage (priv->d3d11_info_queue, i, msg, &msg_len); hr = ID3D11InfoQueue_GetMessage (priv->d3d11_info_queue, i, msg, &msg_len);
level = d3d11_message_severity_to_gst (msg->Severity); level = d3d11_message_severity_to_gst (msg->Severity);
if (msg->Category == D3D11_MESSAGE_CATEGORY_STATE_CREATION &&
level > GST_LEVEL_ERROR) {
/* Do not warn for live object, since there would be live object
* when ReportLiveDeviceObjects was called */
level = GST_LEVEL_INFO;
}
gst_debug_log (gst_d3d11_debug_layer_debug, level, file, function, line, gst_debug_log (gst_d3d11_debug_layer_debug, level, file, function, line,
G_OBJECT (device), "D3D11InfoQueue: %s", msg->pDescription); G_OBJECT (device), "D3D11InfoQueue: %s", msg->pDescription);
} }
@ -439,20 +446,20 @@ can_support_format (GstD3D11Device * self, DXGI_FORMAT format,
flags |= extra_flags; flags |= extra_flags;
if (!is_windows_8_or_greater ()) { if (!is_windows_8_or_greater ()) {
GST_WARNING_OBJECT (self, "DXGI format %d needs Windows 8 or greater", GST_INFO_OBJECT (self, "DXGI format %d needs Windows 8 or greater",
(guint) format); (guint) format);
return FALSE; return FALSE;
} }
hr = ID3D11Device_CheckFormatSupport (handle, format, &supported); hr = ID3D11Device_CheckFormatSupport (handle, format, &supported);
if (!gst_d3d11_result (hr, NULL)) { if (FAILED (hr)) {
GST_WARNING_OBJECT (self, "DXGI format %d is not supported by device", GST_DEBUG_OBJECT (self, "DXGI format %d is not supported by device",
(guint) format); (guint) format);
return FALSE; return FALSE;
} }
if ((supported & flags) != flags) { if ((supported & flags) != flags) {
GST_WARNING_OBJECT (self, GST_DEBUG_OBJECT (self,
"DXGI format %d doesn't support flag 0x%x (supported flag 0x%x)", "DXGI format %d doesn't support flag 0x%x (supported flag 0x%x)",
(guint) format, (guint) supported, (guint) flags); (guint) format, (guint) supported, (guint) flags);
return FALSE; return FALSE;
@ -682,7 +689,7 @@ gst_d3d11_device_constructed (GObject * object)
if (IDXGIFactory1_EnumAdapters1 (factory, priv->adapter, if (IDXGIFactory1_EnumAdapters1 (factory, priv->adapter,
&adapter) == DXGI_ERROR_NOT_FOUND) { &adapter) == DXGI_ERROR_NOT_FOUND) {
GST_WARNING_OBJECT (self, "No adapter for index %d", priv->adapter); GST_DEBUG_OBJECT (self, "No adapter for index %d", priv->adapter);
goto error; goto error;
} else { } else {
DXGI_ADAPTER_DESC1 desc; DXGI_ADAPTER_DESC1 desc;
@ -971,7 +978,7 @@ gst_d3d11_device_new (guint adapter, guint flags)
priv = device->priv; priv = device->priv;
if (!priv->device || !priv->device_context) { if (!priv->device || !priv->device_context) {
GST_WARNING ("Cannot create d3d11 device with adapter %d", adapter); GST_DEBUG ("Cannot create d3d11 device with adapter %d", adapter);
gst_clear_object (&device); gst_clear_object (&device);
} else { } else {
gst_object_ref_sink (device); gst_object_ref_sink (device);

View file

@ -137,7 +137,8 @@ compile_shader (GstD3D11Device * device, const gchar * shader_source,
if (error) { if (error) {
const gchar *err = ID3D10Blob_GetBufferPointer (error); const gchar *err = ID3D10Blob_GetBufferPointer (error);
GST_WARNING ("HLSL compiler warnings:\n%s", GST_STR_NULL (err)); GST_DEBUG ("HLSL compiler warnings:\n%s\nShader code:\n%s",
GST_STR_NULL (err), GST_STR_NULL (shader_source));
ID3D10Blob_Release (error); ID3D10Blob_Release (error);
} }