Commit Graph

903 Commits

Author SHA1 Message Date
Philip Rebohle bd17be472d
[dxbc] Reciprocate W component of SV_POSITION in pixel shaders
Fixes the fog effect in Nier:Automata, as well as some major
visual issues in Rise of the Tomb Raider, and potentially
other games.
2018-04-05 20:10:00 +02:00
Philip Rebohle 4d28f765df
[dxvk] Remove support for VK_AMD_rasterization_order
RADV will be doing this by default when it makes sense.
2018-04-04 15:09:24 +02:00
Philip Rebohle 492c7384bc
[dxbc] Implemented ImmAtomicCmpExch and AtomicCmpStore 2018-04-04 13:59:43 +02:00
Philip Rebohle e06300d592
[d3d11] Fix multisample format support query for depth images
Fixes a crash in World of Warships when reflections are enabled.
2018-04-04 11:24:16 +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
Philip Rebohle 89c3b60640 [dxvk] Removed upper limit for CS chunks
Since we are synchronizing once per frame anyway, there is no need to
artificially limit the number of chunks in flight. Applications which
use deferred contexts and submit a large number of CS chunks through
command lists may benefit from this optimization.
2018-04-03 20:06:25 +02:00
Philip Rebohle 7de27d4fd8 [d3d11] Flush immediate context on command list execution
This optimization may help keep the GPU busy in case there's
a large number of draw calls pending at the time a command
list from a deferred context is submitted for execution.
2018-04-03 19:53:37 +02:00
Philip Rebohle 0b2e88b087 [hud] Added <unordered_map> include to satisfy some compilers 2018-04-03 16:27:16 +02:00
Philip Rebohle 1c22ae9796 [general] Updated README
Documented HUD options.
2018-04-03 16:03:15 +02:00
Philip Rebohle 9ef4168867 [dxvk] Added support for pipeline-related stat counters 2018-04-03 15:52:39 +02:00
Philip Rebohle 561fa7440b [dxvk] Retrieve actual memory stats for the HUD 2018-04-03 15:32:00 +02:00
Philip Rebohle fc3f45c082 [hud] Added stat counters to the HUD 2018-04-03 14:49:13 +02:00
Philip Rebohle 3ed03f7a3d [hud] Added configurable HUD
HUD elements can be enabled individually using a comma-separated
list. Supported options include:
- fps: Displays the framerate
- devinfo: Displays device info

