Commit Graph

60 Commits

Author SHA1 Message Date
Joshua Ashton 742b52bbb5 [d3d11] Fix device child refs properly 2021-01-15 23:47:48 +01:00
Philip Rebohle 57acbbd7c7
[d3d11] Always enable STORAGE_BUFFER_BIT usage for srv/uav buffers
Fixes validation errors in games that use incorrect view types in
some cases, e.g. Cloudpunk.
2020-05-12 00:23:12 +02:00
Philip Rebohle 7b760800b4
[d3d11] Fix buffer view compatibility check 2020-03-08 01:28:51 +01:00
Philip Rebohle 1780c549e5
[d3d11] Only add storage buffer usage flag to constant buffers if needed
Otherwise, the backend optimization for dynamic uniform buffers will not
kick in.
2019-10-30 10:58:05 +01:00
Philip Rebohle 3d213efe53
[dxbc] Use SSBOs for dynamically indexed constant buffers if needed
SSBOs are tightly bound-checked on all Nvidia GPUs, so this allows for
a more accurate workaround for games relying on OOB access behaviour.
2019-10-28 15:42:46 +01:00
Philip Rebohle 20f79a754b
[d3d11] Adjust buffer memory flags if apitrace is attached
Using cached memory speeds up apitrace significantly as it
reads back mapped memory regions.
2019-10-26 22:56:47 +02:00
Philip Rebohle 09f507c284
[d3d11] Allocate xfb counter buffer per buffer
Same idea as with UAV counters, allows for more efficient updates.
2019-10-26 17:44:29 +02:00
Philip Rebohle f9c2e43ffc
[d3d11] Don't set HOST pipeline stage and access flags for resources
The backend does not and will not use that information at all.
2019-10-24 16:57:06 +02:00
Philip Rebohle 3a39027987
[d3d11] Add more rigid validation for buffer creation
Fixes several wine test failures.
2019-10-11 17:32:46 +02:00
Philip Rebohle 762df0bedf
[d3d11] Change ValidateBufferProperties to NormalizeBufferProperties 2019-10-11 17:23:02 +02:00
Joshua Ashton 19fa1c405c [d3d10] Remove unused copies of device ptr in D3D10 wrappers
Silences a warning when building with Clang, and removes duplicate unused data.
2019-10-06 00:28:19 +02:00
Philip Rebohle 6ce8450b12
[d3d11] Implement D3D11.2 MapOnDefaultBuffers feature
Basically just allocates the buffer on a host-visible memory
type, like DYNAMIC or STAGING buffers depending depending on
the CPU access flags.
2019-09-17 17:47:33 +02:00
Philip Rebohle 2cdbe2e6df
[d3d11] Move GetMemoryFlagsForUsage into D3D11Buffer
D3D11Buffer is the only user of this function and the code sharing
potential is limited. This allows us to implement the memory type
selection for buffers in one single place rather than two.
2019-09-17 17:21:10 +02:00
Philip Rebohle 7ba7178d14
[d3d11] Implement ID3D11Device2
Adds some extra validation to resource creation so that
apps cannot accidentally create tiled resources.
2019-09-16 12:42:14 +02:00
Philip Rebohle 00cf2a20a3
[d3d11] Don't allow the creation of buffers with a size of zero 2019-07-21 20:47:42 +02:00
Philip Rebohle 63d8d9c3db
[d3d11] Validate buffer descriptions 2019-06-13 03:31:26 +02:00
Philip Rebohle a340b3101c
[d3d11] Add missing interface queries for IDXGIObject and IDXGIDeviceSubObject 2019-05-01 01:54:00 +02:00
Philip Rebohle 2c61303976 [d3d11] Implement IDXGIResource1 for textures and buffers 2019-04-27 20:21:54 +02:00
Joshua Ashton 5ea8648cd9 [d3d11, d3d10, dxgi] Handle null ppvObject in QueryInterface. (#909)
When a null ppvObject is passed into a QueryInterface on any IUnknown, a E_POINTER should be returned as the result (and it should not crash.)

This matches native d3d11/d3d10/dxgi behaviour and the documentation found here https://docs.microsoft.com/en-us/windows/desktop/api/unknwn/nf-unknwn-iunknown-queryinterface(q_) for IUnknown.
2019-02-10 08:01:01 +01:00
Philip Rebohle c804d99db7
[d3d11] Fix log spam in SetEvictionPriority stubs 2019-01-12 15:22:34 +01:00
Philip Rebohle 8b5db80fbd
[dxvk] Reimplement DxvkBuffer
Avoids the DxvkPhysicalBuffer indirection and keeps all buffer
objects alive until the DxvkBuffer itself gets destroyed.
2019-01-09 18:04:46 +01:00
Philip Rebohle 3fff5d56b3
[d3d11] Mark raw and structured buffers as potential storage buffers 2018-12-14 23:45:37 +01:00
Philip Rebohle 6b5aa0b928
Merge branch 'vk_transform_feedback' 2018-10-13 08:00:51 +02:00
Philip Rebohle 6d18efdfc7
[d3d10] Lock device on context operations
May fix thread safety issues in some games. Apparently, the
D3D10Device is supposed to be thread safe by default.
2018-10-12 18:31:55 +02:00
Philip Rebohle 97d776cc00
[d3d11] Allocate counter for stream output buffers 2018-10-10 19:55:41 +02:00
Philip Rebohle f42ea9f1d1
[d3d11] Set transform feedback usage, stage and access flags 2018-10-10 13:05:38 +02:00
Philip Rebohle 305c361c00
[d3d11] Fix incomplete usage mask for buffer UAVs 2018-09-25 10:14:42 +02:00
Philip Rebohle 553c90307a
[d3d10] Implement D3D10Buffer 2018-08-13 17:22:41 +02:00
Philip Rebohle 82c891b1fb
[d3d11] Fix structured buffer view validation 2018-08-10 02:39:35 +02:00
Philip Rebohle f9e096e954
[d3d11] Validate buffer view format compatibility
Prevents the app from creating illegal buffer views.
2018-08-09 23:37:41 +02:00
Philip Rebohle f586970c59
[d3d11] Validate buffer view bind flags 2018-08-09 22:04:03 +02:00
Philip Rebohle 66e178756e
[d3d11] Introduce GetCommonBuffer helper
Also update GetCommonTexture documentation.
2018-08-05 18:29:29 +02:00
Philip Rebohle ace8e42213
[d3d11] Move BufferInfo struct into D3D11Buffer 2018-08-05 18:24:01 +02:00
Philip Rebohle c600b43d73
[d3d11] Allocate DYNAMIC buffers on device-local host-visible memory
Improves performance on AMD cards when GPU-bound.
~5% FPS increase in The Witcher 3.
2018-05-29 14:50:08 +02:00
Philip Rebohle 9cec1ecca3 [d3d11] Fix stage and access mask for default constant buffers 2018-05-04 10:23:36 +02:00
Philip Rebohle 2973c18055 [dxgi/d3d11] Remove COM_QUERY_INTERFACE macro, reset pointers
May fix some crashes in applications that rely on the returned
pointer being set to nullptr before returning.
2018-04-02 12:52:02 +02:00
Mikhail Paulyshka b17568deba [dxgi,d3d11] log unknown interfaces GUID (#154)
* [d3d11] log unknown interfaces GUID in QueryInterface()

* [dxgi] log unknown interfaces GUID in QueryInterface()
2018-03-12 12:05:43 +01:00
pchome fb3734ce49
[d3d11] Fix unhandled exception
With this patch The Witcher 3 can successfully load saved game.
2018-02-14 07:35:39 +02:00
Philip Rebohle aaf7b05625
[d3d11] Use EmitCs for buffer mapping 2018-01-20 22:28:15 +01:00
Philip Rebohle 9acc4a1a82
[d3d11] Map default constant buffers to host memory
Improves performance in applications that use UpdateSubresources
to frequently update constant buffers, such as Unigine Heaven,
Unigine Valley and Homefront.
2018-01-18 11:55:27 +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 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 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 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 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 2a266eaad4 [general] Added 32-bit support 2017-12-12 12:50:52 +01:00