1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 10:24:12 +01:00
Commit Graph

987 Commits

Author SHA1 Message Date
Philip Rebohle
4a0c9dbaba
[d3d11] Validate texture sample count
Fixes incorrect return values in case a game tries to create
a texture with an unsupported number of samples.
2018-04-13 13:46:45 +02:00
Philip Rebohle
ebf474ae9e
[dxvk] Enable VK_KHR_sampler_mirror_clamp_to_edge
Fixes validation errors in The Witcher 3.
2018-04-13 13:46:20 +02:00
Philip Rebohle
8508994a63
[d3d11] Cap mip level count for textures and views
Some games do not compute the number of mip levels of
a texture or texture view correctly, so we should work
around this by capping it to the highest possible value.
2018-04-12 23:42:11 +02:00
Philip Rebohle
56a1433d3f
[d3d11] ClearUnorderedAccessViewUInt: Create temp view if necessary
If this method is used to clear a view with a floating point format,
we need to create a compatible view with an integer format in order
to clear the resource with the correct value. Fixes some calls to
this function in Rise of the Tomb Raider and other games.
2018-04-12 23:31:15 +02:00
pchome
f806c8eafc [dxgi] Use GetMonitorInfoW function explicitly (#271)
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]).
2018-04-12 20:12:48 +02:00
Philip Rebohle
db541d188f
[dxgi] Added static format mapping table 2018-04-12 17:49:14 +02:00
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
adb1789571
[dxbc] Fixed incorrect result vector dimension for OpImageQuerySize 2018-04-12 13:57:15 +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
c9c3bc12cc
Revert "[dxgi] Create persistent DxgiOutput object"
This reverts commit ad7f0971cf.
Causes crashes in Overwatch due to weird refcount behaviour.
2018-04-12 01:48:57 +02:00
Philip Rebohle
3c6eb91c63
[dxgi] Remove Output reference from DxgiSwapChain 2018-04-12 01:28:44 +02:00
Philip Rebohle
c88170966f
[dxgi] Remove gamma control methods from DxgiOutput 2018-04-12 01:15:40 +02:00
Philip Rebohle
015e67fc7c
[dxgi] Replaced ugly pointer cast by more reasonable code 2018-04-12 00:45:23 +02:00
Philip Rebohle
ef4a3c5bfc
[d3d11] Use meta clear for ClearUnorderedAccessView* methods 2018-04-11 23:39:12 +02:00
Philip Rebohle
9d84e1bfaa
[dxvk] Implement clearBufferView and clearImageView 2018-04-11 23:13:34 +02:00
Philip Rebohle
cce578d67a
[dxvk] Increase workgroup size for buffer clear shaders 2018-04-11 23:12:55 +02:00
Philip Rebohle
2f7dcd2caf
[dxgi] Disable gamma curve in presenter
Causes regressions in many games for unknown reasons.
2018-04-11 20:55:03 +02:00
Philip Rebohle
021ea64103
[dxbc] Remove Nvidia driver version check
Apparently this causes a regression in Overwatch for some.
2018-04-11 19:44:45 +02:00
Philip Rebohle
140dc27ea3
[dxvk] Create compute pipelines for meta clear ops 2018-04-11 18:58:01 +02:00
Philip Rebohle
7c1919eaa1
[dxvk] Added missing shader files 2018-04-11 18:57:31 +02:00
Philip Rebohle
ac8447b32e
[dxvk] Add separate clear shaders for array views
Creating one shader per image view type may help in case we
get an already compatible image view from the D3D11 application.
2018-04-11 17:16:18 +02:00
Philip Rebohle
676b0cb476
[dxvk] Added DxvkMetaClearObjects stub 2018-04-11 17:05:12 +02:00
Philip Rebohle
9970dfaeca
[dxvk] Add format info flag for integer formats 2018-04-11 16:21:59 +02:00
Philip Rebohle
6a0ab19049
[dxvk] Added meta shaders for image/buffer clear operations
The D3D11 ClearUnorderedAccessView* and ClearView functions
will have to be emulated using compute shaders rather than
clear operations, since Vulkan clear operations do not take
image views and their format into account.
2018-04-11 13:07:04 +02:00
Philip Rebohle
4797645bd2
[dxvk] Removed unused DxvkOptions 2018-04-11 13:06:43 +02:00
Philip Rebohle
8ea17e7a25
[dxbc] Implemented Nop instruction
Required for Metal Gear Solid V.
2018-04-11 01:49:39 +02:00
Philip Rebohle
f3544cc8e1
[dxbc] Fix __GL_NextGenCompiler check... 2018-04-11 01:17:07 +02:00
Philip Rebohle
3ff437ddbe
[dxbc] Re-enable Nvidia workarounds if __GL_NextGenCompiler is '0'
Fixes potential regressions when using the old SPIR-V compiler.
2018-04-11 00:26:42 +02:00
Philip Rebohle
1b6442b859
[dxbc] Disable Nvidia-specific workarounds for 396.18 and above 2018-04-11 00:20:24 +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
Philip Rebohle
ad7f0971cf
[dxgi] Create persistent DxgiOutput object 2018-04-10 22:07:00 +02:00
Philip Rebohle
f13011f487
[dxgi] Implement gamma ramp in presenter
Will be used to fake IDXGIOutput::SetGammaControl.
2018-04-10 20:44:55 +02:00
Philip Rebohle
41132b8c13
[dxgi] Re-implement presentation shaders in GLSL 2018-04-10 18:46:39 +02:00
Philip Rebohle
a28303c4bd
[dxvk] Optimize binding ID remapping
We don't need to iterate over the full shader code when creating
a new shader module. This optimization may slightly reduce the
initial pipeline creation time.
2018-04-10 12:48:46 +02:00
Philip Rebohle
5d1642af1f
[spirv] Track instruction offset in instruction iterator 2018-04-10 12:48:24 +02:00
Philip Rebohle
1fb22a6022
[dxbc] Refactored opcode controls 2018-04-10 08:01:54 +02:00
Philip Rebohle
5cb65a6c19
[dxbc] Fix sampleinfo_uint instruction 2018-04-09 22:52:59 +02:00
Philip Rebohle
d68d62f837
[dxvk] Removed on-disk pipeline cache
Drivers from both major vendors implement their own shader cache
already, and storing a cache per game causes more issues than it
solves. Should fix #261.
2018-04-09 19:38:32 +02:00
Philip Rebohle
8a4e1d11b7
[dxbc] Add missing component count to gs_layer variable type
Fixes an incorrect geometry shader in Overwatch.
2018-04-09 00:20:27 +02:00
Philip Rebohle
bd5254f8d3
[d3d11] Fixed compiler errors
Why the hell did my GCC not complain about this earlier?
2018-04-08 22:26:35 +02:00
Philip Rebohle
687ef77860
[dxvk] Enable sample rate shading if needed 2018-04-08 21:49:30 +02:00
Philip Rebohle
797d7ec81d
[dxbc] Enable CapabilitySampleRateShading capability when needed
Fixes SPIR-V validation errors in the Final Fantasy XV benchmark.
2018-04-08 21:06:58 +02:00
Philip Rebohle
4c3e77e9e3
[dxvk] Add missing format info for the *_422_UNORM formats 2018-04-08 20:40:12 +02:00
Philip Rebohle
e38cc4a0e0
[dxbc] Implement support for SV_PrimitiveID
Fixes some geometry/tessellation shaders in The Witcher 3.
2018-04-08 18:25:44 +02:00
Philip Rebohle
83a0eda4f6
[dxgi] Fixed packed 16-bit format mappings 2018-04-08 15:19:26 +02:00
pchome
acaf6c9e87 [d3d11] Fix compilation with WINE headers (#247)
All this structures are defined in WINE headers but `D3D11_FORMAT_SUPPORT2`.
2018-04-07 14:02:57 +02:00
pchome
62b99c9bd2 [util] Fix compilation with WINE headers (#246)
* [util] Define typeof keyword for WINE guiddef.h

GCC: `-std options disable certain keywords`
https://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html

MinGW: `#define __uuidof(type) __mingw_uuidof<__typeof(type)>()`
WINE: `#define __uuidof(type) __wine_uuidof<typeof(type)>()`

* [util] Fix compilation with WINE headers

Overall definitions are the same but `__wine_` prefix used in .

MinGW: _mingw.h + guiddef.h
WINE: guiddef.h
2018-04-07 14:01:13 +02:00
Philip Rebohle
00a452ed89
[d3d11] Implement DXBC shader module cache
If an application compiles the same shader multiple times, we should reuse
an already existing DxvkShaderModule instead of creating a new one. This
helps keep the number of DxvkGraphicsPipeline objects low in games such
as Rise of the Tomb Raider.
2018-04-06 17:54:02 +02:00
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
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
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
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
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
notaz
f02b44f440 [dxgi] Fix some argument checks (#205)
Changed according to wine's tests.
2018-03-26 07:38:37 +02:00
Philip Rebohle
675b1c5b8c
[d3d11] Implemented image mapping on deferred contexts
Also refactored buffer mapping to reduce code duplication.
Optimized the lookup function for a small performance gain
in games which map a lot of resources on deferred contexts.
2018-03-25 13:24:03 +02:00
Philip Rebohle
61c55d6f89
[d3d11] Get rid of redundant format query 2018-03-25 08:38:31 +02:00
Philip Rebohle
4e84a77896
[d3d11] Disable DO_NOT_WAIT flag by default
Apparently this breaks Elder Scrolls Online as well, so we'll
just enable it explicitly for games which benefit from this
optimization and disable it by default.
2018-03-25 00:54:42 +01:00
Philip Rebohle
4ed007e9f6
[d3d11] Add <unordered_map> include
Fixes #201.
2018-03-24 18:54:00 +01:00
Philip Rebohle
0900e1b5f9
[d3d11] Added missing files 2018-03-24 17:29:13 +01:00
Philip Rebohle
bd69e843c2
[d3d11] Added D3D11Options
Includes a per-app knob for Witcher 3 to disable D3D11_MAP_FLAG_DO_NOT_WAIT.
2018-03-24 17:02:24 +01:00
Philip Rebohle
ac94c42380
Revert "[dxbc] Do not emit per-vertex input block"
This reverts commit 4ce64bd886.

Fixes a regression in Sniper: Ghost Warrior 2 and Dishonored 2.
2018-03-24 16:23:31 +01:00
Philip Rebohle
54382ae319
[dxbc] Add experimental support for mixed resource types
HLSL tbuffers are translated to resources with a "mixed" format.
There is no documentation about which format the buffers actually
use, so we'll default to UINT and see what happens.
2018-03-24 14:21:13 +01: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
Philip Rebohle
7f7eedac35
[dxbc] Implement SV_ClipDistance and SV_CullDistance 2018-03-24 11:29:07 +01:00
Philip Rebohle
4ce64bd886
[dxbc] Do not emit per-vertex input block
Instead, we can let the normal input registers do their thing.
2018-03-24 00:32:22 +01:00
Philip Rebohle
0ab27aa4e3
[dxbc] Check if the signature is nullptr before using it
Fixes a crash in The Witcher 3.
2018-03-23 21:38:21 +01:00
Philip Rebohle
31772af4a5
[dxbc] Count clipping and culling planes 2018-03-23 19:48:07 +01:00
Philip Rebohle
ba9e1f307d
[dxbc] Don't use rvalue references for file streams 2018-03-23 18:17:16 +01:00
Philip Rebohle
0a2fa590f5
[d3d11] Reset busy flag after emitting the Flush command
Fixes a general performance regression in games
that call WaitForResources a lot.
2018-03-23 11:54:19 +01:00
Philip Rebohle
e6d93d6cfb
[spirv] Emit image types only once
Fixes SPIR-V validation errors.
2018-03-23 01:10:12 +01:00
Philip Rebohle
abb90086d5
[dxvk] Use analyzer to determine UAV image type 2018-03-23 01:04:04 +01:00
Philip Rebohle
44d8d6b8c3
[dxvk] Fixed command buffer synchronization 2018-03-22 20:15:46 +01:00
Philip Rebohle
16caa10697
[dxbc] Add analyzer stub
Will be used to gather information for the compiler.
2018-03-22 20:01:57 +01:00
Philip Rebohle
085fd6a959
[d3d11] Remove unnecessary Map() check 2018-03-22 19:28:00 +01:00
Philip Rebohle
2566909917
[dxvk] Remove DxvkFence 2018-03-22 19:01:01 +01:00
Philip Rebohle
0bdae4f930
[dxvk] Move fence object into DxvkCommandList
Reduces command submission overhead by reusing fence objects
instead of creating new ones for each submission. Improves
error reporting in case the submission cannot be complete.
2018-03-22 18:57:33 +01:00
Philip Rebohle
d9b1995cf0
[d3d11] Do not forward D3D11_MAP_FLAG_DO_NOT_WAIT for mapped images
Workaround for a regression in The Witcher 3 that was introduced
in commit 53d557c2db. May have a
significant negative impact on performance in some games.
2018-03-22 14:12:43 +01:00
Philip Rebohle
b3aff7cd2e
[d3d11] Fix immediate context initialization
The old initialization code did not take either CSMT or
Deferred Contexts into account and could lead to illegal
calls to beginRecording.

Fixes a hang encountered in Dishonored 2.
2018-03-22 13:40:45 +01:00
Philip Rebohle
7f6c8dff95
[d3d11] Fix flush condition and CS thread synchronization
If chunks have been sent to the CS thread, we need to
flush even if the current chunk is empty.
2018-03-22 12:58:26 +01:00
Philip Rebohle
5eedbc0546
[dxgi] Always use 32-bit depth buffers instead of 24-bit
Support for 24-bit depth buffers seems poor even on GPUs which support
them, and there seem to be no issues with using 32-bit buffers in practice.
2018-03-22 11:09:23 +01:00
Philip Rebohle
53d557c2db
[d3d11] Implement D3D11_MAP_FLAG_DO_NOT_WAIT
Improves framerate in Dishonored 2 by up to 50%.
2018-03-22 11:02:14 +01:00
Philip Rebohle
9215cfdcf2
[dxvk] Minor 2018-03-22 11:01:54 +01:00
Philip Rebohle
5c2144b55d
[dxvk] Move tess state validation to validatePipelineState 2018-03-21 15:22:18 +01:00
Philip Rebohle
ec161823e5
[dxvk] Check whether renderpass is null before creating pipeline 2018-03-21 15:09:34 +01:00
Philip Rebohle
6f6e12a329
[util] Fix possible crash with null interfaces in private storage 2018-03-21 15:09:08 +01:00
Philip Rebohle
9ef94e28ac
[dxbc] Support UNorm/SNorm typed resources 2018-03-21 15:08:53 +01:00
Philip Rebohle
08806070ca
[d3d11] Fix CheckFeatureSupport return value 2018-03-21 15:08:34 +01:00
Philip Rebohle
efcd5c6b4d
[d3d11] Implement support for D3D11_FEATURE_FORMAT_SUPPORT2 2018-03-21 13:31:22 +01:00
Philip Rebohle
09151f3616
[d3d11] Lift shaderStorageImageReadWithoutFormat requirement 2018-03-21 12:57:29 +01:00
Philip Rebohle
584ee6b6f0
[dxbc] Lift ShaderStorageImageReadWithoutFormat requirement 2018-03-21 12:47:53 +01:00
Philip Rebohle
fcff10aae7
[dxbc] Set image format for UAVs when atomic operations are used
Fixes a violation of the Vulkan specification where atomic operations
would be used on storage images with SpvImageFormatUnknown. Should fix
driver crashes on Nvidia.

TODO: Fix data types for atomic operation instructions.
2018-03-21 12:11:18 +01:00
Philip Rebohle
c1a1ff3915
[d3d11] Implement remaining D3D11.1 feature queries 2018-03-21 04:58:31 +01:00
Philip Rebohle
17e981f360
[dxvk] Increase UAV slot count to 64 for the graphics pipeline
D3D11 raised this limit from 8 UAVs in the fragment shader to
64 UAVs in all graphics stages combined.
2018-03-21 04:56:33 +01:00
Philip Rebohle
bd71f256e5
[d3d11] Fixed constant buffer binding update 2018-03-21 03:26:31 +01:00
Sebastian Wick
4518b1b76e Shader cache (#188)
* [util] Adds getTempDirectory() function

Will be used by on-disk pipeline caching

* [dxvk] Implement on-disk shader caching

Saving the pipeline cache to disk when the application exits
should be sufficient but the DxvkPipelineCache destructor isn't
reliably called on exit (ref-counting issue?).
As a workaround every frame we check and save the cache if the
size increased by some amount or after one minute elapsed.

* [dxvk] Periodically update shader cache file in separate thread
2018-03-21 02:45:11 +01:00
Philip Rebohle
6550e8d623
[d3d11] Expose implemented Feature Level 11.1 features 2018-03-20 23:25:23 +01:00
Philip Rebohle
894444d43d
[dxvk] Remove old debug code 2018-03-20 22:36:02 +01:00
Philip Rebohle
42d49d7603
[dxvk] Respect bufferImageGranularity for non-linear images
May fix aliasing issues on GPUs where the bufferImageGranularity limit
is greater than the alignment requirement of non-linear resources.
2018-03-20 20:24:11 +01:00
Philip Rebohle
fd4e55007f
[d3d11] Export support for driver command lists
This indicates that our implementation of UpdateSubresource on
deferred contexts is not affected by the same issue as on Windows.
2018-03-19 17:57:20 +01:00
Philip Rebohle
493ad66d91
[d3d11] Remove obsolete acquire/release pair
This is no longer needed with the universally
thread-safe slice allocator.
2018-03-19 17:56:26 +01:00
Philip Rebohle
f762811af0
[dxvk] Use multiple free lists for physical buffer slices
Reduces lock contention and slightly improves performance in games
that rely heavily on the buffer renaming mechanism if the lock
protecting the original free list was contested.
2018-03-19 14:53:59 +01:00
Philip Rebohle
c6251d28fc
[d3d11] Remove warnings from CopySubresourceRegion1 / UpdateSubresource1
The flags should have no impact on correctness, so not supporting them
makes no difference. Prevents log spam in Dishonored 2.
2018-03-19 14:52:42 +01:00
pchome
2f8ccfa30e
[build] Add header required for std::find_if() 2018-03-19 12:49:48 +02:00
Philip Rebohle
f1c3b59e87
[d3d11] Implemented buffer mapping on deferred contexts
Allows the MultiThreadedRendering demo from the Microsoft SDK to run.
2018-03-19 03:19:13 +01:00
Philip Rebohle
0eaa3fea3b
[dxvk] Implement thread-safe buffer renaming
This is required for resource mapping on deferred contexts.
May also fix a potential synchronization issue where a buffer
could be mapped multiple times before the CS thread would mark
the physical buffer as used, which would result in invalid data.
2018-03-19 02:18:44 +01:00
Philip Rebohle
d6d6ed4efd
[d3d11] Expose Feature Level 11_1 if explicitly requested
Not enabled by default since some 11_1 functionality is not yet implemented.
2018-03-18 23:39:40 +01:00