Passing "1" has the same effect as "fps,devinfo".
2018-04-03 12:33:08 +02:00
Philip Rebohle 8aa8610221 [dxvk] Implement basic stat counters for draw calls, queue ops 2018-04-03 11:56:12 +02:00
Philip Rebohle c9465b39d1 [util] Implement spin lock 2018-04-03 11:56:02 +02:00
Philip Rebohle a5077952ea [dxvk] Reintroduce stat counters 2018-04-03 11:03:57 +02:00
Philip Rebohle 4b44d3ce39 [dxbc] Unify constants
Identical constants will now be reused. Considerably reduces code size.
2018-04-02 19:41:22 +02:00
Philip Rebohle 097eb89cfb [dxvk] Log pipeline state when pipeline compilation fails 2018-04-02 19:05:41 +02:00
Philip Rebohle 267daeccad [util] Add generic Logger::log method 2018-04-02 19:05:20 +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 0582e265f0 [general] Updated README
People need to stop using DXVK_SHADER_DUMP/READ_PATH for absolutely
no reason, and they need to stop telling people to use it.
2018-04-02 17:08:46 +02:00
Philip Rebohle eb85f61084 [dxbc] Serialize hull shader fork/join phase invocations
We cannot run these in parallel in case the hull shader's output vertex
count, and thus the invocation count, is less than the fork/join phase
invocation count.
2018-04-02 16:22:19 +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 77010d96e4 [dxgi/d3d11] Set returned pointers to nullptr before returning
May solve issues with applications which check whether the returned
pointer is null rather than checking a function's return value.
2018-04-02 12:04:20 +02:00
Philip Rebohle aeef93e1e4 Merge branch 'master' of https://github.com/doitsujin/dxvk 2018-04-02 10:58:49 +02:00
Philip Rebohle d2c6ec5c41 [dxbc] Implement ImmAtomic*Min/Max instructions 2018-04-02 10:58:26 +02:00
Vesim987 a2f05467c7 [d3d11] Force CreateRenderTargetView to return S_OK with D3D11_RESOURCE_DIMENSION_BUFFER (#230)
It makes Battlefield 3 and Battlefield 4 working.
2018-03-31 21:47:54 +02:00
Philip Rebohle 00a145906c [general] Updated README with wine 3.5 hints 2018-03-31 21:35:07 +02:00
Philip Rebohle 99d9a5df0b [dxbc] Respect GloballyCoherent flag for UAVs 2018-03-31 16:41:19 +02:00
Philip Rebohle 770d94f796 [dxbc] Fix explicit memory barrier semantics
This imitates glslang behaviour for barrier instructions and
sets AcquireRelease semantics for all explicit memory barriers.
2018-03-30 17:59:57 +02:00
Philip Rebohle 47e78d0a95 [dxbc] Fixed type of atomic pointers into typed UAVs
Should fix a crash in the Nvidia driver.
2018-03-30 17:31:48 +02:00
Philip Rebohle 05e0f3d52d
[dxvk] Remove mutex from Dxvk(Graphics|Compute)Pipeline
Not needed anymore because the pipe manager itself won't be
accessed by multiple threads any longer.
2018-03-29 16:36:31 +02:00
Philip Rebohle b286b518c5
[dxbc] Fix ForkInstanceId type in EmitHsForkJoinPhase 2018-03-29 14:05:38 +02:00
Philip Rebohle 2ab4710054
[dxbc] Run HS fork/join phases in parallel
May reduce execution time of hull shaders on the GPU by running
the fork/join phases in parallel, as originally intended. Tested
on RADV 18.0.99 with LLVM 6.0.0.
2018-03-29 13:29:50 +02:00
Philip Rebohle 6e27f12e22
[dxvk] Move DxvkPipelineManager object to DxvkContext
Since we create only one DxvkContext per D3D11Device, rather than
per D3D11DeviceContext as originally planned, there is no need to
keep the pipeline manager as a global thread-safe object. This may
slightly reduce CPU overhead.
2018-03-29 12:32:20 +02:00
Philip Rebohle 108bf2194f
[dxvk] Time pipeline creation in debug mode 2018-03-29 12:06:53 +02:00
notaz 5eefb8530d [general] More wine test suite fixes (#220)
* [dxgi] Implement freeing private data

Done by passing null as data.
Fixes wine private data test crash and passes them.

* [dxgi] Improve private data argument handling

Fixes 7 more wine tests.
2018-03-29 07:11:21 +02:00
Philip Rebohle ae88f83b86
[d3d11] Introduce D3D11DeviceContainer
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.
2018-03-28 21:24:52 +02:00
Philip Rebohle 8d3dcba8d5
[dxgi] Renamed private DXGI interfaces 2018-03-28 19:06:00 +02:00
Philip Rebohle 410cde3f17
[dxgi] Move device creation to DxgiAdapter
This is better than exporting new functions.
2018-03-28 18:58:53 +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 87f9bcfd75
[dxbc] Do not use locations >32 for tess control outputs
Fixes an assertion with latest mesa-git.
2018-03-28 11:55:29 +02:00
Philip Rebohle 1a8567a363
[d3d11] Fixed silly bug in blend state comparison 2018-03-28 11:55:03 +02:00
Philip Rebohle 873deed4a3
[general] Added --no-package option to package script 2018-03-27 18:45:05 +02:00
Philip Rebohle 057d74e57f
Merge branch 'master' of https://github.com/doitsujin/dxvk 2018-03-27 02:02:50 +02:00
notaz 5411689789 [dxgi] More argument handling improvements (#211)
Fixes 11 tests + a crash.
2018-03-27 01:58:33 +02:00
Philip Rebohle a700e928ef
[dxbc] Enable MultiViewport capability if needed
Fixes invalid SPIR-V generated since  60d6416e5f.
2018-03-27 01:41:06 +02:00
Philip Rebohle 60d6416e5f
[dxbc] Implemnted SV_ViewportArrayIndex for geometry shaders
Required by Final Fantasy XIV.
2018-03-26 23:32:30 +02:00
Philip Rebohle fc47fb8f6c
[dxvk] Do not create descriptor set layout/template if binding count is 0
Fixes a validation error in case an application renders geometry without
any active shader resource slots.
2018-03-26 23:13:33 +02:00