-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
D3D1211On12 logs warnings by default #838
Comments
这是来自QQ邮箱的假期自动回复邮件。 你好,我最近正在休假中,无法亲自回复你的邮件。我将在假期结束后,尽快给你回复。
|
I can add to the evidence that these warnings do seem to be caused by Direct2D through the 11On12Device implementation. In my own separate project, I started by manually integrating 11On12 by following the guide on MSDN docs and rendering some text to the screen. After I got it all working, I noticed I got those "Ignoring InitialState" warnings. I get 2 of those warnings always, right off the bat, as soon as the call to create the Direct2D device from the 11On12Device succeeds. I then continue to get that same warning recurringly over-time just by normal use of DrawText (and DrawEllipse) of the Direct2DDeviceContext object (the warning is generated when EndDraw() is called, but not always, it can take an indeterminate, yet still somewhat regular, amount of subsequent frames before the warning fires). At first I thought it was something I was doing wrong with my setup, but then I discovered that the same warnings happen initially and recurringly in this sample as well as the Variable Rate Shading sample. The common denominator is Direct2D with 11On12. I feel like Direct2D needs to be updated to better interop with Direct3D12 via the Direct3D11On12Device (or however the implementation is handled)...so that it creates its committed resources in a way that doesn't generate these warnings. Seeing these warnings recurringly can give a misimpression of a memory leak (because the warning indicates that committed resources are being allocated continuously), even though I have to assume Direct2D cleans up and deallocates these committed resources on its own over time and that memory won't just grow continuously...I've only been able to very crudely determine that memory was increasing (by watching the Process Memory graph in Visual Studio's Diagnostics window), but only by a couple megabytes, and it didn't seem to increase beyond that, so I get the impression cleanup is happening. It's clear that Direct2D needs to allocate committed resources in order to do its job of rendering text and drawing shapes...the fact that is has to continue to do that dynamically is the surprising bit. For text, I can understand as you may need to recreate resources to draw different glyphs as the text string changes, but not for shapes (the size and shape never changed)...anyway, I'm not going to fault the implementation, it seems to run fast enough for its purpose...it's just the warning spam that's the only annoyance so far. Note: The warning itself I think we all understand is quite benign, but having it spammed in the console just via normal use of the Direct2D calls is the problem. The secondary problem is the resulting confusion the warning can cause and the frustration of knowing it's out of your control as it's generated by an external library. |
Running the Debug build the 'D3D1211On12' sample under a debugger shows multiple warnings:
The warnings look like they're caused by the 11-on-12 implementation, not the sample, but it's not clear. It would be great if the sample was 'warning clean', otherwise it's difficult to turn warnings on to help diagnose issues in my own code.
The text was updated successfully, but these errors were encountered: