- Don't turn off warnings for winelib builds, fix them. Using __declspec on winelib builds just doesn't make sense.
- Drop the custom cross property 'winelib'. Detect it instead.
- Move the libdl dependency to the build system
- Don't run wine during mingw build process. Same as for wine builds, see 715d2571
In Proton 3.16, the window size is not necessarily equal to the size
of the WSI swap chain and DXVK is responsible for doing the scaling,
so we should compare to the actual swap image size instead.
When meta-resolve is used for the back buffer, it will
be used as a color attachment, and we need to set up
the usage and stage/access flags accordingly.
* [build] do not use shared_library/objects property with MSVC
* [util] use ./com/com_include.h instead of windef.h
It is required for Windows 10 SDK.
* [util] store thread procedure lambda in std::function
* [dxgi] fix annoying MSVC warning
warning C4099: 'IDXGIVkInteropDevice': type name first seen using 'class' now seen using 'struct'
Render target views and shader resource views can only be created
with a format that is within the same format family as the image
format. For UAVs, the restrictions are relaxed.
Spilling the render pass should make shader storage buffer/image writes
visible due to how external subpass dependencies are defined. For UAV
rendering, we need to do this when changing the UAVs, even if the render
targets themselves do not change.
When an applicationn calls this method with the width or height
set to 0, we are allowed to pick any resolution, so we'll try to
find one close to the *current* display mode which usually returns
the current display mode itself.
Deferred surface creation is required for Frostpunk due to conflicts
with the D3D9 swap chain created by the game before it presents the
first frame to the DXGI swap chain, but breaks NieR:Automata due to
threading issues.
Creating the Vulkan surface at the latest possible moment fixes
an issue with Frostpunk, which renders to a D3D9 swap chain
before presenting to the GXGI swap chain.
Allows games to change the screen resolution in fullscreen
mode. This is currently in a rough shape and some games may
not work as expected when selecting fullscreen mode.
Fixes a GPU hang when closing Dark Souls 3 as well as similar
undesired behaviour in other games that continue to use the
DXGI swap chain after the window has been destroyed.
No `std::mbstowcs` string conversion needed than.
W/o this change I have different output when running `dxgi-factory.exe` compiled with MinGW:
* `Output 0:`
```
\\.\DISPLAY1 (default)
\\.\DISPLAY1 (DXVK MinGW)
\ (DXVK winebuild)
```
With this patch all three variants are identical (`\\.\DISPLAY1`)
p.s. same problem in dxgi_adapter.cpp, but `deviceProp.deviceName` is vulkan structure parameter (char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]).
This is part of a major refactoring process regarding DXGI->Vulkan
format conversions. Since we don't patch format lookup tables any
longer, we can create a global lookup table.
* [dxgi] Fix compilation with WINE headers
```gcc
error: cannot convert 'MONITORINFOEX* {aka tagMONITORINFOEXA*}' to 'LPMONITORINFO {aka tagMONITORINFO*}' for argument '2' to 'BOOL GetMonitorInfoA(HMONITOR, LPMONITORINFO)'
```
```clang
cannot initialize a parameter of type 'LPMONITORINFO' (aka 'tagMONITORINFO *') with an rvalue of type '::MONITORINFOEX *' (aka 'tagMONITORINFOEXA *')
```
This can be WINE bug but I don't want to dig now, firs suggestion is wrong "tag":
wine variant
```c
typedef struct tagMONITORINFO
{
...
} MONITORINFO, *LPMONITORINFO;
typedef struct tagMONITORINFOEXA
{ /* the 4 first entries are the same as MONITORINFO */
...
} MONITORINFOEXA, *LPMONITORINFOEXA;
typedef struct tagMONITORINFOEXW
{ /* the 4 first entries are the same as MONITORINFO */
...
} MONITORINFOEXW, *LPMONITORINFOEXW;
DECL_WINELIB_TYPE_AW(MONITORINFOEX)
DECL_WINELIB_TYPE_AW(LPMONITORINFOEX)
```
VS
MinGW variant
```c
typedef struct tagMONITORINFO {
...
} MONITORINFO,*LPMONITORINFO;
typedef struct tagMONITORINFOEXA : public tagMONITORINFO {
CHAR szDevice[CCHDEVICENAME];
} MONITORINFOEXA,*LPMONITORINFOEXA;
typedef struct tagMONITORINFOEXW : public tagMONITORINFO {
WCHAR szDevice[CCHDEVICENAME];
} MONITORINFOEXW,*LPMONITORINFOEXW;
__MINGW_TYPEDEF_AW(MONITORINFOEX)
__MINGW_TYPEDEF_AW(LPMONITORINFOEX)
```
* [dxgi] Fix compilation with WINE headers
Use C++-style casts rather than C ones.
`limits.h` required for `UINT_MAX` and not always used, so better to use standard C++ variant from `<limits>`.
Some compilers may simply return `UINT_MAX` value, gcc version: `max() _GLIBCXX_USE_NOEXCEPT { return __INT_MAX__ * 2U + 1; }`.
* [dxgi] Replace MSVC _countof macro with std::size
pro: crosscompiler
con: may not work for older clang/gcc/...
http://en.cppreference.com/w/cpp/iterator/size
For example `Run this code` mode produces errors for GCC-5.2(C++17) and clang-3.8(C++17). Local GCC-7.3 and clang-7 versions are ok.
Not tested w/ MinGW64.
* [dxgi] Replace MSVC _countof macro with std::size
Refactored DxgiVkDevice, D3D11Device and D3D11Presenter
to behave more like aggregable objects, where the new
D3D11DeviceContainer class is the COM aggregate object.
Fixes the reference counting issue outlined in #210.
The back buffer needs to be deleted explicitly because on
the way it is created. Fixes reference counting issues in
applications which resize the back buffer at least once.
* [dxvk] fixes for MSVC
* nullptr -> int is illegal conversion for MSVC. nullptr was replaced with VK_NULL_HANDLE
* MSVC does not support source code strings longer than 65535 chars. String was replaced with array of chars.
* [utils] fixes for MSVC
* __mingw_uuidof() does not exists in MSVC
* apply GCC pragma only for GCC
* added missing header
* [dxbc] fixes for MSVC
*added missing header
* [dxgi] fixes for MSVC
* user __declspec(uuid()) instead of _mingw_uuidof()
* do not use DLLEXPORT macro for MSVC
* [d3d11] fixes for MSVC
* replace WINBOOL with BOOL
* do not declare D3D11 structs for MSVC
* do not use DLLEXPORT macro for MSVC
* [meson] fix build scripts for MSVC
* change cpp version from c++1z to c++latest for MSVC
* set -DOMINMAX definition for MSVC
* disable test and wine_utils for MSVC
* use .def files instead of __declspec(dllexport) for MSVC (bypass 'C2375: redefinition; different linkage' error)
* fix .def files for MinGW
* add --enable-stdcall-fixup linker flag for MinGW
* [utils] fixes for MSVC
* __mingw_uuidof() does not exists in MSVC
* apply GCC pragma only for GCC
* added missing header
* [dxvk] fixes for MSVC
* nullptr -> int is illegal conversion for MSVC. nullptr was replaced with VK_NULL_HANDLE
* MSVC does not support source code strings longer than 65535 chars. String was replaced with array of chars.
* [dxbc] fixes for MSVC
*added missing header
* [dxgi] fixes for MSVC
* user __declspec(uuid()) instead of _mingw_uuidof()
* [d3d11] fixes for MSVC
* replace WINBOOL with BOOL
* do not declare D3D11 structs
* [meson] fix build scripts for MSVC
* change cpp version from 1z to 17 for MSVC
* set -DOMINMAX definition for MSVC
* disable test and wine_utils for MSVC
* use .def files instead of __declspec(dllexport) (bypass 'C2375: redefinition; different linkage' error)