1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-04 07:24:15 +01:00
Commit Graph

2641 Commits

Author SHA1 Message Date
Philip Rebohle
dbc14fe65c
[d3d11] Fix memory order for query reset counter
Probably doesn't change anything, but let's fix it anyway.
2019-11-14 23:43:58 +01:00
Philip Rebohle
a6483e02fe
[d3d11] Submit stalling event queries before flushing
Otherwise, instead of preventing syncs, this would actually
have the opposite effect.
2019-11-14 22:57:30 +01:00
Philip Rebohle
3457e312b0
[dxvk] Always align index buffer slices to 256 Bytes
To be on the safe side.
2019-11-14 14:32:01 +01:00
Philip Rebohle
420d95e396
[dxvk] Store shader capability information in separate set of flags 2019-11-12 18:05:03 +01:00
Philip Rebohle
1ca235d186
[util] Disable strict DC mode for MGSV again
Not necessary since the resubmitted contexts don't contain mapped buffers.
2019-11-12 00:59:33 +01:00
Philip Rebohle
4f7e7979e3
[util] Add app profile for Metal Gear Solid 5 2019-11-11 23:31:14 +01:00
Philip Rebohle
cc18730967
[dxvk] Enable option to disable OpenVR integration 2019-11-11 23:30:35 +01:00
Philip Rebohle
9f66351b82
[dxvk] Move extension provider list to DxvkInstance 2019-11-11 23:30:07 +01:00
Philip Rebohle
6948d18f5f
[dxvk] Always align vertex buffer slices to 256 bytes
Works around an unknown geometry rendering isssue in Warhammer Chaosbane.
Should probably be investigated at some point.
2019-11-10 22:37:11 +01:00
Philip Rebohle
31baf3529a
[d3d11] Fix uninitialized DSV flags
Fixes #1242.
2019-11-10 15:02:21 +01:00
Philip Rebohle
4b199ef60d
[dxvk] Remove option to disable transfer queue 2019-11-08 11:29:22 +01:00
Philip Rebohle
a74449c367
[dxvk] Remove ability to query instance from adapter
Adapters don't hold a reference to the instance.
2019-11-08 11:28:08 +01:00
Philip Rebohle
77574d9970
[d3d11] Don't query DXVK instance from adapter 2019-11-08 11:25:58 +01:00
Philip Rebohle
b2317cad4d
[dxvk] Pass DXVK instance to DXVK device directly, not through the adapter 2019-11-08 11:17:02 +01:00
Philip Rebohle
212f5ba1f3
[dxgi] Query DXVK instance from DXGI factory, not the adapter 2019-11-08 11:06:15 +01:00
Philip Rebohle
ed8af3ccc4
[dxvk] Document wonky DxvkAdapter ref count behaviour 2019-11-07 21:08:20 +01:00
Philip Rebohle
a0dba6bbf9
[d3d11] Hold reference to DxvkInstance
Hack to keep the instance alive which owns the adapters. Should
fix #1240 for now, but we should fix this properly later on.
2019-11-07 20:21:27 +01:00
Philip Rebohle
b18c50d5ab
[dxvk] Use static variables for extension provider instances
Also, remove redundant interface documentation.
2019-11-07 01:35:10 +01:00
Joshua Ashton
dbf2407fd3 [dxvk] Implement extension provider system
This change introduces a new system for providing extra instance/device extensions.

This consolidates platform-specific and vr-related to its' own thing for potential future cross-platform/native Linux work.
2019-11-07 01:24:52 +01:00
Joshua Ashton
27898ebbfc [build] Simplify and correct errors in options handling
Fix some typos...

