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

941 Commits

Author SHA1 Message Date
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
Philip Rebohle
127fad89be
[d3d11] Refactored D3D11SamplerState creation 2018-03-18 23:35:40 +01:00
Philip Rebohle
b04e9b5f18
[d3d11] Refactored D3D11DepthStencilState creation 2018-03-18 23:32:01 +01:00
Philip Rebohle
11d8eb3be4
[d3d11] Implemented D3D11BlendState1 2018-03-18 23:27:29 +01:00
Philip Rebohle
2591bbdabd
[d3d11] Implemented ID3D11RasterizerState1 stub 2018-03-18 22:53:20 +01:00
Philip Rebohle
0a473b4f86
[d3d11] Return error if an application creates an RTV for a buffer
Vulkan does not support buffer RTVs, and neither does DXVK, so we
should return an error in that case. Previously, DXVK would crash
upon querying image information.
2018-03-18 21:38:48 +01:00
Philip Rebohle
69dd05b269
[dxgi] Fix back buffer destruction
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.
2018-03-18 20:39:14 +01:00
Philip Rebohle
e009e63aa7
[d3d11] Fix sampler state refcount issue
We cannot use strong references in state objects that
are stored inside a member of the device itself.
2018-03-18 14:57:14 +01:00
Philip Rebohle
2346a2ac03
[d3d11] Remove inconsistent uses of "this" 2018-03-18 12:57:39 +01:00
Philip Rebohle
c43702e445
[d3d11] Implement GetConstantBuffers1 methods 2018-03-18 12:45:27 +01:00
Philip Rebohle
e54246d000
[d3d11] Implement SetConstantBuffers1 methods 2018-03-18 12:39:11 +01:00
Philip Rebohle
3133e4ba35
[d3d11] Add constant buffer offsets and counts to context state 2018-03-18 12:36:45 +01:00
Philip Rebohle
a8eecfbfe5
[d3d11] Enable direct image mapping by default 2018-03-18 00:36:53 +01:00
Philip Rebohle
94aa650f3e
[dxvk] Enable the use of VK_KHR_descriptor_update_template
Reduces the CPU overhead of descriptor set updates, which usually
happen once per draw call. Gains seem to be minor in most games,
some outliers show significantly better performance (i.e. Tomb Raider).
2018-03-17 23:50:03 +01:00
Philip Rebohle
0f800c6c51
[dxvk] Added Vulkan function pointers for VK_KHR_descriptor_update_template 2018-03-17 22:35:50 +01:00
Philip Rebohle
ebd46e4109
[d3d11] Re-define D3D11_FEATURE_DATA_ARCHITECTURE_INFO
Fixes previous commit on MinGW.
2018-03-17 21:38:35 +01:00
Mikhail Paulyshka
043982d3be [d3d11] stub implementation of ID3D11Device1 (#175) 2018-03-17 20:11:00 +01:00
Mikhail Paulyshka
a3e7139c1e [d3d11] stub implementation of ID3DDeviceContext1 (#174) 2018-03-17 18:54:09 +01:00
Philip Rebohle
52a9a4f406
[dxvk] Reimplemented clearRenderTarget
Closer to the D3D11 API. We cannot use the normal clearColorImage and
clearDepthStencilImage methods in case the game uses a 2D array view
for a 3D image. Fixes some validation issues in Hellblade.
2018-03-17 17:59:43 +01:00
Philip Rebohle
1af52abb67
[d3d11] Move OMSetRenderTargets optimization to D3D11ImmediateContext
We cannot call Flush() on deferred contexts anyway, so the command
submission optimization should only be applied to immediate contexts.
2018-03-17 14:09:16 +01:00
Philip Rebohle
ccfe1a346b
[d3d11] Moved GetViewFromDesc and NormalizeDesc out of D3D11Devuce 2018-03-17 13:42:37 +01:00
Philip Rebohle
0ddbb58ce4
[d3d11] Enable IDXGIDevice2 interface query 2018-03-17 13:05:55 +01:00
Philip Rebohle
3b43c1c183
[dxgi] Support more formats in the presenter
Should surpress "Unsupported format" warnings in games
based on Unreal Engine 4 and Frostbite Engine.
2018-03-17 09:20:06 +01:00
Mikhail Paulyshka
608cd33a25 [dxgi] added stub implementation of IDXGIDevice2 (#172) 2018-03-17 01:48:55 +01:00
Philip Rebohle
b9b74eb961
Merge pull request #169 from Mixaill/fix-msvc-64
[dxbc] fix MSVC 64-bit build
2018-03-17 01:05:04 +01:00
Guy1524
b3cd7547ca Move Custom PCI ID to DXGI 2018-03-16 19:40:26 -04:00
Mikhail Paulyshka
fd633ea784 [dxbc] fix MSVC 64-bit build 2018-03-17 01:59:13 +03:00
Philip Rebohle
c931b4ba87
[dxvk] Implement proper compute pipeline lookup
Fixes correctness issues and potential GPU lockups in case
a compute shader resource is not bound at dispatch time.
2018-03-16 01:25:18 +01:00
Philip Rebohle
9b3908823a
[dxvk] Fixed depth image layout regression 2018-03-16 01:05:30 +01:00
Philip Rebohle
eb8ae5cc82
[d3d11] Allow 2D array view creation for 3D textures
Fixes a regression that was introduced with the texture
class refactor. Fixes validation issues in Hellblade.
2018-03-14 20:40:11 +01:00
Philip Rebohle
0e0ee61d9b
[d3d11] Always use VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT
We need to investigate why not doing this breaks shadows in Heaven.
2018-03-14 17:40:26 +01:00
Philip Rebohle
3b20c71894
[d3d11] Re-implement direct image mapping (disabled by default)
We cannot enable this by default yet because it may break some games.
2018-03-14 16:40:28 +01:00
Philip Rebohle
155bd32e22
[d3d11] Check if a textue can be created before making the attempt
This may prevent driver crashes and give more useful debugging info
in case a given combination of image parameters is not supported by
a device. May also improve compatibility with direct image mapping.
2018-03-14 16:03:48 +01:00
Philip Rebohle
7a6d61d943
[d3d11] Create mapped image buffer only when needed
Also adds some documentation to D3D11CommonTexture.
2018-03-14 14:49:45 +01:00
Philip Rebohle
0ba3337289
[d3d11] Refactored Map/Unmap methods 2018-03-14 14:40:09 +01:00
Philip Rebohle
91b82c05b2
[d3d11] Refactoring texture classes: Move static methods into D3D11CommonTexture 2018-03-14 01:16:31 +01:00
Philip Rebohle
56df0bcccb
[d3d11] Refactoring texture classes: Remove D3D11TextureInfo 2018-03-14 00:45:07 +01:00
Philip Rebohle
16d66c8a1d
[d3d11] Refactoring texture classes: Introduce D3D11CommonTexture 2018-03-13 23:51:30 +01:00
Philip Rebohle
e6814332e7
Revert "[d3d11] Re-enable image mapping"
Still breaks games for unknown reasons.
2018-03-13 17:40:12 +01:00
Philip Rebohle
ba2c4782b0
[spirv] Removed SPIR-V Tools headers 2018-03-13 14:58:17 +01:00
Philip Rebohle
25cae39cdb
[spirv] Remove SPIR-V tools integration
SPIR-V tools did not turn out to be useful, but increased the
binary size by a significant amount and caused build problems.

- spirv-opt: Far too slow for the intended purpose, and Nvidia
             specific shader issues have been reported and fixed.
- spirv-val: Not much value in practice since shaders can be
             written to a directory and validated manually.
2018-03-13 14:32:03 +01:00
Philip Rebohle
8e9d0878e6
[dxvk] Remove RenderDoc workaround
RenderDoc 1.0 cannot be used with DXVK anymore,
which makes the workaround obsolete.
2018-03-13 11:43:23 +01:00
Philip Rebohle
72f954088b
[d3d11] Use only one mip level for multisampled textures 2018-03-13 11:29:25 +01:00
Philip Rebohle
06cff50453
[d3d11] Flush CS chunks when executing/finalizing command lists
Fixes rendering issues and validation errors in Kingdom Come: Deliverance.
2018-03-12 23:36:55 +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
d3a4230acf [d3d11] D3D11Device::QueryInterface() suppress warning for d56e2a4c-5127-8437-658a-98c5bb789498
there is no public information about this interface
2018-03-12 23:29:44 +03:00
Philip Rebohle
887e514442
[dxvk] Use dummy viewport if requested viewport size is 0
Fixes a bunch of validation errors in various games,
including The Witcher 3.
2018-03-12 13:14:27 +01:00