System.Drawing.Graphics failure when using non-integrated GPU #8198
-
Our C# .NET Windows app uses System.Drawing.Graphics calls for some 2D rendering, and then switches modes to use Filament for 3D rendering in the same window. This works fine when the app is using the integrated GPU hardware, When we set the app's graphics preferences settings to "High performance" (via Windows Graphics settings so it now uses an NVidia T1200 Laptop GPU, in one example), the app works fine in 2D mode until we switch to 3D/Filament rendering and back to 2D mode. Then, the 2D mode no longer renders. The drawing surface does not even clear, leaving the last 3D image in place. The app UI continues to work, as if the 2D scene was rendering. Switching again to 3D continues to work fine. I'm looking for ideas as to why this might be happening. Here are things I've tried:
It's possible that some of the above need to be done at a specific time other than when I have tried it. This problem "feels like" there is some resource that gets taken control of when we initialize Filament with the non-integrated GPU, and then doesn't get released when we go back to 2D. I can't seem figure out what it is, especially since it works with the integrated GPU, and completely shutting down Filament doesn't fix it. Any thoughts or suggestions are welcome. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Are you using the GL or vulkan backend on Windows? |
Beta Was this translation helpful? Give feedback.
-
Creating 2 different Windows controls solved the issue. It was previously using the same control for both the 2D and 3D rendering, which was evidently causing a resource conflict in some cases. Now, I show one control or the other, depending on which one is active. |
Beta Was this translation helpful? Give feedback.
Creating 2 different Windows controls solved the issue. It was previously using the same control for both the 2D and 3D rendering, which was evidently causing a resource conflict in some cases. Now, I show one control or the other, depending on which one is active.