D3D10 is dependent on D3D11 therefore DXGI is always dependent on D3D11
2019-11-07 01:24:52 +01:00
Joshua Ashton
4ad99feb73 [build] Demote no frontends/tests to a warning 2019-11-07 01:24:52 +01:00
Philip Rebohle
1d961b7dc3
[d3d11] 'a' is not a very good name for a variable 2019-11-04 13:46:18 +01:00
Philip Rebohle
77a0cb2b19
[d3d11] Don't synchronize with CS thread on present
Instead, submit from the CS thread in order to prevent out-of-order
submissions. Improves minimum FPS in Final Fantasy XIV by 5-10%.
2019-11-02 17:53:17 +01:00
Philip Rebohle
e6c3f0479d
[dxvk] Let device know that async presentation is enabled 2019-11-02 17:53:17 +01:00
Philip Rebohle
d96c22be05
[d3d11] Do not synchronize with CS thread in GetData
Instead, use a counter to determine whether there are any
pending operation for the query on the CS thread.
2019-11-02 17:53:17 +01:00
Philip Rebohle
0924bb469c
[d3d11] Move query state tracking to immediate context implementation 2019-11-02 17:53:17 +01:00
Philip Rebohle
be5dc234c1
[d3d11] Move common Begin/End implementation to immediate context 2019-11-02 13:48:03 +01:00
Philip Rebohle
63dbca82e7
[d3d11] Track used queries in deferred contexts and command lists 2019-11-02 13:48:03 +01:00
Philip Rebohle
0671007437
[d3d11] Only execute Begin for scoped queries 2019-11-02 13:48:03 +01:00
Philip Rebohle
1459f0e852
[util] Fix != and == operator for private/public COM pointers 2019-11-02 13:48:00 +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
e95bc3256f
[d3d11] Move handling of constantBufferRangeCheck option to D3D11Options 2019-10-30 10:57:36 +01:00
Philip Rebohle
9e084e63ca
[d3d11] Remove useless members from D3D11DeferredContextMapEntry 2019-10-30 00:44:17 +01:00
Philip Rebohle
9e69a610cb
[dxgi] Use 64-bit integers for refresh rate matching math
Otherwise, there may be integer overflows for certain parameter values.
2019-10-29 08:42:53 +01:00
Philip Rebohle
c4e5323e0e
[dxbc] Remove old constant buffer range check 2019-10-28 17:52:50 +01:00
Philip Rebohle
fd547b666e
[dxbc] Don't emit a spec constant for uniform buffers 2019-10-28 15:44:02 +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
68760f5b20
[dxbc] Parse dynamically indexed flag for constant buffers 2019-10-28 14:15:44 +01:00
Philip Rebohle
7db98a1aa4
[meta] Release 1.4.4 2019-10-27 17:56:31 +01:00
Alexandr
dacf1ab4d6 [util] Enable constant buffer range check for Saints Row games
Fixes character flickering on Nvidia.
2019-10-27 11:55:48 +01:00
Philip Rebohle
a2b629415e
Revert "[d3d11] Fix ref counting for D3D11CommandList"
This reverts commit 55bae45915.
2019-10-27 11:10:49 +01:00
Philip Rebohle
fc0ede0657
Revert "[d3d11] Recycle command lists from deferred contexts"
This reverts commit 4e3da45fde.

