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

1052 Commits

Author SHA1 Message Date
Philip Rebohle
41fca78d27 [dxgi] Add GetDevice method to IDXGIVkInteropSurface
Convenient way of getting the IDXGIVkInteropDevice from the surface
without having to go through several D3D interface queries.
2018-05-01 23:30:39 +02:00
Philip Rebohle
badb93334e [dxvk] Fix DxvkContext::transformImage
We have to spill the render pass before transforming the
image. We don't need the barrier if the old and new
layout are the same.
2018-05-01 23:29:58 +02:00
Philip Rebohle
4c298d486d [dxgi] Restore display mode even when the window got destroyed 2018-04-30 20:15:35 +02:00
Philip Rebohle
46f2e4d864 [dxgi] CheckInterfaceSupport; Log interface queries 2018-04-30 20:01:50 +02:00
Philip Rebohle
2626a26072 [d3d11] Fix sampler state validation for anisotropy
Fixes an issue where samplers are not created in Path of Exile.
2018-04-30 19:36:42 +02:00
Philip Rebohle
ba53cf92ac Revert "[dxvk] Refactor DxvkFramebuffer and DxvkRenderpass"
This reverts commit 1bbfe77013.
Breaks Path of Exile.
2018-04-30 18:47:35 +02:00
Philip Rebohle
16a25db846 Merge branch 'master' of https://github.com/doitsujin/dxvk 2018-04-30 15:56:32 +02:00
Philip Rebohle
1bbfe77013 [dxvk] Refactor DxvkFramebuffer and DxvkRenderpass 2018-04-30 15:47:29 +02:00
ZeroFault
768a078250 [d3d11] Implement state block normalization (#333)
* [d3d11] implement stateblock normalization

* add const to default state description object

* fix code formatting

* Correct the blend state normalization

* add missing error return

* code cleanup and refactoring

* remove unecessary const qualifier and fix code formatting

* [d3d11] Cosmetic changes
2018-04-30 10:41:57 +02:00
Philip Rebohle
a32050374c [dxgi] Implement display mode changes
Allows games to change the screen resolution in fullscreen
mode. This is currently in a rough shape and some games may
not work as expected when selecting fullscreen mode.
2018-04-29 23:03:27 +02:00
Philip Rebohle
a3c561f9dc [dxgi] LeaveFullscreenMode: Correctly restore the window size 2018-04-29 17:26:00 +02:00
Philip Rebohle
1bcae90dd0 [dxvk] Fix image layouts for images using VK_IMAGE_TILING_LINEAR
We have to use VK_IMAGE_LAYOUT_GENERAL for those. On top of that,
we should avoid image transitions when the image is in GENERAL
layout anyway in order to save some time on the GPU.
2018-04-29 15:28:50 +02:00
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