Commit Graph

284 Commits

Author SHA1 Message Date
Philip Rebohle 5d5be87402 [dxvk] Oprimize render target clear operations
We can save one image layout transition when clearing a render
target by delaying clears until vkCmdBeginRenderPass is called.
2018-04-30 17:04:13 +02:00
Philip Rebohle 1bbfe77013 [dxvk] Refactor DxvkFramebuffer and DxvkRenderpass 2018-04-30 15:47:29 +02:00
Philip Rebohle 1784b8c44d [d3d11] Merge interop API 2018-04-26 22:20:09 +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 d91114d733 [dxvk] Rename renderPassBegin/End methods to start/spillRenderPass 2018-04-23 11:11:40 +02:00
Philip Rebohle 62b0e34a73
[d3d11] Implement IDXGIVkInteropDevice for D3D11Device 2018-04-20 00:19:03 +02:00
Philip Rebohle d523405a5a
[dxvk] Implement bindRenderTargets method
An alternative to manually creating a framebuffer object and binding
it via bindFramebuffer. Future optmizations can use this to bring
down the number of redundant render pass changes.
2018-04-15 01:09:53 +02:00
Philip Rebohle 9d84e1bfaa
[dxvk] Implement clearBufferView and clearImageView 2018-04-11 23:13:34 +02:00
Philip Rebohle 676b0cb476
[dxvk] Added DxvkMetaClearObjects stub 2018-04-11 17:05:12 +02:00
Philip Rebohle 6e27f12e22
[dxvk] Move DxvkPipelineManager object to DxvkContext
Since we create only one DxvkContext per D3D11Device, rather than
per D3D11DeviceContext as originally planned, there is no need to
keep the pipeline manager as a global thread-safe object. This may
slightly reduce CPU overhead.
2018-03-29 12:32:20 +02:00
Philip Rebohle 94aa650f3e
[dxvk] Enable the use of VK_KHR_descriptor_update_template
Reduces the CPU overhead of descriptor set updates, which usually
happen once per draw call. Gains seem to be minor in most games,
some outliers show significantly better performance (i.e. Tomb Raider).
2018-03-17 23:50:03 +01:00
Philip Rebohle 52a9a4f406
[dxvk] Reimplemented clearRenderTarget
Closer to the D3D11 API. We cannot use the normal clearColorImage and
clearDepthStencilImage methods in case the game uses a 2D array view
for a 3D image. Fixes some validation issues in Hellblade.
2018-03-17 17:59:43 +01:00
Philip Rebohle 5ef0f31c66
[dxvk/d3d11] Refactored resource binding
Slightly reduces overhead of D3D11 *SetShaderResources methods.
2018-03-10 11:16:52 +01:00
Philip Rebohle e8c98eac95
[dxvk] Implement proper graphics and compute state validation
Fixes crashes in various games, including Fallout 4.
2018-02-24 23:56:12 +01:00
Philip Rebohle b419b3dfbd
[dxvk] Implemented typeless resolve
This should allow a large number of Unity-based games to
render at least a menu.
2018-02-21 01:04:28 +01:00
Philip Rebohle cb3daaf856
[dxvk] Change resolveImage interface to accept an explicit format 2018-02-20 22:26:23 +01:00
Philip Rebohle 43dbc9f1d6
[dxvk] Support depth-to-color image copies and vice versa
Fixes validation errors and depth of field effect in Neptunia VII
and potentially other games which do not use all depth images for
rendering.
2018-02-20 13:08:50 +01:00
Philip Rebohle 5fea615ed7 [dxvk] Implement backend part for event queries 2018-02-18 22:57:45 +01:00
Philip Rebohle 7ddd2500d1 [dxvk] Added query tracker 2018-02-18 20:11:05 +01:00
Philip Rebohle 43200010c1 [dxvk] Implemented query allocation 2018-02-18 17:14:02 +01:00
Philip Rebohle dd237d866d
[dxvk] Make query pools more usable as query allocators 2018-02-15 13:25:18 +01:00
Philip Rebohle 0c2058e8c4
[dxvk] Introduced DxvkComputePipelineStateInfo
Will be used to re-compile compute pipelines against the current
state, just like graphics pipelines. May fix GPU lockups etc.
2018-02-14 17:54:35 +01:00
Philip Rebohle 7bbb6ea93b
[dxvk] More query stuff 2018-02-14 03:16:39 +01:00
Philip Rebohle 54cfdbdc51
[dxvk] Implemented more query and query pool methods 2018-02-13 13:43:27 +01:00
Philip Rebohle 5beae25bdf
[dxvk] Implemented virtual query class and query pool stub 2018-02-12 16:36:42 +01:00
Philip Rebohle 6f1ed72b78
[dxvk] Reduced resource binding overhead a bit 2018-02-04 23:59:34 +01:00
Philip Rebohle 14d5054893
[dxvk] Initial work on instance data fetch rates
Adds a pipeline flag to indicate that instanced
draw calls need to be emulated.
2018-02-01 20:15:25 +01:00
Philip Rebohle c66492a90f
[dxvk] Initialize dummy resources to zero
Read access to unbound images and buffers usually yields
a result vector that contains zeroes in all components.
2018-02-01 14:26:38 +01:00
Philip Rebohle 9fbddf57df
[dxvk] Emit dynamic state after binding a graphics pipeline
Fixes issues with stencil references becoming undefined under
certain circumstances. This issue was encountered in Heroes
of the Storm.
2018-01-29 20:01:49 +01:00
Philip Rebohle d3fe3622cc
[dxvk] Do not dispatch compute shaders if no pipeline is bound
Fixes crashes in Tomb Raider 2013.
2018-01-25 12:57:43 +01:00
Philip Rebohle a1a7bb9092
[dxvk] DxvkBindingLayout -> DxvkPipelineLayout 2018-01-23 17:40:36 +01:00
Philip Rebohle 0900dfd0e3
[dxvk] Removed explicit image barriers for render passes
Instead, the color format and layout will now be set in
the render pass description. This slows down render pass
lookups but may improve efficiency and work around driver
bugs.
2018-01-22 19:21:46 +01:00
Philip Rebohle f25b3c8b32
[d3d11] Use EmitCs for resource updates 2018-01-20 21:42:11 +01:00
Philip Rebohle 2dd24a14d2
[dxvk] Refactored blend constants
This will make things a little less painful when capturing
blend constants in a lambda function, as required for CSMT.
2018-01-20 15:41:06 +01:00
Philip Rebohle f88adc4e82
[d3d11] Implemented mipmap generation 2018-01-20 09:46:54 +01:00
Philip Rebohle 2a364c557b
[d3d11] Implemented image mapping for reads 2018-01-19 18:09:49 +01:00
Philip Rebohle 5dd9fea011 [dxvk] Implemented input layout validation
Checks whether all input slots consumed by the vertex shader
are provided by the input layout, and disables rendering in
case the state validation fails. This should hopefully fix
GPU lockups in Nier:Automata.
2018-01-12 14:25:26 +01:00
Philip Rebohle 9c90c1ac00 [dxvk] Optimized pipeline state updates 2018-01-10 20:40:10 +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 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 fd2bb610eb [d3d11] Implemented indirect draws and dispatch 2017-12-31 01:31:08 +01:00
Philip Rebohle b7ce9660c3 [d3d11] Implemented CopySubresourceRegion for images 2017-12-30 19:10:45 +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 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 342e99a11c [dxvk] Optimized descriptor updates 2017-12-19 19:36:44 +01:00
Philip Rebohle d3b2174180 [dxvk] Implemented buffer renaming 2017-12-16 13:21:11 +01:00
Philip Rebohle 40241e0b22 [dxvk] DxvkBufferBinding -> DxvkBufferSlice 2017-12-14 15:24:43 +01:00
Philip Rebohle 5f0e94138e [dxvk] Implemented support for multisampled images and render targets 2017-12-12 00:27:49 +01:00
Philip Rebohle 50b7293b8f [d3d11] Implemented blend state and depth-stencil state binding 2017-12-11 14:11:18 +01:00
Philip Rebohle 52f1c4fa00 [dxvk] Implemented staging buffers for large data transfers 2017-12-10 15:57:51 +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 6a9743ead7 [dxvk] Refactored blend state 2017-12-08 00:51:20 +01:00
Philip Rebohle 84605a1310 [dxvk] Refactored input layout state 2017-12-08 00:44:58 +01:00
Philip Rebohle 385c92db5a [dxvk] Refactoring of most constant state objects 2017-12-08 00:02:43 +01:00
Philip Rebohle 796c200e32 [dxvk] Major refactoring of graphics pipeline state lookup in order to support more dynamic state 2017-12-07 21:47:38 +01:00
Philip Rebohle ade00add8d [dxvk] Removed buffer stride stuff for now, we need a better solution 2017-12-07 19:28:54 +01:00
Philip Rebohle 27e63cbdc6 [d3d11] Implemented small buffer uploads 2017-12-07 18:51:41 +01:00
Philip Rebohle a901a85401 [dxvk] Added support for vertex index types 2017-12-07 14:01:17 +01:00
Philip Rebohle f33acf7334 [dxvk] Modified interface to accept dynamic vertex buffer strides 2017-12-07 11:39:59 +01:00
Philip Rebohle 19851c8432 [dxvk] Re-implemented pipeline creation within the backend 2017-12-07 09:38:31 +01:00
Philip Rebohle e0df25a7c5 [dxvk] Implemented proper image memory barriers 2017-12-05 13:00:06 +01:00
Philip Rebohle b5d068366d [dxvk] Implemented shader resource binding 2017-12-03 20:23:26 +01:00
Philip Rebohle a6bf7659b0 [dxvk] Refactored shader binding, client APIs must now create pipelines and pipeline layouts 2017-12-03 00:40:58 +01:00
Philip Rebohle 57821db900 [dxvk] Added image init functions to context 2017-12-01 17:52:05 +01:00
Philip Rebohle c936709aec [dxvk] Moved context flags out of context state object 2017-12-01 10:27:33 +01:00
Philip Rebohle 4e39ef859b [dxvk] More convenient command list assignment API 2017-12-01 10:08:49 +01:00
Philip Rebohle 27905d0711 [dxvk] Removed Recorder interface and deferred context 2017-12-01 09:50:47 +01:00
Philip Rebohle 4b6d8264e7 [dxvk] Added method to clear images that are not bound for rendering 2017-12-01 00:52:13 +01:00
Philip Rebohle c82bddb932 [dxvk] Added buffer copy and initial buffer barriers 2017-11-26 13:24:01 +01:00
Philip Rebohle 64d9ad0027 [dxvk] Added dispatch call 2017-11-23 14:24:00 +01:00
Philip Rebohle 47bdf9408b [dxvk] Added buffer view class 2017-11-21 19:50:57 +01:00
Philip Rebohle a47ebd6ed5 [dxvk] Proper blend state and viewport state setup 2017-11-20 15:35:29 +01:00
Philip Rebohle 8bb0325928 [dxvk] Implemented graphics pipeline creation 2017-11-20 14:11:09 +01:00
Philip Rebohle a895b0159b [dxvk] Added constant state object binding functions 2017-11-20 13:38:24 +01:00
Philip Rebohle ae0c186f26 [dxvk] Implemented constant state objects 2017-11-20 13:21:27 +01:00
Philip Rebohle a84e2eabc2 [dxvk] Restructured state tracker again 2017-11-17 19:49:44 +01:00
Philip Rebohle 2c3674190a [dxvk] Implemented proper resource binding 2017-10-15 19:23:10 +02:00
Philip Rebohle e433c01ad4 [dxvk] Some more work on shader resources and resource bindings 2017-10-15 17:56:06 +02:00
Philip Rebohle 883ae9f39d [dxvk] Added pipeline manager stub 2017-10-14 23:52:47 +02:00
Philip Rebohle 6e057b2b53 [dxvk] Command list now implements DxvkRecorder 2017-10-14 14:28:31 +02:00
Philip Rebohle 764220db98 [dxvk] Added shader stub, improved state tracking code 2017-10-13 03:19:23 +02:00
Philip Rebohle 94af8140d2 [dxvk] DxvkContext now supports clears and actual state tracking 2017-10-11 23:29:05 +02:00
Philip Rebohle 00e63d71a9 Initial commit 2017-10-10 23:32:13 +02:00