For some reason this caused crashes.
2019-10-27 11:00:59 +01:00
Philip Rebohle
8c34f4ff8a
[dxvk] Validate image layouts in render pass formats read from cache
This will discard invalid cache entries generated by DXVK 1.4.3.
2019-10-27 00:04:57 +02:00
Philip Rebohle
03dc59ef39
[dxvk] Write correct depth-stencil attachment layout to state cache
Fixes a dumb issue where we'd compress layouts with high enum values
to a single byte and incorrectly interpret the result as PREINITIALIZED.
2019-10-26 23:59:11 +02:00
Philip Rebohle
9361f19da6
[dxvk] Fix uninitialized depth attachment reference
Also don't redundantly null color attachment refs for cosmetic reasons.
2019-10-26 23:37:46 +02:00
Philip Rebohle
6888a98c89
[dxbc] Always set geometry shader invocation count
Fixes validation errors when the DXBC shader does not specify
the invocation count itself.
2019-10-26 23:19:59 +02:00
Philip Rebohle
144f4badef
[dxbc] Always allocate at least one input array element
Turns out that shaders with no inputs can still have an input signature,
in which case we were generating a zero-length array which is illegal.
2019-10-26 23:13:59 +02: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
44c0f96fc1
[dxvk] Pause transform feedback on buffer updates
Otherwise, we might override a currently bound transform
feedback buffer or counter buffer. Fixes Unity Engine.
2019-10-26 19:57:39 +02:00
Philip Rebohle
3c4a57acc6
[dxvk] Fix bogus xfb buffer update check 2019-10-26 19:40:32 +02:00
Philip Rebohle
0683f4f2c0
[d3d11] Remove D3D11 counter buffer class 2019-10-26 17:44:29 +02:00
Philip Rebohle
e967c52ff7
[d3d11] Allocate predicate buffer per query
Allows us to get rid of the D3D11 counter buffer class.
2019-10-26 17:44:29 +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
191c9644af
[d3d11] Allocate counter buffer per UAV
Might slightly increase memory overhead, however this allows
the backend to execute UAV counter updates more efficiently.
2019-10-26 17:44:29 +02:00
Philip Rebohle
320e0de4a0
[dxvk] Handle xfb barriers in commitGraphicsBarriers
Avoids spilling the render pass when switching xfb buffers.
2019-10-26 17:44:29 +02:00
Philip Rebohle
5b66f1ec0b
[dxvk] Replace buffer in updateBuffer even outside of render passes
Needed to avoid barriers arount D3D11 UAV counter buffer updates.
2019-10-26 17:44:29 +02:00
Philip Rebohle
d1e9e1392d
[dxvk] Lazily allocate slices of small buffers
Reduces memory overhead in case games create small static
buffers. This is somewhat common for index buffers used
to render fullscreen quads or triangles.
2019-10-26 15:24:55 +02:00
Philip Rebohle
7751541662
[dxvk] Don't lock swap lock if not necessary
The swap lock only protects the 'next' free list, which
is not accessed at all when creating a new buffer.
2019-10-26 15:24:54 +02:00
Philip Rebohle
e868f829b5
[dxvk] Pad buffers more tightly
This will allow for smaller buffers to be laid out more efficiently.
2019-10-26 15:24:54 +02:00
Philip Rebohle
83fc15c594
[dxvk] Force-update draw buffer for graphics pipeline barrier checks 2019-10-26 12:41:40 +02:00
Philip Rebohle
c44d30d78b
[dxvk] Consider indirect draw buffer in graphics pipeline barriers 2019-10-26 04:13:05 +02:00
Philip Rebohle
f60d1db1f1
[dxvk] Consider vertex/index buffers in graphics pipeline barriers
Leaving these out was an oversight.
2019-10-26 04:12:32 +02:00
Philip Rebohle
e918104ef3
[dxvk] Introduce checkGfxImageBarrier 2019-10-26 03:56:57 +02:00
Philip Rebohle
7a78852776
[dxvk] Introduce checkGfxBufferBarrier 2019-10-26 03:56:52 +02:00
Philip Rebohle
2b812f07c1
[dxvk] Move finalizeDraw into commitGraphicsState
There is no readon to perform this after the draw anymore.
2019-10-26 03:55:03 +02:00
Philip Rebohle
4e3da45fde
[d3d11] Recycle command lists from deferred contexts
Can save a few memory allocations and deallocations at runtime.
2019-10-25 23:09:21 +02:00
Philip Rebohle
7f66373a69
[util] Add virtual destructor to NoWrapper 2019-10-25 22:08:00 +02:00
Philip Rebohle
55bae45915
[d3d11] Fix ref counting for D3D11CommandList 2019-10-25 21:37:18 +02:00
Philip Rebohle
41f04ffb61
[d3d11] Fix incorrect AddRef return value 2019-10-25 21:36:21 +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
2d6a3396dd
[dxbc] Declare length of shader input array late
Otherwise, we generate out-of-bounds array reads and writes
in broken ENB shaders.
2019-10-23 16:36:52 +02:00
Philip Rebohle
df61a479a2
[spirv] Add 'late' constants
Late constants can be used to reserve a placeholder ID for a constant
before the constant's value is known. The value can be changed later.
Only scalar 32-bit integer and floating point types are supported
as of right now.
2019-10-23 16:09:28 +02:00
Philip Rebohle
59d4556641
[dxbc] Extend scalar constants to vectors if required
Needed for ENB. Fixes #865.
2019-10-23 15:26:22 +02:00
Philip Rebohle
ec8ca8a403
[dxbc] Assume vec4 type for i/o vars not declared in signature
Works around an ENB bug.
2019-10-23 15:26:22 +02:00
Philip Rebohle
3e12a116bb
[dxbc] Declare temp registers on demand
And ignore dcl_temps. Needed to successfully compile some broken
ENB shaders (this does work on Windows too). See #865.
2019-10-23 13:55:04 +02:00
Philip Rebohle
ee77afb6af
[d3d11] Validate shader module capabilities
Only create a shader module if the device actually supports
the required features. Apparently this is needed for some
Unity Engine games.
2019-10-21 12:10:05 +02:00
Philip Rebohle
ddf010479d
[d3d11] Refactor shader module creation 2019-10-21 12:09:53 +02:00
Philip Rebohle
9444162ca6
[util] Enable constant buffer range check for Titan Quest
Reportedly flickers on Nvidia GPUs otherwise.
2019-10-20 13:27:12 +02:00
Philip Rebohle
7a0360d7c2
[dxgi] Remove useless d3d10.enable option 2019-10-19 00:34:51 +02:00
Philip Rebohle
ad3542f4fc
[meta] Release 1.4.3 2019-10-18 17:50:38 +02:00
Philip Rebohle
8211225ad4
[dxbc] Swap OpSelect arguments for Ne/Dne, don't use OpLogicalNot
Saves one instruction.
2019-10-18 03:22:20 +02:00
Philip Rebohle
b756c229a9
[dxvk] Implement more compact state cache data format (v8)
Omits a lot of unnecessary data and considerably reduces
the state cache file size, often by over 80%.
2019-10-18 00:33:50 +02:00
Philip Rebohle
0ac89ccd9e
[util] Add missing != operator to Sha1Hash 2019-10-18 00:33:40 +02:00
Philip Rebohle
4b0a5dffb2
[dxvk] Support component mappings in blitter 2019-10-16 20:00:38 +02:00
Philip Rebohle
d998aaad12
[dxvk] Add some component mapping helpers 2019-10-16 20:00:38 +02:00
Philip Rebohle
0d7f658f96
[dxvk] Implement framebuffer-based blit 2019-10-16 20:00:38 +02:00
Philip Rebohle
6290cfdb48
[dxvk] Add class for framebuffer-based blits 2019-10-16 17:31:40 +02:00
Philip Rebohle
6234a1a6b0
[dxvk] Support arbitrary source texture coordinates in blitter 2019-10-16 02:45:44 +02:00
Philip Rebohle
859ac59e6c
[dxvk] Support multisampled destinations in blitter
Apparently this is required for some D3D9 content.
2019-10-16 02:17:55 +02:00
Philip Rebohle
e747315ba6
[dxvk] Support both linear and nearest samplers in blitter 2019-10-16 02:08:04 +02:00
Philip Rebohle
6ea21d57fe
[dxvk] Factor out mip gen classes and rename them to DxvkMetaBlit*
Since mip map generation is a blit operation, we can make a more
general-purpose blitter and implement mip map generation on top
of that.
2019-10-16 01:52:14 +02:00
Philip Rebohle
d899bd2d76
[d3d11] Remove obsolete DefaultDesc methods from state classes 2019-10-14 05:28:46 +02: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
1282c2b99e
[d3d11] Fix immediate context reference counting
Fixes various wine test failures.
2019-10-14 01:56:34 +02:00
Philip Rebohle
4d0cc3e24e
[d3d11] Don't subclass state objects from ComObject
These override reference counting, so we shouldn't use ComObject.
2019-10-14 01:44:37 +02:00
Philip Rebohle
c5c43fb2a4
[d3d11] Allow choosing type wrapper for D3D11DeviceChild base class
Allows subclasses to replace ComObject with something else.
2019-10-14 01:44:27 +02:00
Philip Rebohle
dd9a55ecc0
[util] Don't allow multiple inheritance for COM objects
This never made any sense whatsoever in the first place.
2019-10-14 01:42:24 +02:00
Philip Rebohle
c281e76bac
[d3d11] Don't get private references for state objects
Otherwise we will end up deleting the objects even though they
aren't explicitly heap-allocated. Whoops...
2019-10-14 01:39:54 +02:00
Philip Rebohle
9c6209fbf5
[d3d11] Fix reference counting for state objects
Fixes various wine test failures. Also, state objects are now
allocated in the hash map itself rather than a wrapped COM object.
2019-10-14 01:27:59 +02:00
Philip Rebohle
accbc8828c
[d3d11] Return error if no desc is provided for Create*State methods
Fixes wine test failures.
2019-10-14 01:08:31 +02:00