Commit Graph

58 Commits

Author SHA1 Message Date
Joshua Ashton a69c65265a [d3d11] Store context predication query as private ref 2022-09-16 12:49:10 +02:00
Joshua Ashton 9e4877be81 [d3d11] Store SoTarget buffer as a private ref 2022-09-16 12:49:10 +02:00
Joshua Ashton b40935a48d [d3d11] Store context state ID buffers as private refs 2022-09-16 12:49:10 +02:00
Joshua Ashton ca38cebe0b [d3d11] Store private refs for IA layout 2022-09-16 12:49:10 +02:00
Joshua Ashton 9545281542 [d3d11] Store private refs for VB + IB bindings 2022-09-16 12:49:10 +02:00
Joshua Ashton 9bfe46ac50 [d3d11] Store private refs for srv and rtv bindings 2022-09-16 12:49:10 +02:00
Joshua Ashton 2419226456 [d3d11] Store private refs for constant buffer bindings 2022-09-16 12:49:10 +02:00
Joshua Ashton 8758bcedae [d3d11] Store private refs to context shaders 2022-09-16 12:49:10 +02:00
Philip Rebohle 7e237b33b7
[d3d11] Track highest bound unordered access view 2022-08-05 14:13:25 +02:00
Philip Rebohle 934caa3fd7
[d3d11] Track highest bound vertex buffer 2022-08-05 14:13:25 +02:00
Philip Rebohle 3dbd9d8659
[d3d11] Track highest bound sampler 2022-08-05 14:13:25 +02:00
Philip Rebohle 6c372e40f6
[d3d11] Track highest bound shader resource 2022-08-05 14:13:24 +02:00
Philip Rebohle 5dd2b20940
[d3d11] Track highest bound constant buffer 2022-08-05 14:13:24 +02:00
Philip Rebohle 18c4ca8e92
[d3d11] Introduce D3D11MaxUsedBindings
And use it in ResetCommandListState, in order to avoid redundant state changes.
2022-08-05 14:13:24 +02:00
Philip Rebohle 9f07bc6532
[d3d11] Refactor shader state 2022-08-05 14:13:24 +02:00
Philip Rebohle 95ab1465ab
[d3d11] Add reset method to more context state 2022-08-05 14:13:24 +02:00
Philip Rebohle 4e1f6e5efd
[d3d11] Refactor unordered access view and output merger state 2022-08-05 14:13:24 +02:00
Philip Rebohle 8383423fbe
[d3d11] Refactor sampler state 2022-08-05 14:13:24 +02:00
Philip Rebohle 1b4cb66dc3
[d3d11] Refactor shader resource state 2022-08-05 14:13:24 +02:00
Philip Rebohle 33e169e85f
[d3d11] Refactor constant buffer state 2022-08-05 14:13:24 +02:00
Philip Rebohle a637134c56
[d3d11,dxbc] Use push constant instead of spec constant for rasterizer sample count 2022-07-03 13:41:06 +02:00
Philip Rebohle 049fda9218
[d3d11] Revert index buffer optimization
This causes some problems when the app uses a combination of index
buffer offset and StartIndexLocation that overflows 32-bit integers.

In my testing, there haven't been many games benefitting from this
optimization anyway, so just reverting it should not have tangible
effects on performance.
2021-03-04 15:47:39 +01:00
Philip Rebohle b8bc36559d
[d3d11] Optimize index buffer binding with offset
Do not rebind the buffer if only the offset changes. Instead,
adjust StartIndexLocation in indexed draw calls. For indirect
draws, this will be disabled on the fly.

This may save a whole bunch of work in the backend, and reduces
the number of commands being sent to the CS thread in the first
place, which is why this optimization is not being done in the
backend itself but rather on the client API side.
2021-01-24 15:18:38 +01:00
Philip Rebohle 66814ea8db
Revert "[d3d11] Move D3D11Shader implementation to its own file"
Useless since it doesn't fix the clang problem.
2020-07-18 00:10:31 +02:00
Philip Rebohle 56fe52ca3c
[d3d11] Move D3D11Shader implementation to its own file
And resolve some include madness. Necessary because D3D11Shader::GetDevice
needs to know the full definition of D3D11Device, but D3D11Device needs
to know the full definition of the other shader-related classes.
2020-07-17 10:16:37 +02:00
Philip Rebohle bf480ce659
[d3d11] Initialize all D3D11ContextState members
Otherwise, SwapDeviceContextState may swap in some uninitialized data.
Closes #1512.

