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
3ab75c8538 [dxvk] Fixed potential bugs in vertex buffer binding code 2018-01-10 21:53:13 +01:00
Philip Rebohle
ed642a57a7 [dxvk] Simplified state-based pipeline lookup 2018-01-10 21:28:20 +01:00
Philip Rebohle
9c90c1ac00 [dxvk] Optimized pipeline state updates 2018-01-10 20:40:10 +01:00
Philip Rebohle
1b67ffaed2 [d3d11] Added default sampler state 2018-01-10 19:07:55 +01:00
Philip Rebohle
74722fa693 [dxvk] Implementing unbound resource handling (4/4)
The shader compiler now queries whether a constant buffer or texture is
bound before trying to access it for reading. This is not yet implemented
for image fetch operations, atomic operations, or buffer load/store ops.
2018-01-10 18:58:17 +01:00
Philip Rebohle
fe02c5d6b9 [dxvk] Implementing unbound resource handling (3/4)
The shader compiler will now generate specialization constants
for shader resources, uniform access views, and constant buffers.
2018-01-10 13:44:04 +01:00
Philip Rebohle
39b5d84d6a [dxgi] Added missing view type definition 2018-01-10 13:43:23 +01:00
Philip Rebohle
b22d56ac06 [dxvk] Implementing unbound resource handling (2/4)
Refactored pipeline binding and descriptor set updates so that
no descriptor info gets written for unbound resources.
2018-01-10 12:13:46 +01:00
Philip Rebohle
c64103c73f [dxvk] Implementing unbound resource handling (1/4)
In order to emulate D3D11 behaviour when a resource is not bound,
we use specialization constants. This requires further changes in
the shader compiler.
2018-01-10 11:44:40 +01:00
Philip Rebohle
38ee8f4f95 [dxvk] Unbound resource prep work 2018-01-10 10:23:51 +01:00
Philip Rebohle
ee796b966d [dxvk] Reduced staging buffer size
Allocating as much memory as we did was wasteful. The new limit may
still be too generous for most applications, but this will require
more testing.
2018-01-10 10:22:33 +01:00
Philip Rebohle
ab2c7de523 [d3d11] Use CUBE instead of CUBE_ARRAY for non-array cubes
Since the change has been reverted in the DXBC compiler, it also needs
to be changed back during view creation.
2018-01-10 10:18:26 +01:00
Philip Rebohle
bde8ba9400 [dxbc] Simplified f16tof32 implementation 2018-01-10 09:16:42 +01:00
Philip Rebohle
da867d4bca [dxvk] Replaced DxvkResourceType by VkImageViewType 2018-01-09 20:35:29 +01:00
Philip Rebohle
3419d55dee [dxvk] Tweaked descriptor allocation 2018-01-09 20:04:50 +01:00
Philip Rebohle
e2d9693ac3 [dxvk] Fixed compressed texture upload
Fixes issues with particles being overly bright in Nier:Automata.
2018-01-09 19:08:23 +01:00
Philip Rebohle
c7d0729e06 [dxbc] Fixed bit field instructions 2018-01-09 15:39:41 +01:00
Philip Rebohle
180cc35c84 [d3d11] Use VK_IMAGE_VIEW_TYPE_CUBE_ARRAY for non-array cube maps
Games may bind simple cube map views to a resource slot that requires
a cube map array view. Fixes GPU lockups in Nier: Automata.
2018-01-09 00:51:10 +01:00
Philip Rebohle
7fd1f57902 [dxbc] Fixed invalid types and IDs in generated SPIR-V 2018-01-08 22:26:45 +01:00
Philip Rebohle
c7e33e636e [dxvk] Fixed vertex buffer binding issue
If an application binds vertex buffers before changing the input layout,
it might happen that the vertex buffers are not bound correctly to the
Vulkan command buffer. This issue is now resolved.
2018-01-08 20:23:21 +01:00
Philip Rebohle
cb748c786a [dxvk] Added missing image barrier after compute shader execution 2018-01-08 19:07:57 +01:00
Philip Rebohle
3925675b89 [d3d11] Optimized command submission
The context will now be flushed after a render pass that consisted of
several hundreds of draw calls. This way the GPU should be kept busy.
2018-01-08 17:45:21 +01:00
Philip Rebohle
9024f8bb2c [dxvk] Inlined all frequently called DxvkCmdList methods 2018-01-08 14:21:50 +01:00
Philip Rebohle
7912f6c604 [dxbc] Track dimension of resource slots
This shall help binding dummy resources in case an application
binds none or an incompatible resource to a slot.
2018-01-08 13:39:37 +01:00
Philip Rebohle
ad10ab07f8 Revert "[d3d11] Added dummy resoruce binding for buffers"
This approach will not work if the d3d11 context binds an
incompatible resouce in case the pipeline itself changes.
2018-01-08 13:01:31 +01:00
Philip Rebohle
24ad9e730c [d3d11] Added dummy resoruce binding for buffers
Fixes crashes when a D3D11 application uses unbound resources
in shaders. Allows Nier:Automata to play back cutscenes.
2018-01-08 10:17:52 +01:00
Philip Rebohle
5cfbb74455 [dxvk] Added new convenient buffer slice constructor 2018-01-07 21:46:26 +01:00
Philip Rebohle
7cc65be16b [dxbc] Fixed redundant bitcasts 2018-01-07 21:04:23 +01:00
Philip Rebohle
f4cd90d6fa [dxbc] Implemented vendor-specific workarounds in an attemt to fix Nvidia 2018-01-07 20:05:27 +01:00
Philip Rebohle
4e06f498dd [d3d11] Fixed several mip level-related bugs
- When a D3D11 texture was created with a mip level count of zero,
  DXVK would compute the correct number of mip levels, but not write
  them back to the description field.
- Framebuffers would always use the size of the top level, not the
  mip levels that were actually attached to the framebuffer.
- Several image copy operations did not handle mip levels other
  than the top mip level correctly.
2018-01-06 02:09:07 +01:00
Philip Rebohle
f7e1efbaaf [dxbc] Fixed AtomicUmax emitting the wrong instruction 2018-01-05 19:48:45 +01:00
Philip Rebohle
356591cc99 [d3d11] Fixed viewport offset 2018-01-05 16:53:12 +01:00
Philip Rebohle
1dfd62a118 [dxbc] Added debug name to x# registers 2018-01-05 16:46:17 +01:00
Philip Rebohle
e7bf76f5ef [d3d11] Re-implemented image mapping
Image mapping now returns the map pointer of a separate
buffer, rather than the the image itself. This fixes
issues with applications that ignore the RowPitch
and/or DepthPitch fields of the MappedSubresource struct.
2018-01-05 03:01:19 +01:00
Philip Rebohle
93a5cf093c [d3d11] Refactored texture interfaces
All texture classes now use the common info structure
internally as well so that it can be queried efficiently.
2018-01-05 01:15:56 +01:00
Philip Rebohle
c816078f13 [dxbc] Disabled clip and cull planes for now
We would have to write these values, but the feature
is currently not supported in the D3D11 implementation.
2018-01-03 12:46:04 +01:00
Philip Rebohle
6dfe09da7b [dxbc,d3d11] Minor fixes 2018-01-03 12:26:27 +01:00
Philip Rebohle
75152ae16f [dxvk] Made VK_KHR_maintenance2 optional
Unlike VK_KHR_maintenance1, not all D3D11 applications rely on
features provided by this extension. Keeping this optional helps
with RenderDoc, which does not expose the extension.
2018-01-03 02:38:55 +01:00
Philip Rebohle
da751a46f7 [dxbc] Removed in-shader bounds checking
It looks like this is not needed at the moment, and it needs more work.
2018-01-03 02:37:44 +01:00
Philip Rebohle
755e6d36e3 [d3d11] Pre-clear images that would have undefined contents
Fixes significant visual bugs in Nier: Automata that were caused
by partially initialized images.
2018-01-02 21:32:39 +01:00
Philip Rebohle
98bcfec0f3 [dxbc] More debug info for constant buffers 2018-01-02 20:20:52 +01:00
Philip Rebohle
bfac9eb737 [dxbc] Added bound checking for some texel fetch operations 2018-01-02 16:57:37 +01:00
Philip Rebohle
043330132f [dxbc] Added experimental support for atomic operations 2018-01-02 12:07:49 +01:00
Philip Rebohle
55bc01d523 [d3d11] Minor bug fixes 2018-01-02 12:07:30 +01:00
Philip Rebohle
d4db877cdc [dxvk] Fixed staging buffer alignment
Four-byte alignment is required in order to avoid illegal
vkCmdCopyBufferToImage calls. We align staging buffer slices to
a full cache line in order to improve performance.
2018-01-01 23:32:08 +01:00
Philip Rebohle
8c0e797f37 [dxbc] Vertex inputs now respect attribute type
Fixes issues with integer attributes which were encountered in Nier: Automata.
2018-01-01 23:31:01 +01:00
Philip Rebohle
21582b955a [dxvk] Require VK_KHR_maintenance2
This extension helps with some compatibility issues that are
somewhat inevitable during the D3D11->Vulkan translation.
2018-01-01 23:27:51 +01:00
Philip Rebohle
d8574666cb [dxgi] Presenter now sets depth/stencil state properly 2018-01-01 23:00:07 +01:00
Philip Rebohle
4dc2c9e92c [d3d11] Implemented GetData stub for queries 2018-01-01 20:59:54 +01:00
Philip Rebohle
0866e1b4f2 [d3d11] Implemented Image UAV creation 2018-01-01 19:46:19 +01:00
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