Commit Graph

2324 Commits

Author SHA1 Message Date
Philip Rebohle c3f7dfd197
[dxvk] Use new specialization constant code for compute pipelines 2019-05-01 01:57:34 +02:00
Philip Rebohle 433c707888
[dxvk] Add new structure to generate specialization constant info
We should avoid passing redundant and unused data to the driver, as
that may interfere with caching. It also adds a lot of unnecessary
data to traces.
2019-05-01 01:57:34 +02:00
Philip Rebohle 0a77ebbeaf
[dxgi] Change default of s_gamma_bound to true
In the future, we'll assume true and only pass the spec constant
value to the driver if their value is actually different from the
default, but this requires reliable defaults.
2019-05-01 01:57:34 +02:00
Philip Rebohle 04e6479690
[dxbc] Remove old spec constant code 2019-05-01 01:57:34 +02:00
Philip Rebohle dc3cfc9fa0
[dxbc] Use new spec constant API for rasterizer sample count 2019-05-01 01:57:34 +02:00
Philip Rebohle 7111af423d
[dxbc] Add new emitNewSpecConstant method
Convenience method to declare new specialization constants.
2019-05-01 01:57:34 +02:00
Philip Rebohle a340b3101c
[d3d11] Add missing interface queries for IDXGIObject and IDXGIDeviceSubObject 2019-05-01 01:54:00 +02:00
Eero Kelly b92dc14c4d [util] Enable constant buffer range check for NieR:Automata
This fixes a graphical corruption issue where Operator 6O's portrait
displays as a large flashing circle due to uninitialized buffer reads.

Fixes issue: https://github.com/ValveSoftware/Proton/issues/1543

Reviewed-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
2019-04-30 16:08:52 +02:00
Philip Rebohle dc52212873
[dxbc] Disable Constant Buffer Range Check on AMD
The hardware already behaves as intended, no need to waste GPÜ cycles.
2019-04-30 16:07:24 +02:00
Philip Rebohle 3b1e753bb5
[dxvk] Re-implement early discard with quad granularity
May perform better on some hardware in situations where we cannot
discard a full subgroup. Closes #753.
2019-04-30 14:46:03 +02:00
Danylo Piliaiev 4dd68987d6 [d3d11] Check if uav's counter slice is defined in CopyStructureCount
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
2019-04-30 12:34:27 +02:00
Danylo Piliaiev 261d31cac6 [dxbc] Fix xfb passthrough for system values
vReg should be always allocated for system values which is
necessary for emitXfbOutputSetup and is already done for
hull shader passthrough.

Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
2019-04-30 12:19:21 +02:00
Philip Rebohle 2afe5ec141 [d3d11] Clean up rasterizer state initialization
The error messages are pointless since all of this is already
handled in NormalizeDesc.
2019-04-29 16:22:42 +02:00
Philip Rebohle 06c144f075 [dxbc] Store sample positions as vec2 array
We can append the zeroes in shader code instead. May
improve generated code on drivers that use scratch
memory or temporary uniform buffers for large arrays.
2019-04-29 14:04:42 +02:00
Philip Rebohle 8f5338b1d1 [spirv] Add constvec2f32 helper
We should probably replace this with a proper template at some point.
2019-04-29 13:47:15 +02:00
Philip Rebohle b14ad7b30c [dxbc] Remove some old TODOs
This is already implemented properly.
2019-04-29 11:48:09 +02:00
Philip Rebohle 04152055b7 [dxbc] Correctly report a sample count of 0 for unbound images 2019-04-29 11:48:09 +02:00
Philip Rebohle a3e0157ab0 [dxbc] Correctly report a size of 0 for unbound images 2019-04-29 11:48:09 +02:00
Philip Rebohle 18cbaefdcb [dxbc] Correctly report a size of 0 for unbound buffers 2019-04-29 11:48:09 +02:00
Philip Rebohle ad5da34c57 [dxbc] Fix typo in sample positions 2019-04-29 11:48:09 +02:00
Philip Rebohle 2c61303976 [d3d11] Implement IDXGIResource1 for textures and buffers 2019-04-27 20:21:54 +02:00
Philip Rebohle 54592b7852 [d3d11] Add basic implementation of IDXGIResource1
We don't support resource sharing and subresource surfaces
yet, but the interface should at least be present.
2019-04-27 20:21:47 +02:00
Philip Rebohle b7a5f11121 [dxgi] Add missing DXGI_CPU_ACCESS_* defines 2019-04-27 19:13:34 +02:00
Philip Rebohle ac79f69a10 [d3d11] Pass texture as D3D11Resource to DXGI interop objects 2019-04-27 16:25:55 +02:00
Philip Rebohle d1a019a043 [d3d11] Implement Map / Unmap for IDXGISurface2 2019-04-27 16:17:50 +02:00
Philip Rebohle af15aa0c32 [d3d11] Implement IDXGISurface2 for compatible 2D textures
Required by SpellForce 3. Fixes #1031.
2019-04-27 15:35:20 +02:00
Philip Rebohle 8203777078 [meta] Add default dxvk.conf
Fixes #1020.
2019-04-26 19:48:46 +02:00
Philip Rebohle ed0719432d [dxvk] Add support for per-app configuration
Feature request by Alexandr Oleynikov (@tannisroot).
2019-04-26 19:17:32 +02:00
Philip Rebohle e2ebfa9012 [dxvk] Add some 'unlikely' statements 2019-04-26 17:52:53 +02:00
Philip Rebohle 9f264ba008 [d3d11] Remove predication workaround for RADV
This no longer has any effect due to changes in the driver, and
we no longer support Predication anyway.
2019-04-25 18:29:13 +02:00
Joshua Ashton 60827c1b22 [d3d11] Improve CreatePredicate logging 2019-04-25 13:14:23 +02:00
Philip Rebohle 4eff83bdee [d3d11] Disable Predication support
Doesn't work at all in the few games that use it.
2019-04-25 11:55:40 +02:00
Philip Rebohle cd63cebc63 [dxvk] Simplify validateGraphicsState 2019-04-24 23:16:52 +02:00
Philip Rebohle 981ea547f9 [d3d11] Don't use presentation fence 2019-04-23 20:14:34 +02:00
Philip Rebohle 81f6ccb1be [d3d11] Select sync event based on back buffer count
May improve frame pacing in some games.
2019-04-23 20:14:30 +02:00
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