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

D3DBase: Use the correct version of CreateDXGIFactory. #6014

Merged
merged 1 commit into from Sep 3, 2017

Conversation

CrossVR
Copy link
Contributor

@CrossVR CrossVR commented Sep 3, 2017

This is a big oversight on my part, I'm not sure why it seems to work correctly. I guess even though we request the incorrect version, the underlying object still supports the newer interfaces.

@CrossVR CrossVR force-pushed the fix-factory branch 2 times, most recently from 0e9abcb to b2811fe Compare September 3, 2017 12:14
@mimimi085181
Copy link
Contributor

As expected, this breaks directx on windows 7. When selecting directx, an error pops up:"Critical error" "GetProcAddress failed for CreateDXGIFactor2!", and Dolphin just closes when clicking ok.

@CrossVR
Copy link
Contributor Author

CrossVR commented Sep 3, 2017

@mimimi085181 Thanks for the quick test. This is a bit unexpected because Windows 7 does support the IDXGIFactory2 interface. However there is a quick workaround, since CreateDXGIFactory2 specifies the following:

This function accepts a flag indicating whether DXGIDebug.dll is loaded. The function otherwise behaves identically to CreateDXGIFactory1.

So CreateDXGIFactory2 is only required for the debug flag and it looks like I didn't use that correctly anyway.

@mimimi085181
Copy link
Contributor

Well, according to microsoft DXGI 1.3 is only supported on windows 8.1+, which is why i expected this to fail. I guess that's part of the directx 11.1 features that are not supported on windows 7, or something like that.

@CrossVR
Copy link
Contributor Author

CrossVR commented Sep 3, 2017

Correct, but IDXGIFactory2 is part of DXGI 1.2, not DXGI 1.3. It's all a bit counter-intuitive since CreateDXGIFactory2 is part of DXGI 1.3.

@mimimi085181
Copy link
Contributor

Now it works, thanks.

Copy link
Contributor

@stenzek stenzek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stenzek stenzek merged commit 75435ae into dolphin-emu:master Sep 3, 2017
@Helios747
Copy link
Contributor

@CrossVR
Copy link
Contributor Author

CrossVR commented Dec 20, 2017

@Helios747 According to MSDN the only way this could error out on Windows 7 is if they haven't run Windows Update in a long, long time.

If it doesn't work after the platform update we could query for IDXGIFactory2 after creating an older DXGI factory. Because if it worked without crashing before, then it should already support that interface.

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