Commit Graph

2289 Commits

Author SHA1 Message Date
Philip Rebohle 4cc35da3b2 [d3d11] Allocate one additional swap chain image
DXGI's BufferCount apparently only counts back buffers,
while there's an implicit front buffer.
2019-04-23 20:12:29 +02:00
Philip Rebohle 2245aada03
[dxvk] Use stricter barriers around meta operations
Fixes some rendering issues on AMDVLK in some situations.
2019-04-19 11:41:12 +02:00
Philip Rebohle 95bfac84f1
[dxvk] Support image sub-regions for resolve operations
Required for legacy graphics APIs.
2019-04-19 11:41:12 +02:00
Joshua Ashton a3966b442b [dxvk] Add adapterCount function to DXVKInstance.
Will be needed in the Direct3D9 interface as you can query the number of adapters.
2019-04-18 23:18:15 +02:00
Joshua Ashton 0c34fae9c7 [spirv] Implement constvec3f32 2019-04-18 23:18:02 +02:00
Joshua Ashton a770c73dbc [spirv] Implement opVectorTimesScalar 2019-04-18 23:18:02 +02:00
Joshua Ashton f1a8e02e0f [spirv] Implement opPow 2019-04-18 23:18:02 +02:00
Philip Rebohle 94beec0c13
[dxvk] Fix subresources in barriers for 2D views of 3D images
The array layers passed during framebuffer creation are the selected
3D slices in this case, the image actually only has one array layer.
We should account for that when recording barriers.
2019-04-18 12:08:27 +02:00
Philip Rebohle b44cad4d32
[dxbc] Replace computeResourceSlotId by light-weight alternatives
Slightly reduces overhead of D3D11 binding methods.
2019-04-18 10:06:15 +02:00
Philip Rebohle 044e3967e7
[hud] Show compiler activity indicator for at least one second
Otherwise this would flicker when shaders are already cached.
2019-04-15 12:42:07 +02:00
Philip Rebohle 35a2a02714
[dxbc] Do not emit GS system values if rasterization is disabled
Fixes issue in Star Citizen, which declares a max output vertex count
of 128 in a geometry shader which emits eight components per vertex,
which becomes 12 components in DXVK due to the gl_Position builtin.
This should keep us below the magic limit of 1024 output components.
2019-04-15 09:00:46 +02:00
Philip Rebohle f9e56c97cf
[d3d11] Fix hasing of geometry shaders with stream output
The xfb struct contains pointers, but we should hash the
strings instead, otherwise the hash changes between runs.
2019-04-15 03:48:31 +02:00
Philip Rebohle ca717eeb62
[d3d11] Track query state correctly
Not sure if any game actually needs this, but we should avoid
sending bogus commands to the backend when the app sends bogus
commands to us.
2019-04-14 16:27:15 +02:00
Philip Rebohle 364ae7270d
[d3d11] Don't allocate predicate for unsupported predicates 2019-04-14 14:26:56 +02:00
Philip Rebohle 7dc449ac55
[hud] Add new HUD entry to show shader compiler activity 2019-04-14 13:28:57 +02:00
Philip Rebohle 8b84d002f8
[hud] Pass surface size to HUD renderer 2019-04-14 13:28:57 +02:00
Philip Rebohle bb01318984
[dxvk] Add stat counter for shader compiler activity 2019-04-14 13:28:57 +02:00
Jens Peters 522fa8d777 [meta] Update README with 'api' option for the HUD 2019-04-13 08:57:23 +02:00
Philip Rebohle 2c0ddbd072
[util] Enable D3D11_MAP_FLAG_DO_NOT_WAIT for Anno 1800
Removes a sync point and almost doubles performance as a result.
2019-04-12 10:52:25 +02:00
Robin fd9a938c7e [build] Fix MSVC build with version info 2019-04-08 10:14:57 +02:00
Philip Rebohle adc447cc9f
[dxvk] Increase query pool sizes
Many games create a very large number of occlusion queries, and
we shouldn't create more pools than necessary.
2019-04-08 01:51:38 +02:00
Philip Rebohle 7018db3614
[dxvk] Implement shader-based resolve
Resolve attachments are currently too broken on most drivers,
so we cannot really rely on them.
2019-04-07 21:07:25 +02:00
Philip Rebohle ea5dcd5b14
[dxvk] Re-implement class to create meta-resolve objects
This time with specialization constants so that we don't have
to read the tetxure's sample count from the descriptor.
2019-04-07 21:07:25 +02:00
Philip Rebohle addbae585f
[dxvk] Enable VK_AMD_shader_fragment_mask if available 2019-04-07 21:07:25 +02:00
Philip Rebohle 14593baebd
[dxvk] Add new resolve shaders 2019-04-07 21:07:21 +02:00
Philip Rebohle 56300ff9b7
[d3d11] Allocate mapped buffers for staging images on cached memory
These will most likely be used for reading, so we should put them
on a memory type which allows reading.
2019-04-07 14:47:43 +02:00
Philip Rebohle 51f229530b
Revert "[d3d11] Select memory type based on CPU access flags"
This reverts commit 6c8042033e.

