Skip to content
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

Blank screen when running app on microsoft remote desktop #42

Closed
clbsoft opened this issue Feb 17, 2021 · 6 comments
Closed

Blank screen when running app on microsoft remote desktop #42

clbsoft opened this issue Feb 17, 2021 · 6 comments
Milestone

Comments

@clbsoft
Copy link

clbsoft commented Feb 17, 2021

I tested out the wpf control and it works great locally. I tried remoting in to my work computer with remote desktop and when I run it the window is blank white. It doesn't crash but you can't see anything. Both computers have Windows 10 and nvidia graphics cards with the latest drivers. Also remote desktop worked fine on the old winforms gl control.

@marcotod1410
Copy link
Contributor

marcotod1410 commented Feb 18, 2021

By default, the graphics rendering over RDP is not hardware accelerated. For this reason, OpenGL does not work over RDP. However, you could enable GPU rendering over RDP on the remote machine to overcome this issue.

Try enable it by following this procedure and let us know if it works!

@clbsoft
Copy link
Author

clbsoft commented Feb 18, 2021

In most cases I wouldn't be able to change group policy for our rdp computers. However I believe my remote desktop is running in hardware mode because calling GL.GetString(StringName.Renderer) returns Geforce GTX 1060 which is the graphics card on the remote machine. Also I tried copying an openGL software driver to the executing directory but this causes the program to crash on load with System.AccessViolationException The link to the github of the software driver I tried is below:
https://github.com/pal1000/mesa-dist-win

image

@marcotod1410
Copy link
Contributor

Good, it seems that OpenGL is loaded correctly.
I guess that the AccessViolationException you're encountering when using the software renderer is correct: the control is based on a hidden GLFW window that doesn't support software rendering, as far as I know.

@clbsoft
Copy link
Author

clbsoft commented Feb 19, 2021

I did some more digging and found a solution. Apparently the issue is on the Direct3D side of things. In the source file GLWpfControlRenderer.cs there is a method PostRender().

If you change the line:
_framebuffer.D3dImage.SetBackBuffer(D3DResourceType.IDirect3DSurface9, _framebuffer.DxRenderTargetHandle);

To this:
_framebuffer.D3dImage.SetBackBuffer(D3DResourceType.IDirect3DSurface9, _framebuffer.DxRenderTargetHandle, true);

RDP will work. The name of the argument I set to true is enableSoftwareFallback. Not sure if it will impact performance in non RDP scenarios. Maybe you will want to make it a property on the control that users can toggle if they are running RDP.

@varon
Copy link
Member

varon commented Feb 22, 2021

Thanks @clbsoft - That's really great.

Would love a PR for that fix if you can.

@NogginBops
Copy link
Member

This should be fixed with #57. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants