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

2403 Commits

Author SHA1 Message Date
Philip Rebohle
3f4c9a3bb5
[hud] Add GPU load monitor 2019-07-18 23:23:36 +02:00
Philip Rebohle
5bb20cceb6
[dxvk] Add GPU idle time to stat counters 2019-07-18 23:23:12 +02:00
Philip Rebohle
3d86ecd94d
[dxvk] Estimate GPU idle time based on cleanup thread activity
We'll assume that GPU idle time == time spent waiting for new
command lists to be added to the queue of the cleanup thread.
This isn't entirely accurate, especially if CPU load is very
high, but should be good enough.
2019-07-18 22:54:11 +02:00
Philip Rebohle
02d917c680
[dxvk] Fix meta copy operation for mipmapped images 2019-07-18 19:52:24 +02:00
Philip Rebohle
fb9ea958a1
[dxvk] Fix meta copy operation for 1D images 2019-07-18 19:50:57 +02:00
Philip Rebohle
2905ba82d2
[dxvk] Remove old meta vertex and geometry shaders 2019-07-18 18:59:11 +02:00
Philip Rebohle
8889d6402e
[dxvk] Use new fullscreen shaders for mip gen operations 2019-07-18 18:57:18 +02:00
Philip Rebohle
e91efb6dc2
[dxvk] Use new fullscreen shaders for meta resolve operations 2019-07-18 18:57:17 +02:00
Philip Rebohle
792f15680a
[dxvk] Use new fullscreen shaders for meta copy operations 2019-07-18 18:57:17 +02:00
Philip Rebohle
07408bcdcc
[dxvk] Add new vertex and geometry shaders for fullscreen passes
These new shaders are aimed to be used by all meta operations
and will work without geometry shaders on supported hardware.
2019-07-18 18:57:15 +02:00
Philip Rebohle
92d6f26130
[d3d11] Always enable depth-stencil attachment usage for depth-stencil images
Allows us to use framebuffer copies even if the game itself does not
intend to render to the image.

Improves performance in Final Fantasy XIV on RADV.
2019-07-18 17:26:02 +02:00
Philip Rebohle
8a9cee903b
[dxvk] Use render pass copy for depth-stencil images if beneficial 2019-07-18 17:26:02 +02:00
Philip Rebohle
a08f9d0897
[dxvk] Implement device- and driver-specific performance hints
These are meant to be read by the DxvkContext in order to choose
a fast path for certasin operations.
2019-07-18 17:25:56 +02:00
Philip Rebohle
e611dff45e
[dxvk] Support depth-stencil meta-copy operations 2019-07-18 17:25:56 +02:00
Philip Rebohle
0dd8cba199
[dxvk] Support depth-stencil formats for meta copy objects 2019-07-18 17:25:50 +02:00
Philip Rebohle
89516e2da2
[dxvk] Add meta copy shaders for depth-stencil formats 2019-07-18 17:25:48 +02:00
Philip Rebohle
677e33b9c9
[dxvk] Enable VK_EXT_shader_stencil_export if available 2019-07-18 17:25:48 +02:00
Philip Rebohle
f0fb25c082
[dxvk] Log more device info on device creation
This should tell us whether extension features are actually used.
2019-07-18 13:37:14 +02:00
Philip Rebohle
f3943934a7
[util] Improve multi-line logging 2019-07-18 13:34:52 +02:00
Philip Rebohle
f16ba4794b
[d3d11] Use unlikely() for some query code
This is a somewhat hot path in some games, so why not.
2019-07-17 20:35:00 +02:00
Philip Rebohle
c4b56b9d8d
[d3d11] Use private temporary references for queries
Like the previous commit, just with queries.
2019-07-17 20:16:19 +02:00
Philip Rebohle
7225674088
[d3d11] Use private temporary references for state objects
We really shouldn't be altering the application-visible ref
count when sending these objects to the CS thread.
2019-07-17 20:01:57 +02:00
Philip Rebohle
21a2ce045f
[util] Add convenience method to return public/private references 2019-07-17 19:59:50 +02:00
Philip Rebohle
af8e1a3d47
[d3d11] Simplify ApplyPrimitiveTopology code 2019-07-17 15:54:59 +02:00
Philip Rebohle
3f30fbd098
[d3d11] Simplify BindIndexBuffer code 2019-07-17 14:41:00 +02:00
Philip Rebohle
63fe899bdc
[dxvk] Don't check if bindings have changed in the backend
The state tracker should perform these checks before sending commands
off to the backend anyway, so checking again in the backend is redundant.
2019-07-17 14:26:55 +02:00
Philip Rebohle
b6c395c013
[dxvk] Don't track command count in CS chunks
We weren't using this at all, and it's not necessary
to check whether the chunk is empty either.
2019-07-17 12:52:25 +02:00
Philip Rebohle
11b7fc8914
[d3d11] Catch invalid ClearUnorderedAccessViewFloat calls
This method cannot be called on integer UAVs.
2019-07-17 11:47:42 +02:00
Philip Rebohle
b20ceec727
[d3d11] Handle integer formats in ClearRenderTargetView correctly
We're supposed to apply the same color conversion as in ClearView.
2019-07-17 11:47:42 +02:00
Philip Rebohle
c6ea115ca3
[dxvk] Add method to retrieve buffer view format info 2019-07-17 11:47:42 +02:00
Philip Rebohle
c29314de5a
[dxvk] Change DxvkImageView::formatInfo to return view format info
Makes more sense and won't break any existing code using it.
2019-07-17 11:33:39 +02:00
Philip Rebohle
7895272806
[dxvk] Use correct command buffer for buffer updates
Fixes a regression in SpellForce 3.
2019-07-16 23:47:33 +02:00
Philip Rebohle
493b55b073
[dxvk] Compute memory chunk size per memory type rather than per heap 2019-07-16 09:59:44 +02:00
Philip Rebohle
6936da17d9
[dxvk] Try harder to allocate memory from a given memory type
Before failing, see if we can't allocate a smaller chunk size.
2019-07-16 09:59:44 +02:00
Philip Rebohle
18aada29ef
[dxvk] Don't put large resources into their own memory allocations
This approach currently has two issues:
- We might fail to allocate the resource on the desired memory type
  even if there is a chunk available that it would tif in
