From ec58670a0dc9d4c3970cb4814b2f47ca7011a421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Mon, 1 May 2023 01:14:59 +0200 Subject: [PATCH] ra_d3d11: change how messages are ignored during texture size lookup Filtering globally D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS is suboptimal, because can also hide other invalid usages. In the same time it is not enough, because not only this message is emitted, but also one about E_INVALIDARG. Just flush queue before and clear messages after to ignore this part of code. As a side note, I don't believe this texture size lookup is in fact useful, but since it is there and is relatively harmless, let's leave it as is. --- video/out/d3d11/ra_d3d11.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/video/out/d3d11/ra_d3d11.c b/video/out/d3d11/ra_d3d11.c index 7cf3686593..c002d8aad3 100644 --- a/video/out/d3d11/ra_d3d11.c +++ b/video/out/d3d11/ra_d3d11.c @@ -2303,19 +2303,8 @@ static void init_debug_layer(struct ra *ra) // because we flush stored messages regularly (in debug_marker.) ID3D11InfoQueue_SetMessageCountLimit(p->iqueue, -1); - // Filter some annoying messages - D3D11_MESSAGE_ID deny_ids[] = { - // This error occurs during context creation when we try to figure out - // the real maximum texture size by attempting to create a texture - // larger than the current feature level allows. - D3D11_MESSAGE_ID_CREATETEXTURE2D_INVALIDDIMENSIONS, - }; - D3D11_INFO_QUEUE_FILTER filter = { - .DenyList = { - .NumIDs = MP_ARRAY_SIZE(deny_ids), - .pIDList = deny_ids, - }, - }; + // Push empty filter to get everything + D3D11_INFO_QUEUE_FILTER filter = {0}; ID3D11InfoQueue_PushStorageFilter(p->iqueue, &filter); } @@ -2485,10 +2474,17 @@ struct ra *ra_d3d11_create(ID3D11Device *dev, struct mp_log *log, &(D3D11_QUERY_DESC) { D3D11_QUERY_TIMESTAMP }, NULL); p->has_timestamp_queries = SUCCEEDED(hr); + debug_marker(ra, "before maximum Texture2D size lookup"); + // According to MSDN, the above texture sizes are just minimums and drivers // may support larger textures. See: // https://msdn.microsoft.com/en-us/library/windows/desktop/ff476874.aspx find_max_texture_dimension(ra); + + // Ignore any messages during find_max_texture_dimension + if (p->iqueue) + ID3D11InfoQueue_ClearStoredMessages(p->iqueue); + MP_VERBOSE(ra, "Maximum Texture2D size: %dx%d\n", ra->max_texture_wh, ra->max_texture_wh);