diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-05-01 01:14:59 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-05-18 21:56:54 +0200 |
commit | ec58670a0dc9d4c3970cb4814b2f47ca7011a421 (patch) | |
tree | 807b088c30bd50e9b5a841b5c1401ed33169b921 /video/out | |
parent | f677f8a5a728f906b2176b3f1622c2c986de58fb (diff) | |
download | mpv-ec58670a0dc9d4c3970cb4814b2f47ca7011a421.tar.bz2 mpv-ec58670a0dc9d4c3970cb4814b2f47ca7011a421.tar.xz |
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.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/d3d11/ra_d3d11.c | 22 |
1 files 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); |