- With 128MB chunks, this no longer seems to be beneficial anyway
2019-07-16 09:24:55 +02:00
Philip Rebohle
ad8fdcac07
[dxvk] Don't mark queries as stalling if DONOTFLUSH is set 2019-07-16 01:19:02 +02:00
Philip Rebohle
acf6c27e76
[dxvk] Limit maximum size of multi-slice buffers
Reduces memory fragmentation caused by frequently renamed buffers.
2019-07-15 04:14:23 +02:00
Philip Rebohle
d8e31f221f
[dxvk] Fix offset in DxvkBuffer::subSlice 2019-07-15 04:06:12 +02:00
Philip Rebohle
f88658d88c
[dxvk] Template BindPoint parameter in some DxvkContext methods
Again, there's no reason not to do this since the argument is always
constant, and we can skip some work in the compute case.
2019-07-14 20:09:35 +02:00
Philip Rebohle
def05f007c
[dxvk] Template Index parameter of commitGraphicsState
This is always constant anyway, so avoid some unnecessary code.
2019-07-14 19:57:50 +02:00
Philip Rebohle
8dfdda7a39
[dxvk] Get rid of validateCompute/GraphicsState
After all this time we haven't found a single situation where
we need more validation, so scrap it. Checking whether there
is an active render pass was redundant anyway.
2019-07-14 19:34:56 +02:00
Philip Rebohle
a93dd74f71
[dxvk] Don't use derivative pipelines
No driver appears to be taking advantage of this, so why bother.
2019-07-14 13:58:00 +02:00
Philip Rebohle
03c6df56c1
[d3d11] Initialize subresourceLayers in the inner loop
Not doing so causes Dirt Rally to fail uploading some textures
properly for some extremely weird reason.
2019-07-13 23:39:58 +02:00
Philip Rebohle
7cb385facd
[meta] Release 1.3 2019-07-13 19:15:30 +02:00
Philip Rebohle
e116ff49e6
[dxvk] Rename memoryAvailable -> memoryBudget 2019-07-13 19:04:33 +02:00
Joshua Ashton
fac3ae9f83 [spirv] Implement opCross 2019-07-12 23:32:09 +02:00
Joshua Ashton
f280386aec [spirv] Implement opFMix 2019-07-12 23:32:09 +02:00
Philip Rebohle
8644d75722
[dxbc] Use OpDemoteToHelperInvocationEXT for discards if supported 2019-07-11 19:33:17 +02:00
Philip Rebohle
e901e1269d
[spirv] Add support for OpDemoteToHelperInvocationEXT 2019-07-11 19:33:17 +02:00
Philip Rebohle
7b34b8515b
[d3d11] Enable shaderDemoteToHelperInvocation feature 2019-07-11 19:33:17 +02:00
Philip Rebohle
b2a53a2413
[dxvk] Enable VK_EXT_shader_demote_to_helper_invocation if available 2019-07-11 19:33:17 +02:00
Liam Middlebrook
2e83aae472 [dxbc] Print shader signatures at debug loglevel 2019-07-11 12:40:44 +02:00
Liam Middlebrook
ff4fa29304 [dxbc] Add string output function for DxbcRegMask 2019-07-11 12:40:44 +02:00
Liam Middlebrook
2164a44887 [dxbc] Add ostream operator for DxbcScalarType 2019-07-11 12:40:44 +02:00
Philip Rebohle
06d4e06d8a
[dxbc] Enable early discard on RADV/ACO
Still can't enable on LLVM due to GPU hangs. The way we detect it
may have to change in the future, but for now, this should do.
2019-07-08 16:30:56 +02:00
Robin Kertels
47f7333c18
[d3d11] Fix RSGetViewports and RSGetScissorRects behaviour
Fixes #1116.
2019-07-08 13:14:42 +02:00
Philip Rebohle
24e1969dc4
[dxvk] Remove obsolete DxvkEvent class 2019-07-08 00:16:03 +02:00
Philip Rebohle
15072afa1f
[d3d11] Use new signals as frame synchronization events 2019-07-08 00:16:03 +02:00
Philip Rebohle
f0acc40e50
[dxvk] Add support for new signals to the backend 2019-07-08 00:16:03 +02:00
Philip Rebohle
4e8122eda9
[dxvk] Add new signal class 2019-07-08 00:16:00 +02:00
Philip Rebohle
c631953ab6
[d3d11] Don't immediately synchronize after present
This will actually enable asynchronous presentation.
Improves performance in Quake Champions.
2019-07-05 21:20:09 +02:00
Philip Rebohle
77db8158c8
[dxvk] Add option to toggle asynchronous presentation 2019-07-05 21:20:09 +02:00
Philip Rebohle
ed5c43a14d
[dxvk] Implement asynchronous presentation
Off-loads the vkQueuePresentKHR call to the queue submission thread
to avoid synchronization with that thread on a present call.
2019-07-05 15:11:59 +02:00
Philip Rebohle
0900f5d1bc
[dxvk] Fix typo 2019-07-05 15:09:15 +02:00
Philip Rebohle
1cc531eaf8
[d3d11] Return error when mapping an already mapped image
Final Fantasy XIV does this. Should avoid some unnecessary work.
2019-07-05 10:25:06 +02:00
Philip Rebohle
2f64f5b4e7
[dxvk] Check whether CS thread is busy before synchronizing with it
Reduces unnecessary locking overhead, which may be relevant if this
function gets called frequently by GetData or WaitForResource.
2019-07-04 21:37:17 +02:00
Philip Rebohle
f6dbf5bbf0
[dxvk] Increase staging buffer size to 32 MiB
Since the chunk size was also doubled to 128 MiB and we want
staging buffers to get their own allocations.
2019-07-04 20:39:27 +02:00
Philip Rebohle
3b1376b2fe
[dxvk] Increase memory chunk size to 128 MiB
Nvidia drivers apparently don't like smaller chunks very much.
May increase overall memory consumption and fragmentation.
2019-07-04 16:11:13 +02:00
Philip Rebohle
3b128179ab
[dxvk] Print VK_EXT_memory_budget stats on allocation failure
Based on PR #1112, but using a cleaner method to check
support for the VK_EXT_memory_budget extension.