Reported-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
2020-03-16 18:42:57 +01:00
Philip Rebohle 68c257fc0d
[d3d11] Fix ref counting for state objects bound to a context
Using raw pointers is safe here since the objects never get destroyed
during the lifetime of the context.
2019-10-14 02:06:33 +02:00
Philip Rebohle 137589d755
[d3d11] Add state to track potentially hazardous bound SRVs 2019-08-26 23:29:01 +02:00
Philip Rebohle 4064dd3737
[d3d11] Add bound compute shader UAV mask
Will be used for efficient hazard tracking.
2019-08-26 23:29:01 +02:00
Philip Rebohle a704e6d27e
[d3d11] Fix UAV binding in OMSetRenderTargets{,AndUnorderedAccessViews}
Unlike for compute shaders, we're supposed to replace all UAV bindings
when binding render targets. We also should spill the render pass when
disabling UAV rendering to avoid read-after-write hazards.

Fixes a potential synchronization bug encountered in Devil May Cry 5.
2019-06-27 15:54:42 +02:00
Philip Rebohle 8784ed673b
[d3d11] Use private references for render targets
Matches Windows behaviour and fixes a crash in Yakuza Kiwami 2,
which calls Release() on RTVs and DSVs until the public reference
count reaches zero. Close #1053.
2019-05-14 15:22:24 +02:00
Philip Rebohle 492b7db07b
[d3d11] Support count buffer in Set|BindDrawBuffers 2019-05-06 00:08:58 +02:00
Philip Rebohle 8f580efa25
[d3d11] Correctly handle out-of-bounds constant buffer ranges
Otherwise we pass an invalid offset and length to the backend,
which leads to invalid descriptor set updates in Vulkan.
The D3D11 runtime does not report corrected constant offset
and count parameters to the applicaion in *GetConstantBuffers1.

Reported-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
2019-03-28 13:45:41 +01:00
Philip Rebohle 43ed820be9 [d3d11] Remove state tracking for UAV rendering
This scenario is now properly handled by the DXVK state tracker.
2018-10-29 12:12:34 +01:00
Philip Rebohle 93753a5ce7
[d3d11] Bind transform feedback buffers in SOSetTargets 2018-10-10 19:55:41 +02:00
Philip Rebohle 781ee00f5c
[dxvk] Refactor indirect draw/dispatch commands
Introduces an OpenGL-style bind point for the argument buffer, which
means we can avoid a lot of unnecessary reference tracking in games
that do a lot of indirect draw calls.

Reduces CPU overhead in Assassin's Creed Odyssey.
2018-10-08 10:23:18 +02:00
Philip Rebohle 7fa26f1c87
[d3d11] Implement render pass spilling for UAV rendering
Spilling the render pass should make shader storage buffer/image writes
visible due to how external subpass dependencies are defined. For UAV
rendering, we need to do this when changing the UAVs, even if the render
targets themselves do not change.
2018-06-15 20:49:24 +02:00
Philip Rebohle 3133e4ba35
[d3d11] Add constant buffer offsets and counts to context state 2018-03-18 12:36:45 +01:00
Philip Rebohle 3b42011c50
[d3d11] Implemented OMGetRenderTargetsAndUnorderedAccessViews and predication stub 2018-03-09 16:47:20 +01:00
Philip Rebohle 95e2c641e0
[d3d11] Partially implement SOSetTargets/SOGetTargets
This does not implement any stream output functionality yet,
but it allows games to set and query stream output buffers.
2018-03-07 15:32:19 +01:00
Philip Rebohle 83458c4467
[dxvk] Separated resource view classes
Since we are doing this for UAVs already, we should be
doing this for all view classes in order to account for
the minor differences between all of them.
2018-02-05 22:35:23 +01:00
Philip Rebohle 672675ba78 [d3d11] Implemented OMSetRenderTargetsAndUnorderedAccessViews
Note that this does *not* properly implement UAV rendering in
the backend yet. For that, we need to add memory barriers.
2018-01-12 15:38:07 +01:00
Philip Rebohle c1d6c20066 [d3d11] Implemented D3D11 parts of append/consume buffers 2018-01-11 12:23:55 +01:00
Philip Rebohle 788f275315 [d3d11] UAV prep work + cleanups 2017-12-27 01:36:45 +01:00
Philip Rebohle 50b7293b8f [d3d11] Implemented blend state and depth-stencil state binding 2017-12-11 14:11:18 +01:00
Philip Rebohle 9c997120e1 [d3d11] Implemented shader resource binding 2017-12-10 01:56:07 +01:00
Philip Rebohle 1160810687 [d3d11] Implemented sampler binding 2017-12-09 21:17:26 +01:00
Philip Rebohle b3c391d071 [d3d11] Implemented depth-stencil binding and clear methods 2017-12-09 03:53:42 +01:00
Philip Rebohle c90bc3e946 [dxbc] Implemented proper resource slot mapping 2017-12-08 22:30:41 +01:00
Philip Rebohle 0610296248 [d3d11] Implemented constant buffer binding 2017-12-08 19:39:33 +01:00