Batman: Arkham City doesn't set the CPU access flags correctly
for some images it maps for reading, and breaks on Nvidia as a
result.
2019-04-07 14:42:01 +02:00
Philip Rebohle 1da7b1e87c
Revert "[meta] Release 1.1"
This reverts commit a696f69ec2.
2019-04-07 10:13:18 +02:00
Philip Rebohle e901d9d149
[dxgi] Fix broken gamma with combined image samplers
Fixes #1003.
2019-04-07 09:55:54 +02:00
Philip Rebohle a696f69ec2
[meta] Release 1.1 2019-04-06 16:26:21 +02:00
Philip Rebohle f6bdb7bb63
[dxvk] Fix circular reference between DxvkDevice and DxvkGpuQueryPool 2019-04-06 12:31:20 +02:00
pchome 3eb9f35fc3 [build] Use `generator` to produce resource files 2019-04-06 11:33:45 +02:00
pchome 67446eda47 [build] Fix winelib `wrc` 2019-04-06 11:33:45 +02:00
Philip Rebohle aa45b3cc31
[dxvk] Fix build failure for some people
Why am I the only one who never has any issues with this?
2019-04-06 10:10:29 +02:00
Sveinar Søpler 4f9dd8d3d0
[build] Add version info to compiled DLLs
Fixes #980.
2019-04-05 21:09:57 +02:00
Philip Rebohle b89646584b
[util] Enable constant buffer range check for Dark Souls Remastered ans Grim Dawn 2019-04-05 20:56:32 +02:00
Philip Rebohle 5819a69302
[d3d11] Add option to enable constant buffer range checks 2019-04-05 20:56:32 +02:00
Philip Rebohle 9b99c55a2e
[dxbc] Implement optional constant buffer range check 2019-04-05 20:56:29 +02:00
Philip Rebohle b9bfbb9ccc
[dxvk] Fix move constructor of DxvkShaderModule 2019-04-04 16:10:44 +02:00
Philip Rebohle da4baefdf0
[spirv] Fix initial allocation size for compressed buffer
The old initial size was still for uint8.
2019-04-04 13:15:59 +02:00
Philip Rebohle ac3cd0b688
[dxvk] Store compressed shader modules in DxvkShader
Reduces the amount of memory used to store shaders to
around ~45%-50% of the original size.
2019-04-04 13:00:31 +02:00
Philip Rebohle f49863f321
[dxvk] Store enabled SPIR-V capabilities explicitly 2019-04-04 13:00:31 +02:00
Philip Rebohle f32200b668
[spirv] Implement in-memory compression for shader modules 2019-04-04 13:00:31 +02:00
Philip Rebohle d2395180af
[util] Add helpers to pack/unpack data to/from larger units 2019-04-04 13:00:31 +02:00
Liam Middlebrook 9d26031dcb [dxvk] Zero-Initialize SpecConstantData
Ensure that specialization constant data passed into the driver is
zero-initialized.

Having the pData field in VkSpecializationInfo be zero-initialized helps
to create more deterministic input to the driver, which is particularly
useful when debugging shader issues.
2019-04-03 23:21:12 +02:00
Philip Rebohle cd93ba570e
[dxvk] Simplify DxvkShaderModule
This is merely a wrapper for a VkShaderModule now, so it really
doesn't need anything fancy and definitely doesn't need to be
heap-allocated.
2019-04-03 20:47:58 +02:00
Philip Rebohle 2bd09e52e7
[dxvk] Don't cache shader modules for graphics pipelines
We're only ever going to need those when actually compiling a new
pipeline, so on average we're just wasting large amounts of memory
by keeping them around.

Trades several hundred MB of memory for a small increase in compile
times. Creating shader modules is typically very cheap.
2019-04-03 20:01:36 +02:00
Philip Rebohle 79e867624a
[dxvk] Don't cache shader modules for compute pipelines 2019-04-03 19:46:28 +02:00
Philip Rebohle 632b254714
[d3d11] Use combined image sampler descriptors for the presenter 2019-04-03 17:40:05 +02:00
Philip Rebohle 257c19ed0a
[hud] Use combined image s1ampler for the font texture 2019-04-03 17:40:05 +02:00