Suggested-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
2019-07-03 11:11:12 +02:00
Philip Rebohle
ac9610f377
[dxvk] Add VK_EXT_memory_budget as a passive extension 2019-07-03 11:02:13 +02:00
Philip Rebohle
f21c02caef
[dxvk] Add support for passive device extensions
These extensions only affect physical device functionality and
do not have to be enabled during device creation.
2019-07-03 10:59:48 +02:00
Philip Rebohle
cb806a5d56
[dxvk] Free memory if vkMapMemory fails
Otherwise, we leak the allocated memory chunk and make the
problem even worse than it already is.
2019-07-02 01:26:54 +02:00
Joshua Ashton
1dadba3cce [dxvk] Give null values to empty DxvkGraphicsPipelineInstances
Silences an MSVC warning.
2019-07-01 02:46:54 +02:00
Joshua Ashton
c381e8a29e [util] Add correct type suffixes to Sha1Hash dword function to silence compiler warning 2019-07-01 02:46:54 +02:00
Philip Rebohle
67122d9246
[d3d11] Enable initial image uploads over SDMA 2019-06-29 01:53:43 +02:00
Philip Rebohle
9d902418c0
[d3d11] Enable initial buffer uploads over SDMA 2019-06-29 01:53:43 +02:00
Philip Rebohle
d5c0a8c842
[dxvk] Upload HUD font texture via SDMA 2019-06-29 01:53:43 +02:00
Philip Rebohle
c7c90830c4
[dxvk] Implement image uploads on SDMA 2019-06-29 01:53:32 +02:00
Philip Rebohle
eb71c62b33
[dxvk] Implement buffer uploads on SDMA 2019-06-29 01:53:32 +02:00
Philip Rebohle
0a40e2c868
[dxvk] Support queue ownership transfer barriers 2019-06-29 01:53:32 +02:00
Philip Rebohle
f85b9088d4
[dxvk] Explicitly specify the command buffer for copy commands 2019-06-29 01:53:32 +02:00
Philip Rebohle
be24ca6099
[dxvk] Rename and add SDMA barrier sets 2019-06-29 01:53:32 +02:00
Philip Rebohle
4f3dcf2bc8
[dxvk] Add SDMA command buffer
This new command buffer will be submitted to the transfer queue,
if available, otherwise it will be the first buffer submitted
to the graphics queue.
2019-06-29 01:53:32 +02:00
Philip Rebohle
4e0de6bc20
[dxvk] Refactor queue submission 2019-06-29 01:53:32 +02:00
Philip Rebohle
545cd52020
[dxvk] Create transfer queue command pool if available 2019-06-29 01:53:32 +02:00
Philip Rebohle
d8163c4446
[dxvk] Don't pass queue handles to DxvkCommandList
Instead, pull them from the device as needed. This coupling would
only make sense if we required one command list per queue family.
2019-06-29 01:53:32 +02:00
Philip Rebohle
d2d11bf995
[dxvk] Add option to enable or disable the transfer queue 2019-06-29 01:53:32 +02:00
Philip Rebohle
191bba660b
[dxvk] Provide way to access queue properties from device 2019-06-29 01:53:32 +02:00
Philip Rebohle
1c39765b86
[dxvk] Rework queue family selection
This allows us to support multiple queues more easily.
2019-06-29 01:53:32 +02:00
Philip Rebohle
110fc8f833
[dxvk] Properly clear used command buffer flags
Fixes an issue where we would always submit the init buffer, even
if it is empty.
2019-06-29 01:53:29 +02:00
Philip Rebohle
770ec2c4db
[dxvk] Get rid of array in present vertex shader 2019-06-29 01:34:16 +02:00
Philip Rebohle
42e61020e4
[d3d11] Remove unused SetRenderTargets method 2019-06-27 15:54:42 +02:00
Philip Rebohle
2148619f3c
[d3d11] Spill render pass when restoring context state as needed 2019-06-27 15:54:42 +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
Joshua Ashton
194db57a4d [spirv] Expose MatrixStride decoration for members 2019-06-27 10:49:49 +02:00
Joshua Ashton
80808d743b [spirv] Add generic memberDecorate 2019-06-27 10:49:49 +02:00
Joshua Ashton
1b8c54eb84 [spirv] Expose opMatrixTimesMatrix, opMatrixTimesVector and opVectorTimesMatrix 2019-06-27 10:49:49 +02:00
Philip Rebohle
afe2b487a6
[dxvk] Avoid redundant vertex and index buffer tracking
Same optimization as for regular resources. Mostly reduces load
on the cleanup thread.
2019-06-27 01:51:15 +02:00
Philip Rebohle
c3ebf4658c
[dxvk] Reorder command list reset operations by importance 2019-06-27 00:02:43 +02:00
Philip Rebohle
7491c06389
[meta] Release 1.2.3 2019-06-26 17:33:57 +02:00
Philip Rebohle
5728d10587
[d3d11] Copy initial texture data to mapped buffer, if available
Otherwise, if an application maps the image right after creating it,
we might end up reading garbage data or overriding the image data.
2019-06-25 14:22:47 +02:00
Philip Rebohle
4d4db6c683
[dxvk] Use void pointers for packImageData
Makes this function a bit less annoying to use.
2019-06-25 14:17:03 +02:00
Philip Rebohle
3293bd21d1
[dxvk] Avoid updating binding mask on hot path in updateShaderResources
Assuming that everything is bound by default allows us to save a few
CPU cycles per descriptor to update as long as that assumption holds
true, while adding only a small constant cost for the update operation.
2019-06-23 23:43:25 +02:00
Philip Rebohle
b7769759f2
[dxvk] Implement comparison and setting multiple bits for DxvkBindingSet 2019-06-23 23:41:56 +02:00
Philip Rebohle
5e3336d79b
[dxvk] Clean up updateShaderResources a bit 2019-06-23 23:21:47 +02:00
Philip Rebohle
81e7a8d1f6
[dxvk] Avoid redundant resource tracking
Only tracks a shader resource if the resource bound to the slot
has actually changed, or if we began recording a new command
buffer. Reduces the number of atomic operations in some games.
2019-06-23 18:55:49 +02:00
Philip Rebohle
924ca9eaec
[dxvk] Add more generic version of DxvkBindingMask 2019-06-23 18:45:34 +02:00
Philip Rebohle
f58242c58d
[dxvk] Fix poor API design around defining resource slots 2019-06-23 15:49:29 +02:00
Andrew Eikum
326eb0bf80 [dxgi] Don't fail leaving fullscreen if window is already destroyed
Unreal Engine 4 games destroy the window, then call
SetFullscreenMode(FALSE). If this call fails, they pop up an error
dialog. Wine tests show that this call should succeed.
2019-06-21 17:27:34 +02:00
Philip Rebohle
62372f5d47
[dxvk] Release staging buffer memory for HUD context
We really don't want to waste 32MB of system RAM because of
one single texture update all the time.
2019-06-21 16:43:22 +02:00
Philip Rebohle
34cdba1df5
[dxvk] Add method to explicitly release staging buffer memory 2019-06-21 16:43:22 +02:00
Philip Rebohle
1c9bc235d0
[dxvk] Remove old staging buffer code 2019-06-21 16:43:22 +02:00
Philip Rebohle
8c1a56af89
[dxvk] Remove old staging buffer allocator from DxvkCommandList 2019-06-21 16:43:22 +02:00
Philip Rebohle
24c282378e
[dxvk] Use new staging buffer allocator in DxvkContext 2019-06-21 16:43:22 +02:00
Philip Rebohle
970deb452e
[dxvk] Implement new staging buffer allocator 2019-06-21 16:43:19 +02:00
Philip Rebohle
a41bd8c4a0
[d3d11] Further optimize constant buffer binding
Saves a few CPU cycles on the more common SetConstantBuffers method,
compared to SetConstantBuffers1.
2019-06-20 22:49:19 +02:00
Philip Rebohle
3141467c37
[d3d11] Template all functions that take ShaderStage as an argument
Basically what D9VK does. Doesn't seem to affect performance, but why not.
2019-06-20 22:09:02 +02:00
Philip Rebohle
138dde6c3d
[dxvk] Prefer VRAM allocation over dedicated sysmem allocation
May in some cases improve performance when under memory pressure:
If a dedicated allocation is preferred, but the alloaction fails,
try to allocate memory from an already allocated chunk instead
of falling back to system memory right away.
2019-06-20 10:34:54 +02:00
Joshua Ashton
a4a4f5a822 [util] Correct return value of SetThreadDescription 2019-06-19 19:43:36 +02:00
Philip Rebohle
0a35ae6fca
[dxvk] Log memory utilization per heap on memory allocation failures 2019-06-19 14:47:09 +02:00
Philip Rebohle
684355dfca
[d3d11] Fix GetData parameter validation
We're supposed to return an error if a null pointer is
passed along with a non-zero DataSize. Fixes more wine
test failures.
2019-06-16 19:24:44 +02:00
Philip Rebohle
43389d8ef4
[d3d11] Implement timestamp disjoint queries 2019-06-16 17:14:39 +02:00
Philip Rebohle
1c718402f8
[d3d11] Use an array for query and event objects
We're going to need multiple queries to implement certain query types.
2019-06-16 17:14:24 +02:00
Philip Rebohle
fd1b5c8eb9
[dxvk] Add method to permanently change image layout 2019-06-15 16:45:59 +02:00
Philip Rebohle
dc3e5e5949
[meta] Release 1.2.2 2019-06-15 12:58:31 +02:00
Philip Rebohle
58dcf77c08
[dxbc] Disable atomic counter optimization on old RADV versions
Breaks TressFX in Tomb Raider 2013 for some reason, whereas this works
fine on 19.1 with both LLVM 8.0 and 9.0-git.
2019-06-15 12:58:31 +02:00
Philip Rebohle
a715937db1
[dxvk] Always pass through fully enabled color write masks
May improve performance when rendering to RGB-only or Alpha-only
images, which seems to be especially common in D3D9.
2019-06-14 14:27:21 +02:00
Philip Rebohle
c8a429b9e1
[d3d11] Fix CheckMultisampleQualityLevels return code
We're supposed to return E_FAIL for unsupported sample counts,
and not zero-initialize the returned quality level count if the
format is invalid. Fixes wine test failures.
2019-06-14 13:37:01 +02:00
Philip Rebohle
5a66da8ef8
[dxvk] Fix various issues in GetFormatSupportFlags
- Support DXGI_FORMAT_UNKNOWN for buffer resources
- Report D3D11_FORMAT_SUPPORT_CPU_LOCKABLE for all supported formats
- Report support for linear-only image formats properly
- Return E_FAIL in case the format is not supported

Fixes a crash in Planet Coaster (#1091).
2019-06-13 16:32:41 +02:00
Joshua Ashton
9d2f31d231 [vulkan] Add operator overloads for VkOffset3D/2D 2019-06-13 04:45:16 +02:00
Philip Rebohle
1bc0b51262
[d3d11] Implement IDXGISurface2 for ID3D11Texture1D 2019-06-13 04:37:35 +02:00
Philip Rebohle
586d0de7bb
[d3d11] Fix default blend factor 2019-06-13 04:15:23 +02:00
Philip Rebohle
089d47e02e
[d3d11] Fix WSize computation for UAV creation 2019-06-13 04:01:15 +02:00
Philip Rebohle
f02a5a7453
[d3d11] Don't create SRVs and UAVs with a size of 0
This is illegal and triggers invalid Vulkan usage.
2019-06-13 03:47:10 +02:00
Philip Rebohle
4ffddd1e40
[d3d11] Skip GenerateMips if mip gen flag is not set on resource 2019-06-13 03:31:31 +02:00
Philip Rebohle
ce03384ba9
[d3d11] Validate bind flags for D3D11_RESOURCE_MISC_GENERATE_MIPS 2019-06-13 03:31:31 +02:00
Philip Rebohle
63d8d9c3db
[d3d11] Validate buffer descriptions 2019-06-13 03:31:26 +02:00
Philip Rebohle
6a76577f15
[d3d11] Fix behaviour with a viewport count of zero 2019-06-13 02:22:07 +02:00
Philip Rebohle
5ff9c33855
[d3d11] Fix incorrect behaviour when a scissor rect is not specified 2019-06-13 02:16:12 +02:00
Philip Rebohle
78071c750d
[d3d11] Fix crash when setting too many viewports 2019-06-13 01:54:55 +02:00
Philip Rebohle
3b1e03f988
[util] Report correct GPU vendor to Far Cry 3, 4 and Blood Dragon
Now that fast clear behaviour has been fixed in RADV, reporting an
Nvidia GPU breaks rendering again since the game expects the clear
behaviour to match that of the Windows D3D11 drivers exactly. To
recap, clear(0.5) on an R8_UNORM render target results in 127 on
Nvidia GPUs and 128 on AMD GPUs.
2019-06-12 12:32:30 +02:00
Philip Rebohle
d5ba36443e
[dxbc] Fix useRawSsbo option
Add some break to fix some breakage.
2019-06-11 20:23:47 +02:00
Philip Rebohle
d755b18ccb
[dxbc] Repurpose useRawSsbo option
Basically, abuse the minSsboAlignment property to convince the
compiler to always/never emit raw SSBOs for raw and structured
buffers, and use the actual device limit by default.
2019-06-11 20:20:40 +02:00
Philip Rebohle
0f7c23c022
[dxbc] Always use raw storage buffers if alignment requirements are met 2019-06-11 20:20:40 +02:00
Philip Rebohle
163e6aaa50
[dxbc] Store alignment for raw and structured buffers 2019-06-11 20:20:40 +02:00
Philip Rebohle
acab2bd8ce
[d3d11] Fix crash in GetMaximumFrameLatency with a nullptr argument 2019-06-11 16:36:43 +02:00
Philip Rebohle
96b9058fbf
[util] Fix COM private data bug when passing NULL interface
Fixes test failure in wine's DXGI tests.
2019-06-11 16:08:28 +02:00
Philip Rebohle
6d999fad89
[dxgi] Fix some issues introduced with FilterModesByDesc cleanup 2019-06-11 15:45:32 +02:00
Andrew Eikum
cd6e3ffe75
[dxgi] Return non-exact matches from FindClosestMatchingMode1 2019-06-11 02:29:25 +02:00
Philip Rebohle
3dbccb1b61 [dxvk] Revert buffer re-binding optimization
While this optimization can significantly reduce CPU overhead, this
breaks World of Warcraft for some reason. Fixes #1086.
2019-06-06 17:22:17 +02:00
Philip Rebohle
3de87b41a0 [dxvk] Add likely/unlikely around critical CS chunk append code 2019-06-05 22:57:51 +02:00
Philip Rebohle
461a2bec36 [dxvk] Only update buffer object in buffer slices if necessary
Saves CPU cycles when rebinding the same vertex, index and
constant buffers with different offsets.
2019-06-05 20:32:12 +02:00
Philip Rebohle
7e66dc61b9 [d3d11] Avoid buffer ref count changes when only changing offsets
Saves a few CPU cycles in the somewhat common situation where the
currently bound vertex, index or constant buffer is re-bound with
a different offset.
2019-06-04 17:53:54 +02:00
Philip Rebohle
f501ebce97 [dxvk] Avoid redundant descriptor set updates when binding buffers
Reduces unnecessary overhead when binding a different range of the
same buffer, e.g. through D3D11 VSSetConstantBuffers1.
2019-06-03 20:17:15 +02:00
Philip Rebohle
e4e82007b1 [d3d11] Fix inconsistencies in Map/Unmap on immediate/deferred contexts
Should save a few CPU cycles, and also fixes incorrect behaviour when an
application passes null pointers to Map on a deferred context.
2019-06-03 15:31:13 +02:00
Philip Rebohle
58d838b915 [d3d11] Avoid emitting redundant vertex and index buffer updates 2019-06-03 00:18:54 +02:00
Philip Rebohle
19adccea8f [util] Add unlikely() around COM ref counting code
Improves code generation for the common case.
2019-06-02 23:34:53 +02:00
Philip Rebohle
818704d413 [d3d11] Add some likely/unlikely around CS flushes 2019-06-02 20:29:22 +02:00
Philip Rebohle
6cbd611190 [d3d11] Don't clear DSV aspects that are marked as read-only
Saint's Row 4 appears to be doing this. Ref #24.
2019-06-02 16:34:50 +02:00
Philip Rebohle
c59a8e6e48 [d3d11] Initialize depth images to zero rather than one
Matches Windows behaviour.
2019-06-02 16:33:54 +02:00
Philip Rebohle
40d4922682 [d3d11] Fix initial swap chain image count
Reported-by: Joshua Ashton <joshua@froggi.es>
2019-06-02 15:00:15 +02:00
Philip Rebohle
42c9fad017 [dxvk] Fix binding indices for vertex attribute divisor
Also, only emit a divisor description if the divisor isn't 1.
2019-06-02 10:59:34 +02:00
Philip Rebohle
7d91ff06a3 [util] Fix return value of AddRef
We're supposed to return the new ref count, not the old one.
2019-06-01 22:12:32 +02:00
Philip Rebohle
1e0fe36cae
[d3d11] Respect COPY_FLAG_NO_OVERWRITE when updating constant buffers
Heavy Rain uses this to update constan buffers on deferred contexts.
2019-05-25 14:42:32 +02:00
Philip Rebohle
754cf6da30
[d3d11] Validate subresource index in MapImage
Fixes crashes when passing an invalid subresource index.
2019-05-20 19:27:27 +02:00
Philip Rebohle
3168626f4b
[d3d11] Support mapping multiple image subresources at the same time
Fixes #1066.
2019-05-20 19:27:11 +02:00
Philip Rebohle
a82dbf6200
[dxvk] Add new helper function to compute mip level extent
We're going to need this outside the DxvkImage class as well.
2019-05-20 14:27:00 +02:00
Philip Rebohle
cdc5e93dac
[meta] Release 1.2.1 2019-05-19 14:43:33 +02:00
Philip Rebohle
9004fde78d
[d3d11] Remove useless 'virtual' keyword 2019-05-19 14:38:48 +02:00
Philip Rebohle
e1610f81dc
Revert "[d3d11] Use STDMETHODCALLTYPE for private virtual method"
For some reason, this produces broken binaries for some Gentoo
users. Fixes #1067.

This reverts commit e5fa55cbb5.
2019-05-19 13:22:04 +02:00
Robin
6a4fafba3d
[util] Enable D3D11_MAP_FLAG_DO_NOT_WAIT for The Surge 2019-05-17 12:56:57 +02:00
Philip Rebohle
8e9e7963a2
[d3d11] Update mapped buffers of staging textures immediately
Improves performance in Lords of the Fallen and The Surge.
Closes #1049.

Co-authored-by: Robin <robin.kertels@outlook.com>
2019-05-17 12:44:36 +02:00
Philip Rebohle
905f3fe520
[util] Spoof Nvidia GPUs for Mirror's Edge Catalyst
Closes #1062.
2019-05-17 11:40:35 +02:00
Philip Rebohle
e5fa55cbb5
[d3d11] Use STDMETHODCALLTYPE for private virtual method
Improves code generation on some compilers.
2019-05-15 22:01:19 +02:00
pchome
32e1afc7a1 [build] Add options to disable dxgi/d3d* build 2019-05-15 21:44:39 +02:00
Philip Rebohle
293551dc8d
[d3d10] Fix winelib build
There's no IID_PPV_ARGS on wine.
2019-05-15 21:42:42 +02:00
Philip Rebohle
7d9a75c82c
[dxbc] Use subgroup operations for atomic append/consume operations
Reduces the number of atomic operations performed per subgroup to 1.
2019-05-15 19:32:27 +02:00
Philip Rebohle
dfa3caa946
[spirv] Add OpUndef and more subgroup instructions 2019-05-15 19:31:43 +02:00
Philip Rebohle
d94d89c3ef
[dxbc] Add option to use subgroup ops for atomic counter operations
This can greatly reduce the number of atomic operations when using
append/consume buffers.
2019-05-15 18:49:02 +02:00
Philip Rebohle
78ab26347d
[d3d10] Add static method implementing D3D10CreateDeviceAndSwapChain1
Same as the D3D11 change to make ReShade happy.
2019-05-15 17:18:05 +02:00
Philip Rebohle
8cae607db0
[d3d11] Add static method implementing D3D11CreateDeviceAndSwapChain
ReShade requires this as it hooks both D3D11CreateDevice and *AndSwapChain,
which means that we can't call D3D11CreateDevice without entering infinite
recursion. Fixes #1057.

Suggested-by: Riesi <riesi@opentrash.com>
2019-05-15 16:46:48 +02:00
Philip Rebohle
192310d481
[util] Don't use if constexpr
Fixes compilation on GCC 6.3.
2019-05-15 03:18:23 +02:00
Philip Rebohle
b3f61936d2
[dxvk] Don't align pushg constant data to 64 bytes
Causes binaries compiled with GCC 6.3 to crash on device creation.
2019-05-15 03:07:05 +02:00
Philip Rebohle
9c93ca451d
[dxvk] Apply view swizzles to image clears
Fixes tone mapping in Yakuza Kiwami 2, which uses an A8_UNORM
render target and clears the alpha component to 1.
2019-05-14 21:21:29 +02:00
Philip Rebohle
0b61901424
[dxvk] Add method to swizzle clear color values 2019-05-14 21:21:14 +02:00
Philip Rebohle
3efec8960c
[dxvk] Pass clear value to clearRenderTarget by value 2019-05-14 21:19:56 +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
61b97e5dd1
[util] Add support for private references in Com<...> wrapper 2019-05-14 15:20:27 +02:00
Philip Rebohle
54d3103b04
[util] Fix COM reference count type
On Windows, ref counts are only 32 bits wide.
2019-05-14 14:48:42 +02:00
Philip Rebohle
26602b296f
[meta] Release 1.2 2019-05-13 20:40:11 +02:00
Entryhazard
8c2709a1c6 Changed visibility of the winelib build to behave more like MinGW 2019-05-13 20:37:57 +02:00
Philip Rebohle
7d6f78182b
[dxvk] Don't use ALL_COMMANDS_BIT to notify events 2019-05-09 18:07:49 +02:00
Philip Rebohle
2c45eb79c4
[dxvk] Increase number of queued command buffers to 12
Might help avoid stalls in some edge cases.
2019-05-09 18:07:38 +02:00
Philip Rebohle
a54548dae9
[d3d11] Flush more aggressively when CPU bound
Submitting GPU work early is especially important if there is
a CPU<>GPU synchronization point somewhere.
2019-05-09 18:04:36 +02:00
Philip Rebohle
45be1dfb53
[d3d11] Flush more aggressively on stalling Event queries
Increases GPU utilization in Quake Champions.
2019-05-09 18:04:36 +02:00
Philip Rebohle
af45f810b2
[dxvk] Change flushing behaviour of immediate context methods
Should fix some inappropriate flushing, while flushing more
aggressively on render target changes.

We still keep the flush on UpdateSubresource since some games
use it to update large quantities of data.
2019-05-09 18:04:36 +02:00
Philip Rebohle
dcd75a4f09
[util] Optimize popcnt operation 2019-05-09 18:04:33 +02:00
Philip Rebohle
a1feaa6748
[dxvk] Add aspect mask parameter to clearImageView 2019-05-09 09:10:06 +02:00
Philip Rebohle
1fb8b5ec69
[dxvk] Begin render pass in clearImageViewFb if necessary
Otherwise, we might end up calling vkCmdClearAttachments outside
a render pass instance, which is invalid.
2019-05-09 09:09:11 +02:00
Philip Rebohle
0d40c20aef
[dxvk] Compact vertex buffer bindings
This way, we can always update all vertex buffer bindings with one
single API call, without having to deal with any gaps in binding IDs.

The previous optimization triggers a bug in some drivers when no
vertex buffer is ever bound to a given binding point, and may also
trigger inefficient behaviour if the binding range is assumed to
be contiguous.
2019-05-08 03:37:49 +02:00