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

411 Commits

Author SHA1 Message Date
Philip Rebohle
5ceb041a49 [d3d11] Optimized texture image layouts 2018-01-01 19:03:05 +01:00
Philip Rebohle
4fc2ea25b8 [dxbc] Implemented typed UAV load/store 2018-01-01 17:14:06 +01:00
Philip Rebohle
fd2bb610eb [d3d11] Implemented indirect draws and dispatch 2017-12-31 01:31:08 +01:00
Philip Rebohle
91a5eb963b [d3d11] Minor formatting + doc improvements 2017-12-31 00:25:19 +01:00
Philip Rebohle
4412f2f5ff [dxgi] Reimplemented parts of DxgiSwapchain with win32 APIs
This solves issues in applications that create more than one
swap chain for a given window, and helps applications that
don't like SDL interference in general. Fullscreen support
is currently missing entirely.
2017-12-31 00:23:34 +01:00
Philip Rebohle
588ceba1d1 [d3d11] Ignoring unknown semantics in input layouts 2017-12-30 19:11:20 +01:00
Philip Rebohle
b7ce9660c3 [d3d11] Implemented CopySubresourceRegion for images 2017-12-30 19:10:45 +01:00
Philip Rebohle
5332891748 [dxbc] Implemented switch-case instructions 2017-12-30 17:22:36 +01:00
Philip Rebohle
006e1b25e6 [d3d11] Fixed shader semantic name comparison 2017-12-30 15:30:31 +01:00
Philip Rebohle
e740adfcb7 [dxbc] Implemented f16 pack/unpack instructions 2017-12-30 13:18:31 +01:00
Philip Rebohle
f93745adcf [dxbc] Implemented bfi and bfe instructions 2017-12-30 03:44:19 +01:00
Philip Rebohle
1373fe5fcc [dxbc] Implemented bufinfo instruction 2017-12-30 01:26:37 +01:00
Philip Rebohle
b968aa0472 [dxbc] Implemented continue instructions 2017-12-29 22:54:25 +01:00
Philip Rebohle
660ac25b18 [dxgi] ... 2017-12-29 22:54:10 +01:00
Philip Rebohle
c38f3c69ad [d3d11] Query prep work 2017-12-29 22:20:31 +01:00
Philip Rebohle
298eeedcc4 [dxbc] Implemented round instructions
Also fixed potential numerical stability issues in with min/max
instructions and saturation when an operand is NaN.
2017-12-29 19:26:59 +01:00
Philip Rebohle
2e215e24e5 [d3d11] Hiding message that initial UAV counts are not supported
They are not supported, but some applications pass invalid pointers
to the fuction even if the feature itself is not used.
2017-12-29 19:26:18 +01:00
Philip Rebohle
793ea6d914 [dxvk] Descriptor set updates now use descriptor type info
This fixes an issue where the wrong resource would be used for a
descriptor set update if multiple resources have been bound to a
single resource slot.
2017-12-29 15:06:33 +01:00
Philip Rebohle
78cb021f77 [d3d11] Added support for D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS 2017-12-29 12:51:54 +01:00
Philip Rebohle
6283497bfa [d3d11] Fixed shader resource view creation for structured buffers 2017-12-29 12:11:45 +01:00
Philip Rebohle
5df89fb657 [dxbc] Fixed OpImageRead and OpImageWrite operand types 2017-12-29 12:11:19 +01:00
Philip Rebohle
8691d29185 [dxvk] Initial support for post-compute barriers 2017-12-29 01:09:54 +01:00
Philip Rebohle
a51439fb29 [dxbc] Implemented thread group shared memory and barriers 2017-12-29 00:51:31 +01:00
Philip Rebohle
a3fe40051f [d3d11] Initial support for unordered access views
Currently restricted to buffers on the API side. Typed UAVs
are not yet supported by the shader compiler. This is enough
to run very simple compute shaders.
2017-12-28 19:05:53 +01:00
Philip Rebohle
847bfdd8ae [dxbc] Implemented raw and structured UAV stores 2017-12-28 18:37:02 +01:00
Philip Rebohle
8592bb4b47 [d3d11] Fixed buffer usage flags
Shader resources and UAVs are always created as texel buffer
views rather than storage buffers or uniform buffers.
2017-12-28 16:35:07 +01:00
Philip Rebohle
410d3a86d9 [d3d11] Added support for raw and structured shader resource views 2017-12-28 16:33:42 +01:00
Philip Rebohle
a72727a173 [dxbc] Added support for structured and raw buffers 2017-12-28 16:03:17 +01:00
Philip Rebohle
c3ccc1a5c7 [dxgi] Fixed resource lifetime issue in presenter 2017-12-27 15:55:46 +01:00
Philip Rebohle
e668c65017 [d3d11] Experimental support for typed shader buffer views 2017-12-27 14:32:07 +01:00
Philip Rebohle
7f5fa18d0b [dxbc] Enabled SPV_KHR_shader_draw_parameters for vertex shaders 2017-12-27 14:31:38 +01:00
Philip Rebohle
5ce975eed9 [dxbc] Fixed SV_VERTEXID and SV_INSTANCEID
Apparently, these two system values ignore the base vertex
and base instance from the draw call. This is not documented,
but in line with what the AMD driver does on Windows.
2017-12-27 12:49:25 +01:00
Philip Rebohle
24b9d9d99a [dxbc] Experimental support for ld,resinfo 2017-12-27 01:37:15 +01:00
Philip Rebohle
788f275315 [d3d11] UAV prep work + cleanups 2017-12-27 01:36:45 +01:00
Philip Rebohle
8d5a2b92f9 [d3d11] Cleaned up primitive topology code 2017-12-26 16:25:51 +01:00
Philip Rebohle
0d3a1b25a1 [d3d11] Initial support for image updates + mapping 2017-12-25 20:40:48 +01:00
Philip Rebohle
a368d04fa0 [dxvk] Removed leftover line of code 2017-12-25 16:09:00 +01:00
Philip Rebohle
89138e5b40 [dxvk] Fixed lockup issue in thread destructors 2017-12-25 16:05:11 +01:00
Philip Rebohle
24bceb86c2 [dxvk] Fixed 3D image upload 2017-12-24 15:29:10 +01:00
Philip Rebohle
3762df6cb6 [d3d11] Added proper support for 1D and 3D shader resources 2017-12-24 13:33:22 +01:00
Philip Rebohle
a3f9fa7547 [d3d11] Implemented 1D and 3D texture creation 2017-12-23 17:05:07 +01:00
Philip Rebohle
82b2c40405 [dxvk] Simplified resource binding
The backend no longer differentiates between compute pipeline
resources and graphics pipeline resources.
2017-12-23 15:11:23 +01:00
Philip Rebohle
89290e9eab [dxbc] Minor fixes 2017-12-22 20:15:44 +01:00
Philip Rebohle
f301633516 [dxbc] Compute shader prep work 2017-12-21 17:27:40 +01:00
Philip Rebohle
46717529fa [dxbc] Implemented unsigned comparators and sample_l 2017-12-21 17:14:11 +01:00
Philip Rebohle
289da8065d [d3d11] Implemented border color support 2017-12-21 16:54:20 +01:00
Philip Rebohle
3e4e5191a8 [dxbc] Increased number of clip/cull distances
Clip and cull distances can be defined as multi-component
vectors in D3D11. We still need to figure out how to map
them to the actuall cull distance array.
2017-12-21 16:28:42 +01:00
Philip Rebohle
f947fb5d44 [dxbc] Refactored system value mapping
Restores geometry shader support.
2017-12-21 16:00:36 +01:00
Philip Rebohle
2e4275649e [dxbc] Implemented input mapping + sample controls
Input variables are now copied into a temporary array, which allows
dynamic indexing and which also allows us to use system values that
are mapped to input registers in DXBC. This breaks geometry shaders
for now, however.
2017-12-21 12:37:20 +01:00
Philip Rebohle
109ce0a695 [dxbc] Implemented sample_d and vector shift instructions 2017-12-20 23:50:39 +01:00
Philip Rebohle
6ff709513c [dxbc] Added indexable temps 2017-12-20 22:50:05 +01:00
Philip Rebohle
518b469742 [dxvk] Added command stream classes
While these are not being used as of yet, these classes can be
used to implement command stream multithreading in the future.
They are also useful to implement command lists for deferred
contexts, which are a core feature of D3D11.
2017-12-20 22:17:14 +01:00
Philip Rebohle
41d660f220 [spirv] Added image operand structure for more flexible sample ops 2017-12-20 20:21:44 +01:00
Philip Rebohle
84190369ab [d3d11] Optimized resource binding methods 2017-12-20 17:37:46 +01:00
Philip Rebohle
659ec7b59d [d3d11] Added DXGI format properties 2017-12-20 14:54:24 +01:00
Philip Rebohle
b4e10b7f06 [dxbc] Fixed sampler types for depth-compare operations 2017-12-20 13:41:04 +01:00
Philip Rebohle
2ed2d892d6 [dxvk] Optimized resource binding
Fixes a few bottlenecks that were encountered in the Cascading Shadow
Maps demo from the Microsoft SDK. Performance is now slightly better
than wined3d with CSMT, MESA_NO_ERROR and mesa_glthread enabled.
2017-12-20 12:13:08 +01:00
Philip Rebohle
f68655feff [dxvk] Separated buffer renaming from allocation 2017-12-20 02:58:36 +01:00
Philip Rebohle
70e5314cc6 [dxvk] Optimized resource tracking
Putting all resources that are used by a command list
into a vector instead of a hash set is more efficient.
2017-12-20 02:45:57 +01:00
Philip Rebohle
d2b676b551 [dxvk] Fixed descriptor pool leak 2017-12-20 00:16:59 +01:00
Philip Rebohle
9865474bb4 [dxbc] Initial shadow sampler support 2017-12-20 00:16:49 +01:00
Philip Rebohle
d1720c0c52 [dxbc] Implemented derivatives 2017-12-19 20:26:05 +01:00
Philip Rebohle
342e99a11c [dxvk] Optimized descriptor updates 2017-12-19 19:36:44 +01:00
Philip Rebohle
5415b685de [dxbc] Implemented type conversion instructions 2017-12-19 18:12:18 +01:00
Philip Rebohle
95bc4b5826 [dxbc] Added immediate constant buffer support 2017-12-19 17:41:23 +01:00
Philip Rebohle
2c5b1c151f [d3d11] Refactored texture creation 2017-12-19 16:01:50 +01:00
Philip Rebohle
f2587ab1b6 [dxgi] Implemented separate color/depth format tables
This is required because in D3D11, typeless formats can be used
to create both depth and stencil images, and color formats can
be used to view depth images. In Vulkan, images and views that
are used as depth-stencil attachments will have to be created
with a depth-stencil format, so we have to take the image's
bind flags into account when picking a format.
2017-12-19 14:47:35 +01:00
Philip Rebohle
64a74735f8 [dxbc] oDepth no longer treated as standard output register
Fixes a crash in the shader compiler when starting up Tomb Raider.
2017-12-19 12:58:40 +01:00
Philip Rebohle
f97ea7fcea [d3d11] Implemented CheckFormatSupport and CheckFeatureSupport 2017-12-19 11:05:41 +01:00
Philip Rebohle
da2cc5a6a0 [dxvk] Fixed resource binding with invalidated buffers
When invalidating a constant buffer, the descriptor was not
updated, which usually led to the wrong resource being used
and could also cause crashes.

