Commit Graph

23 Commits

Author SHA1 Message Date
Philip Rebohle 3405b89494
[dxgi] Rename and move DXGI format lookup related structures
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.
2018-04-12 15:36:01 +02:00
Philip Rebohle f5679211cd
[dxgi] Re-implement gamma control functions 2018-04-12 13:38:22 +02:00
Philip Rebohle 654e9e6fd8
[dxgi] Re-enable strong reference to DxgiAdapter in DxgiOutput 2018-04-12 01:51:28 +02:00
Philip Rebohle c88170966f
[dxgi] Remove gamma control methods from DxgiOutput 2018-04-12 01:15:40 +02:00
Philip Rebohle a2f96f9728
[dxgi] Remove unnecessary debug output 2018-04-10 22:10:32 +02:00
Philip Rebohle dd3f4c89ac
[dxgi] Implement gamma control methods for DxgiOutput 2018-04-10 22:07:25 +02:00
pchome 6a6871ee42 [dxgi] Fix compilation with WINE headers (#236)
* [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.
2018-04-03 21:11:26 +02:00
pchome 311748ee09 [dxgi] Replace UINT_MAX with std::numeric_limits (#234)
`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; }`.
2018-04-02 18:49:19 +02:00
pchome e9c7dcfc76 [dxgi] Replace MSVC _countof macro with std::size (#231)
* [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
2018-04-02 18:49:03 +02:00
Philip Rebohle 2973c18055 [dxgi/d3d11] Remove COM_QUERY_INTERFACE macro, reset pointers
May fix some crashes in applications that rely on the returned
pointer being set to nullptr before returning.
2018-04-02 12:52:02 +02:00
Philip Rebohle 6babc22ec0
[dxgi] Reset pointers before returning an error
Also fixes a refcount issue and minor code formatting issues.
2018-03-28 11:56:58 +02:00
Philip Rebohle 19e0829a37
[dxgi] Enumerate scaled and centered display modes correctly
Fixes fullscreen mode in Dark Souls 3.
2018-03-24 13:42:23 +01:00
Philip Rebohle 87d6fde5c4
[dxgi] FindClosestMatchingMode: Fall back to 8-bit SRGB format
Fixes errors in various games which rely on this method.
2018-03-24 11:31:39 +01:00
Mikhail Paulyshka fa78259459 [dxgi] fix DxgiOutput::FindClosestMatchingMode() implementation (#157)
* remove useless checks
* fix refresh rate matching and unspecified detection
2018-03-12 22:28:34 +01:00
Mikhail Paulyshka b17568deba [dxgi,d3d11] log unknown interfaces GUID (#154)
* [d3d11] log unknown interfaces GUID in QueryInterface()

* [dxgi] log unknown interfaces GUID in QueryInterface()
2018-03-12 12:05:43 +01:00
Mikhail Paulyshka 3cb3c05888 [dxgi] implement DxgiOutput::FindClosestMatchingMode() (#153)
rev2:
* use std::vector instead of C array
* add clarification about TODO
2018-03-12 08:52:32 +01:00
Grazvydas Ignotas d1ae152f60 Fix build on gcc6
Fixes build with mingw from ubuntu 17.10.
Missing C++17 features I guess.
2018-01-19 00:59:40 +02:00
Philip Rebohle 2b5bb16334 [dxgi] Removed SDL dependency from DxgiOutput 2018-01-13 16:32:46 +01:00
Philip Rebohle 4412f2f5ff [dxgi] Reimplemented parts of DxgiSwapchain with win32 APIs
This solves issues in applications that create more than one
swap chain for a given window, and helps applications that
don't like SDL interference in general. Fullscreen support
is currently missing entirely.
2017-12-31 00:23:34 +01:00
Philip Rebohle 2a266eaad4 [general] Added 32-bit support 2017-12-12 12:50:52 +01:00
Philip Rebohle f924931d2d [general] Removed TRACE calls for now 2017-11-26 14:01:41 +01:00
Philip Rebohle c095fab1c9 [dxvk] Fixed interface queries 2017-10-15 21:50:45 +02:00
Philip Rebohle bed6d23e7f [dxgi] Implemented some DXGI classes 2017-10-11 03:09:04 +02:00