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

vulkan: Backport build fix for MinGW-w64 8.0.0 #43182

Merged
merged 1 commit into from Oct 29, 2020

Conversation

akien-mga
Copy link
Member

Taken from KhronosGroup/Vulkan-Loader#475.

Supersedes and reverts #43119 since the upstream change removes the need for
that custom define.

@fire @Anutrix can you check that this works for you?

Taken from KhronosGroup/Vulkan-Loader#475.

Supersedes and reverts godotengine#43119 since the upstream change removes the need for
that custom define.
@Anutrix
Copy link
Contributor

Anutrix commented Oct 29, 2020

@akien-mga The patch works for me.
Tested on Windows 10 with MinGW-LLVM stable 10.0.0(https://github.com/mstorsjo/llvm-mingw/releases/tag/20200325).

@akien-mga akien-mga merged commit 5bb7c7c into godotengine:master Oct 29, 2020
@akien-mga akien-mga deleted the vulkan-loader-mingw-fixup branch October 29, 2020 13:06
@Anutrix
Copy link
Contributor

Anutrix commented Oct 29, 2020

There seems to be a problem. I messed up somewhere. Turns out this fix doesn't work. @akien-mga
I'm sorry for the trouble.
Here's the full error:

[ 42%] �[94mCompiling �[95m==> �[93mthirdparty\vulkan\loader\loader.c�[0m
=====
b"thirdparty\\vulkan\\loader\\loader.c:6046:5: error: use of undeclared identifier 'IDXGIFactory6'\r\n    IDXGIFactory6* dxgi_factory = NULL;\r\n    ^\r\nthirdparty\\vulkan\\loader\\loader.c:6046:20: error: use of undeclared identifier 'dxgi_factory'\r\n    IDXGIFactory6* dxgi_factory = NULL;\r\n                   ^\r\nthirdparty\\vulkan\\loader\\loader.c:6047:42: error: use of undeclared identifier 'IID_IDXGIFactory6'\r\n    HRESULT hres = fpCreateDXGIFactory1(&IID_IDXGIFactory6, &dxgi_factory);\r\n                                         ^\r\nthirdparty\\vulkan\\loader\\loader.c:6047:62: error: use of undeclared identifier 'dxgi_factory'\r\n    HRESULT hres = fpCreateDXGIFactory1(&IID_IDXGIFactory6, &dxgi_factory);\r\n                                                             ^\r\nthirdparty\\vulkan\\loader\\loader.c:6050:9: error: use of undeclared identifier 'dxgi_factory'\r\n        dxgi_factory->lpVtbl->Release(dxgi_factory);\r\n        ^\r\nthirdparty\\vulkan\\loader\\loader.c:6050:39: error: use of undeclared identifier 'dxgi_factory'\r\n        dxgi_factory->lpVtbl->Release(dxgi_factory);\r\n                                      ^\r\nthirdparty\\vulkan\\loader\\loader.c:7075:5: error: use of undeclared identifier 'IDXGIFactory6'\r\n    IDXGIFactory6* dxgi_factory = NULL;\r\n    ^\r\nthirdparty\\vulkan\\loader\\loader.c:7075:20: error: use of undeclared identifier 'dxgi_factory'\r\n    IDXGIFactory6* dxgi_factory = NULL;\r\n                   ^\r\nthirdparty\\vulkan\\loader\\loader.c:7076:42: error: use of undeclared identifier 'IID_IDXGIFactory6'\r\n    HRESULT hres = fpCreateDXGIFactory1(&IID_IDXGIFactory6, &dxgi_factory);\r\n                                         ^\r\nthirdparty\\vulkan\\loader\\loader.c:7076:62: error: use of undeclared identifier 'dxgi_factory'\r\n    HRESULT hres = fpCreateDXGIFactory1(&IID_IDXGIFactory6, &dxgi_factory);\r\n                                                             ^\r\nthirdparty\\vulkan\\loader\\loader.c:7093:68: error: called object type '<dependent type>' is not a function or function pointer\r\n            hres = dxgi_factory->lpVtbl->EnumAdapterByGpuPreference(dxgi_factory, i, DXGI_GPU_PREFERENCE_UNSPECIFIED, &IID_IDXGIAdapter1, &adapter);\r\n                                                                   ^\r\nthirdparty\\vulkan\\loader\\loader.c:7177:9: error: use of undeclared identifier 'dxgi_factory'\r\n        dxgi_factory->lpVtbl->Release(dxgi_factory);\r\n        ^\r\nthirdparty\\vulkan\\loader\\loader.c:7177:39: error: use of undeclared identifier 'dxgi_factory'\r\n        dxgi_factory->lpVtbl->Release(dxgi_factory);\r\n                                      ^\r\nthirdparty\\vulkan\\loader\\loader.c:7093:20: error: use of undeclared identifier 'dxgi_factory'\r\n            hres = dxgi_factory->lpVtbl->EnumAdapterByGpuPreference(dxgi_factory, i, DXGI_GPU_PREFERENCE_UNSPECIFIED, &IID_IDXGIAdapter1, &adapter);\r\n                   ^\r\nthirdparty\\vulkan\\loader\\loader.c:7093:69: error: use of undeclared identifier 'dxgi_factory'\r\n            hres = dxgi_factory->lpVtbl->EnumAdapterByGpuPreference(dxgi_factory, i, DXGI_GPU_PREFERENCE_UNSPECIFIED, &IID_IDXGIAdapter1, &adapter);\r\n                                                                    ^\r\nthirdparty\\vulkan\\loader\\loader.c:7093:86: error: use of undeclared identifier 'DXGI_GPU_PREFERENCE_UNSPECIFIED'\r\n            hres = dxgi_factory->lpVtbl->EnumAdapterByGpuPreference(dxgi_factory, i, DXGI_GPU_PREFERENCE_UNSPECIFIED, &IID_IDXGIAdapter1, &adapter);\r\n                                                                                     ^\r\n16 errors generated.\r\n"
=====
scons: *** [thirdparty\vulkan\loader\loader.windows.tools.64.o] Error 1
scons: building terminated because of errors.

@pouleyKetchoupp
Copy link
Contributor

The error is due to requirements for recent dx11 headers for the api the vulkan loader is using.

On Windows, using a recent version of Mingw-w64 might help (version 8.0 from http://mingw-w64.org/doku.php). If in your case the headers come from the Windows SDK as it does for MSVC, installing a recent Windows SDK would work (https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk/).

For anybody interested, I was able to compile on Ubuntu 20.04, but because on the stable repo mingw-64 is still at version 7.0, I had to install it from a ppa.

First I had to remove the previous version of mingw entirely (otherwise I had discrepancies in headers):

sudo apt-get remove mingw-w64
sudo apt-get autoremove --purge

Then I've installed the new version from https://launchpad.net/~cybermax-dexter/+archive/ubuntu/mingw-w64-backport:

sudo add-apt-repository ppa:cybermax-dexter/mingw-w64-backport
sudo apt-get update
sudo apt-get install mingw-w64 gcc-mingw-w64 

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

Successfully merging this pull request may close these issues.

None yet

3 participants