-
Notifications
You must be signed in to change notification settings - Fork 50
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
COMException in IDirect3DDevice9Ex.CreateRenderTarget when GLWpfControlSettings.Samples > 1 #138
Comments
Yeah this is a known issue documented in #131. I gave not been able to figure out why this issue occurs or how to diagnose the issue. |
I've been troubleshooting this issue for hours. In my specific use case, I don't require multisampling so I can proceed without it. |
Perhaps I found something interesting. My goal was to debug the disassembled code of d3d9.dll while the program was running, but I couldn't figure out how to do it (I'm quietly new to Microsoft tools and SO), so I had to resort to a manual inspection. Through this manual examination, I observed that the CreateRenderTarget, at a certain point, refers to the string 'Multisample surfaces are not shareable. CreateRenderTarget/CreateDepthStencil fails' and subsequently returns the error code 0x8876086C. It's possible that there isn't a solution to this problem. |
Any info on fixing this. |
No, not really. |
Thanks for the information. |
I can't really give you the code you need, but you should be able to figure framebuffers out from the wiki and learnopengl tutorial. Framebuffer tutorial: https://learnopengl.com/Advanced-OpenGL/Framebuffers |
@NogginBops you may need to check for those specific vendor ID's and force MSAA = 1. I wound up just doing MSAA myself using the method (more or less) described by learnopengl. Would you accept a PR with my hand-rolled MSAA implementation? I did some digging to figure out why this issue is occurring because I really, really want to use OpenGL in my WPF project. I found several locations where folks are complaining about using MSAA > 1 in d3d9 on Iris Xe. From what I can gather, this issue is Intel Xe specific, and may even be vendor specific (this is just my conjecture). Most of the hardware mentioned is Dell and Lenovo, but that may be due to popularity. I am using a Dell PC with an i5-10400. I've tried pretty much every driver I could find from Dell and Intel, and get the same results always. Example 1: https://community.intel.com/t5/Graphics/Iris-Xe-Bugs-and-Problems-Direct3D-NET-WPF-LineTopology-Double/m-p/1495360 |
Moving this to |
after commit "Use share handles, this fixes AMD integrated graphics" (#131 ) the control consistently crashes with
System.Runtime.InteropServices.COMException: '0x8876086C'
during the IDirect3DDevice9Ex.CreateRenderTarget call whenever GLWpfControlSettings.Samples is set to a value greater than 1
StackTrace:
System.Private.CoreLib.dll!System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(int errorCode) Riga 849
GLWpfControl.dll!OpenTK.Wpf.Interop.DXInterop.CheckHResult(int hresult) Riga 36
GLWpfControl.dll!OpenTK.Wpf.Interop.DXInterop.IDirect3DDevice9Ex.CreateRenderTarget(int width, int height, OpenTK.Wpf.Interop.Format format, OpenTK.Wpf.Interop.MultisampleType multisample, int multisampleQuality, bool lockable, out OpenTK.Wpf.Interop.DXInterop.IDirect3DSurface9 surfaceHandle, ref nint sharedHandle) Riga 298
GLWpfControl.dll!OpenTK.Wpf.GLWpfControlRenderer.ReallocateFramebufferIfNeeded(double width, double height, double dpiScaleX, double dpiScaleY, OpenTK.Wpf.Interop.Format format, OpenTK.Wpf.Interop.MultisampleType msaaType) Riga 104
GLWpfControl.dll!OpenTK.Wpf.GLWpfControl.OnRender(System.Windows.Media.DrawingContext drawingContext) Riga 251
Thanks for your work
The text was updated successfully, but these errors were encountered: