1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-30 04:24:11 +01:00
Commit Graph

1040 Commits

Author SHA1 Message Date
Philip Rebohle
d5041337f5 [d3d11] Use linar tiling for textures if optimal tiling is not supported
Fixes texture creation issues in various Batman games.
2018-04-29 14:43:24 +02:00
Philip Rebohle
9aa73d1148 [dxvk] Set non-zero framebuffer size when there are no attachments
This is required for UAV-only rendering and will be required for
stream output in the future as well.
2018-04-29 11:19:18 +02:00
Philip Rebohle
7cb7e4a944 Merge branch 'master' of https://github.com/doitsujin/dxvk 2018-04-28 14:18:18 +02:00
Philip Rebohle
99813a7778 [d3d11] Use const ref pointer for device parameter
Closes #323.
2018-04-28 14:17:52 +02:00
pchome
4a74cd45d5 [clang-tidy] performance-move-const-arg fix (#324)
https://clang.llvm.org/extra/clang-tidy/checks/performance-move-const-arg.html
2018-04-28 14:13:23 +02:00
pchome
1dbf8bf2a1 [dxvk] Fix native build on *nix x86_64 systems (#328)
* [dxvk] Fix native build on *nix x86_64 systems

> /usr/include/c++/v1/algorithm:2633:1:
> note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('unsigned long' vs. 'unsigned long long')

winegcc, clang-tidy and other native build types/tools are affected.

http://en.cppreference.com/w/cpp/language/types#Data_models
> 64 bit systems:
> * LLP64 or 4/4/8 (int and long are 32-bit, pointer is 64-bit) 
>    * Win64 API 
> * LP64 or 4/8/8 (int is 32-bit, long and pointer are 64-bit) 
>    * Unix and Unix-like systems (Linux, Mac OS X) 

http://en.cppreference.com/w/cpp/types/integer#Function_macros_for_minimum-width_integer_constants
Macro `UINT64_C(1)` from `stdint.h` should literally interpret `1` to `1UL` or `1ULL`
```c
# if __WORDSIZE == 64
#  define UINT64_C(c)	c ## UL
# else
#  define UINT64_C(c)	c ## ULL
# endif
```

* [dxvk] Fix native build on *nix x86_64 systems

Use explicit template argument instead of 1ull or UINT64_C(1) macro.
2018-04-28 09:08:14 +02:00
pchome
78e8621d09 [clang-tidy] performance-for-range-copy fix (#322)
https://clang.llvm.org/extra/clang-tidy/checks/performance-for-range-copy.html
2018-04-28 01:14:57 +02:00
Philip Rebohle
1784b8c44d [d3d11] Merge interop API 2018-04-26 22:20:09 +02:00
Philip Rebohle
8cb3a266f7 [dxvk] Fix potential state tracking issue when updating render targets 2018-04-26 18:43:19 +02:00
Philip Rebohle
962a7f5766 [dxvk] Ignore redundant render target bindings
Further reduces render pass count if applications bind render targets
without using them, and then bind the old set of render targets again.
2018-04-26 15:30:18 +02:00
Philip Rebohle
1075990dbe [dxvk] Apply render target bindings at draw time
This should help reduce the number of redundant render pass spills,
especially in games which use deferred contexts for rendering. This
optimization mostly helps in GPU-bound scenarios.
2018-04-26 14:47:55 +02:00
Philip Rebohle
8606576d83 [hud] Do not explicitly use a framebuffer object 2018-04-26 13:24:42 +02:00
Philip Rebohle
5eaacf7459 [dxbc] Add gs_vertex_in to the entry point interface
Fixes invalid SPIR-V generated in the Blacksmith demo (#267).
2018-04-23 18:07:31 +02:00
Philip Rebohle
d91114d733 [dxvk] Rename renderPassBegin/End methods to start/spillRenderPass 2018-04-23 11:11:40 +02:00
Philip Rebohle
a5c43b5e59 [dxbc] Enable array texture hack for Dishonored 2
Partially fixes shadow rendering issues.
2018-04-23 11:09:48 +02:00
Philip Rebohle
01147492d5 [dxbc] Implemented Texture2D -> Texture2DArray mapping as a knob
Doing this for all applications is not necessary and degrades
performance in some cases.
2018-04-23 00:46:27 +02:00
Philip Rebohle
e53cb72e39 [dxbc] Make DxbcOptions a set of flags
This allows for game-specific workarounds and driver-specific
workarounds to be applied in an easier fashion.
2018-04-22 23:49:41 +02:00
Philip Rebohle
cfcca11fc5 [d3d11] CopySubresourceRegion: Fix block size alignment check
The source region size doesn't have to be aligned to the destination
block size. We should be checking whether the destination region is
aligned to the destination block size.
2018-04-22 23:00:31 +02:00
Philip Rebohle
4a71da3a1c [d3d11] Improved debug output for CopySubresourceRegion 2018-04-22 22:35:10 +02:00
Philip Rebohle
2f20a61342 [dxbc] Map 2D MS shader resource views to 2D MS Array views
Works around a game bug in Dragon Age: Inquisition, which binds
an MS image to a non-MS resource slot. Closes
2018-04-22 18:27:01 +02:00
Philip Rebohle
cd63ff6d76 [dxbc] Fix operand type of resinfo_rcp_float division
Fixes invalid SPIR-V generated for this instruction.
2018-04-22 16:43:16 +02:00
Philip Rebohle
f30923718f [dxbc] Fix texture component count for OpImageQueryLod
Not a bug, but we don't need the extra component when dealing with
array images.
2018-04-22 14:08:01 +02:00
Philip Rebohle
0bf97993c6 [dxbc] Fix layer count in resinfo instruction
For non-layered types, this instruction is supposed to return 0, not 1.
2018-04-22 08:34:07 +02:00
Philip Rebohle
f71f527b4d
[d3d11] Prevent mapping of depth-stencil textures
We currently don't support this, and copying data back and forth
with the wrong image aspect set crashes the RADV driver.
2018-04-21 20:34:41 +02:00
Philip Rebohle
dcb5b2a20c
[dxbc] Map 1D and 2D textures to their respective array type v2
We need to adjust the texture coordinate vectors as well, so that
some instructions continue to work properly.
2018-04-21 18:09:43 +02:00
Philip Rebohle
0318cc730a
Revert "[dxbc] Map 1D and 2D textures to their respective array type"
Broken. Requires some prep work in the shader compiler.
2018-04-21 15:38:39 +02:00
Philip Rebohle
906355b0da
[dxbc] Map 1D and 2D textures to their respective array type
As with cube textures, some games think it's a good idea to bind a
non-array view to a slot that expects an array view or vice versa.
Fixes clouds not appearing in TrackMania 2 Stadium (#191).
2018-04-21 14:15:10 +02:00
Philip Rebohle
0558a3b2c5
[d3d11] Fix incorrect cube face count calculation 2018-04-21 14:14:42 +02:00
Philip Rebohle
fd1c50d8d8
[dxbc] Fixed incorrect shader resource slot computation 2018-04-21 14:01:27 +02:00
ZeroFault
52f0d853c0 [d3d11] add some resource validation for copying resources (#305)
* [d3d11] add some resource validation for CopyResource and CopyResourceSubregion

combine if statement

* [d3d11] added copy extents validation for compressed formats

* correct return values

* fix incorrect logic operators

* set valid copy extents when possible

* [d3d11] Clamp copy region in CopySubresourceRegion

* [dxvk] Add helper methods to deal with block-compressed images

* [d3d11] Clean up validation in CopySubresourceRegion

* [d3d11] Improve error reporting and validation in CopyResource

* [d3d11] Fix inconsistent error messages
2018-04-20 23:35:29 +02:00
Philip Rebohle
50f1cf007d
[dxbc] Implement precise flag
May fix depth precision in Skyrim SE (issue #189).
2018-04-20 23:32:51 +02:00
Philip Rebohle
f52cc3859b
[general] Use non-default wine prefix in build script 2018-04-20 17:28:45 +02:00
Philip Rebohle
1ed1c43431
[d3d11] Wire up D3D11VkInteropSurface to D3D11Texture*D classes 2018-04-20 11:12:54 +02:00
Philip Rebohle
81a0fa4805
[d3d11] Implemented IDXGIVkInteropSurface for common textures 2018-04-20 10:38:39 +02:00
Joshua Ashton
90e7fe6791 Make hashes use correct types and fix narrowing warnings in spirv module. (#307)
* Fix narrowing warnings in spirv_module relating to enum's default width on x64

* Make hashes of states use correct types without casting.

* Fix narrowing conversion in d3d11_sampler.cpp
2018-04-20 01:10:58 +02:00
Philip Rebohle
62b0e34a73
[d3d11] Implement IDXGIVkInteropDevice for D3D11Device 2018-04-20 00:19:03 +02:00
Philip Rebohle
c2854e1fb9
[dxgi] Added IDXGIVkInteropSurface interface 2018-04-19 20:13:53 +02:00
Philip Rebohle
478a87f6d2
[dxgi] Added IDXGIVkInteropDevice interface 2018-04-19 15:46:57 +02:00
Philip Rebohle
a6a22cd00a
[dxvk] Export DxvkDeviceQueue from DxvkDevice
Access to the Vulkan queues provided by the DXVK device
is required for external Vulkan libraries to work.
2018-04-19 15:42:48 +02:00
Joshua Ashton
cfd3723221 Workaround for C++ STD not being set on MSVC/Visual Studio 2017 (#304) 2018-04-19 11:47:17 +02:00
Philip Rebohle
8eb78591a0
[dxbc] Scan pixel shader output register type at declaration time
Fixes invalid shaders being generated in the Blacksmith demo on
some GPUs. Works around a possible issue in the output signature
reader.

Commit #1000, yay.
2018-04-18 21:14:34 +02:00
Philip Rebohle
8125d53e58
[dxvk] Remove std::clamp usage
Breaks outdated compilers.
2018-04-18 17:49:11 +02:00
Philip Rebohle
adb0f5e16b
[dxgi] DxgiSwapchain: Check whether window is valid
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.
2018-04-18 17:30:46 +02:00
Philip Rebohle
bb3e3c9e4f
[dxgi] GetDisplayModeList: Report DXGI_MODE_SCALING_UNSPECIFIED
This is what happens on Windows 10. In addition, we might have
to add CENTERED and STRETCHED entries for non-native modes.
2018-04-18 16:04:17 +02:00
Philip Rebohle
ffe3028285
[dxgi] GetDisplayModeList: Sort display mode list
Some games, including Dark Souls 3, rely on display modes
being returned in a specific order. This emulates Windows
10 behaviour.
2018-04-18 15:33:56 +02:00
Philip Rebohle
01061e43aa
[dxgi] GetDisplayModeList: Do not report modes as stretched
This is more in line with what Windows does. Games should now be
able to list more than just the monitor's maximum resolution again.
2018-04-18 15:33:15 +02:00
Philip Rebohle
05a96e96bb
[dxvk] Fix Nvidia driver version reporting 2018-04-17 23:34:16 +02:00
Philip Rebohle
669df2146b
Merge branch 'master' of https://github.com/doitsujin/dxvk 2018-04-17 22:23:46 +02:00
Philip Rebohle
fcdba67b88
[d3d11] Implement 2D<->3D image copies in CopySubresourceRegion 2018-04-17 22:22:49 +02:00
Vesim
b82ae16f8a [dxbc] Moved all operators in dxbc_names to dxvk namespace (#296) 2018-04-17 17:33:07 +02:00