This fix also includes resource tracking for shader resources
on the graphics pipeline. The code needs to be made compatible
with the compute pipeline as well.
2017-12-19 01:08:48 +01:00
Philip Rebohle
6df9fc75d2 [dxbc] Implemented some new bit-wise logical instructions 2017-12-19 00:45:31 +01:00
Philip Rebohle
2b6cb25675 [d3d11] Implemented D3D11_APPEND_ALIGNED_ELEMENT 2017-12-18 23:24:10 +01:00
Philip Rebohle
13d4a3d87d [dxbc] Fixed bug with constant vector operands 2017-12-18 18:02:15 +01:00
Philip Rebohle
6cc3ff4ad8 [dxbc] Basic geometry shader (sm4) support 2017-12-18 16:41:05 +01:00
Philip Rebohle
c44b50ae4d [dxvk] Fixed bug where resource bindings would not be updated after rebinding the pipeline 2017-12-18 16:16:21 +01:00
Philip Rebohle
4d01517dd8 [d3d11] Geometry shader prep work 2017-12-18 12:53:53 +01:00
Philip Rebohle
38b989ec91 [dxvk] vkCmdUpdateBuffer can only be used if both offset and size are aligned to four bytes 2017-12-18 12:44:18 +01:00
Philip Rebohle
1e08c0744f [dxbc] Implemented basic control flow instuctions 2017-12-18 11:53:28 +01:00
Philip Rebohle
858913ec0c [dxbc] Shader decoder and compiler overhaul (2/2)
Removed the old decoder and the old shader compiler
and added documentation to the new structures.
2017-12-18 00:46:44 +01:00
Philip Rebohle
47347e38da [dxbc] Shader decoder and compiler overhaul (1/2)
Major rewrite of the entire shader decoder to generate easy
to parse data structures for the compiler, which ultimately
allows new instructions to be implemented more easily.
2017-12-18 00:28:54 +01:00
Philip Rebohle
2f99be9546 [dxbc] Implemented conditional move and comparison instructions 2017-12-17 01:36:41 +01:00
Philip Rebohle
ebabc0e578 [dxvk] Implemented proper swap chain synchronization 2017-12-16 21:30:48 +01:00
Philip Rebohle
1fe5b74762 Optimized command submission
Command submission now does not synchronize with the device every single
time. Instead, the command list and the fence that was created for it are
added to a queue. A separate thread will then wait for the execution to
complete and return the command list to the device.
2017-12-16 18:10:55 +01:00
Philip Rebohle
d5a49698b4 [dxvk] Implemented new memory allocator with sub-allocation 2017-12-16 16:48:42 +01:00
Philip Rebohle
85120d2d01 [d3d11] Reverted some design decisions related to buffer renaming 2017-12-16 13:35:11 +01:00
Philip Rebohle
d3b2174180 [dxvk] Implemented buffer renaming 2017-12-16 13:21:11 +01:00
Philip Rebohle
d9f38a7f42 [d3d11] Minor restructuring 2017-12-15 19:11:10 +01:00
Philip Rebohle
c0a963ae5b [dxvk] Renamed DxvkBufferSlice methods for convenience 2017-12-14 19:11:13 +01:00
Philip Rebohle
4502816bb6 [dxvk] Renamed DxvkBufferSlice methods for convenience 2017-12-14 19:09:53 +01:00
Philip Rebohle
9827ace3b0 [d3d11] Fixed buffer bindings with non-zero offsets 2017-12-14 19:07:08 +01:00
Philip Rebohle
6de6421dfd [d3d11] Refactoring resource creation (1/2) - buffers 2017-12-14 15:59:55 +01:00
Philip Rebohle
40241e0b22 [dxvk] DxvkBufferBinding -> DxvkBufferSlice 2017-12-14 15:24:43 +01:00
Philip Rebohle
2ad5f49f3e [dxbc] Shader compiler rewrite (2/2) 2017-12-14 12:53:53 +01:00
Philip Rebohle
bdce9a69fb [d3d11] Map() optimization removed, needs buffer renaming
The naive optimization to use staging buffers rather than actual mapping
turned out to be no more efficient than the previous approach. In order
to achieve good performance, buffer renaming must be implemented instead.
2017-12-14 12:29:41 +01:00
Philip Rebohle
4172b99952 [d3d11] Implemented naive Map() optimization when used with D3D11_MAP_WRITE_DISCARD 2017-12-13 17:49:08 +01:00
Philip Rebohle
a4eb807215 [dxbc] Implemented SinCos, Min and Max instructions 2017-12-13 16:35:01 +01:00
Philip Rebohle
464a3e7d4e [dxbc] Shader compiler rewrite (1/2)
Rewrote most parts of the shader compiler and removed the old one. The next
step is to improve documentation and remove the remaining traces of the old
shader compiler.
2017-12-13 15:32:54 +01:00
Philip Rebohle
a0db9198e3 [d3d11] Removed unnecessary Flush() 2017-12-12 15:39:31 +01:00
Philip Rebohle
3d4304096b [dxvk] Data buffer can now be created uninitialized 2017-12-12 15:39:20 +01:00
Philip Rebohle
0f26d1c627 [dxbc] Removed <optional> dependency 2017-12-12 13:00:37 +01:00
Philip Rebohle
2a266eaad4 [general] Added 32-bit support 2017-12-12 12:50:52 +01:00
Philip Rebohle
23abc82aa0 [dxvk] Added performance counter class 2017-12-12 10:29:17 +01:00
Philip Rebohle
180667ba65 [d3d11] Fixed depth function 2017-12-12 01:07:27 +01:00
Philip Rebohle
24feb7822d [d3d11] Added class linkage stub, required for FX11 samples 2017-12-12 01:07:07 +01:00
Philip Rebohle
3de427439b [dxvk] Added proper documentation for staging buffers 2017-12-12 00:41:56 +01:00
Philip Rebohle
5f0e94138e [dxvk] Implemented support for multisampled images and render targets 2017-12-12 00:27:49 +01:00
Philip Rebohle
de47fa29e1 [dxvk] Refactored Vulkan device and instance destruction, now more RAII friendly 2017-12-11 19:48:00 +01:00
Philip Rebohle
5f8976fbd4 [d3d11] Fixed triangle strips 2017-12-11 19:38:13 +01:00
Philip Rebohle
68ca71d8a4 [dxvk] Implemented recycling of command buffers and staging buffers 2017-12-11 19:17:08 +01:00
Philip Rebohle
037e9a643d [d3d11] Fixed yet another ref counting bug 2017-12-11 17:01:38 +01:00
Philip Rebohle
c3a29e9de0 [d3d11] Return success value when mapping succeeds instead of an error 2017-12-11 16:29:40 +01:00
Philip Rebohle
22c3cd80a1 [dxbc] Implemented mad instruction 2017-12-11 14:36:35 +01:00
Philip Rebohle
c246e03594 [d3d11] Imlpemented some state queries 2017-12-11 14:21:24 +01:00
Philip Rebohle
50b7293b8f [d3d11] Implemented blend state and depth-stencil state binding 2017-12-11 14:11:18 +01:00
Philip Rebohle
352b46fe80 [d3d11] Refactored state object binding 2017-12-11 13:07:27 +01:00
Philip Rebohle
4144e3229a [d3d11] Implemented blend state creation 2017-12-11 13:03:07 +01:00
Philip Rebohle
9b9840754d [d3d11] Added depth-stencil state objects 2017-12-11 01:43:15 +01:00
Philip Rebohle
2d918df0f0 [d3d11] d3d11_state_rs -> d3d11_rasterizer 2017-12-10 23:27:20 +01:00
Philip Rebohle
93f79742e9 [dxbc] Scalar values can be expanded to multiple vector components during a store operation 2017-12-10 22:35:55 +01:00
Philip Rebohle
d941446ca0 [dxbc] Fixed bug in decoder that would return wrong component masks 2017-12-10 21:13:22 +01:00
Philip Rebohle
5739e2f60f [dxvk] Added component mapping to image view info 2017-12-10 20:06:07 +01:00
Philip Rebohle
9acc9bf3e0 [dxbc] Implemented Rsq instruction 2017-12-10 20:01:38 +01:00
Philip Rebohle
4a3b04f605 [dxgi] Mapping DXGI's RGBX formats fo Vulkan RGBA formats, needs testing 2017-12-10 19:47:38 +01:00
Philip Rebohle
b4f85a2c2f [d3d11] Fixed mip-mapped texture creation 2017-12-10 19:10:17 +01:00
Philip Rebohle
c0f5b46f81 [dxvk] Added proper support for block-compressed image formats 2017-12-10 18:14:28 +01:00
Philip Rebohle
cd4f21a0c3 [d3d11] Implemented buffer mapping 2017-12-10 17:36:32 +01:00
Philip Rebohle
52f1c4fa00 [dxvk] Implemented staging buffers for large data transfers 2017-12-10 15:57:51 +01:00
Philip Rebohle
89ec199c34 [d3d11] Re-implemented shader read 2017-12-10 12:21:33 +01:00
Philip Rebohle
b4493d90d8 [dxbc] Initial support for sample instruction 2017-12-10 12:08:20 +01:00
Philip Rebohle
7c03495d74 [dxbc] Implemented shader resource declaration for images 2017-12-10 10:34:18 +01:00
Philip Rebohle
939faeaf27 [dxbc] Implemented sampler declaration 2017-12-10 03:39:35 +01:00
Philip Rebohle
9c997120e1 [d3d11] Implemented shader resource binding 2017-12-10 01:56:07 +01:00
Philip Rebohle
9a86178604 [d3d11] Fixed severe reference-counting issue in state objects 2017-12-10 00:55:30 +01:00
Philip Rebohle
3d6e88428a [com] ... yeah, almost. 2017-12-09 23:20:31 +01:00
Philip Rebohle
fa1ef8248e [com] Fixed crashes caused by reentrant Release() 2017-12-09 22:20:40 +01:00
Philip Rebohle
2b86a2f1f3 [d3d11] Changed the way default pipeline state is restored 2017-12-09 21:39:56 +01:00
Philip Rebohle
1160810687 [d3d11] Implemented sampler binding 2017-12-09 21:17:26 +01:00
Philip Rebohle
e335c817bc [d3d11] Implemented sampler creation 2017-12-09 20:49:56 +01:00
Philip Rebohle
50e8b35291 [d3d11] Minor fixes to D3D11Device::CheckMultisampleQualityLevels 2017-12-09 19:44:06 +01:00
Philip Rebohle
8e3c14d8ab [d3d11] Cleaned up view creation a bit 2017-12-09 19:36:38 +01:00
Philip Rebohle
1e6c11e3f2 [d3d11] Implemented shader resource view creation for 2D textures 2017-12-09 19:06:51 +01:00
Philip Rebohle
f484454854 [d3d11] Device children actually do hold a reference to the device 2017-12-09 15:57:05 +01:00
Philip Rebohle
12d4e68b24 [d3d11] Implemented multisample format support check 2017-12-09 14:46:23 +01:00
Philip Rebohle
c92d68417e [dxgi] Bumped DxgiDevice to IDXGIDevice1 2017-12-09 14:45:52 +01:00
Philip Rebohle
4a0ff5343a [dxgi] Added more format mappings 2017-12-09 14:41:37 +01:00
Philip Rebohle
d539c3e384 [d3d11] Allow the creation of fake D3D11 WARP and REF devices 2017-12-09 13:43:14 +01:00
Philip Rebohle
b3c391d071 [d3d11] Implemented depth-stencil binding and clear methods 2017-12-09 03:53:42 +01:00
Philip Rebohle
a43bb134e0 [dxvk] Initial support for format info 2017-12-09 02:44:59 +01:00
Philip Rebohle
36e6ba4ebc [d3d11] Replaced resource view classes by a generic template 2017-12-09 02:09:13 +01:00
Philip Rebohle
bfb05f24b8 [dxbc] Implemented support for MUL instruction 2017-12-09 01:49:30 +01:00