Seems to be anything up to 3x as fast to decode than the previous code,
with the compression ratio being slightly worse. Encoding seems faster
as well.
The game tries to binda 2D texture to a slot that is declared
as a 3D texture in the shader. This causes one particle effect
to be completely black because DXVK does not bind the texture
Before we just assumed that the calls here would match the corresponding flag value (D3D11_RESOURCE_MISC_SHARED -> ::GetSharedHandle, D3D11_RESOURCE_MISC_SHARED_NTHANDLE -> ::CreateSharedHandle), but it turns out that its possible to set both flags and use both methods. Now we always tell Vulkan to export a KMT handle if D3D11_RESOURCE_MISC_SHARED is present, and use openKmtHandle to get an NT handle when needed.
Rationale is as follows:
- srcAccess never needs to contain read flags, since any memory being
read must have been made visible before by a write operation
- dstAccess is only relevant if srcAccess contains a write, because
reads alone cannot modify memory and thus do not require making the
same memory available again. An exception are layout transitions.
Doesn't really change performance in anything as far as I can tell, but
we avoid some unnecessary UBO cache flushes in compute-heavy scenarios.
Fixes random flicker in God of War. Since patch 1.0.9, the game's lighting
system relies on MAP_DISCARD returning a zero-initialized memory slices for
its constant buffers, or some lights would get skipped in various compute
passes. Changing the memset to e.g. write 0xFF instead of 0 shows this issue.
Some apps try use the D3DPERF_ functions for debug markers/annotations.
This utilizes the DXVK_RegisterAnnotation hidden functions to share the interfaces.
Co-authored-by: Oleg Kuznetsov <okouznetsov@nvidia.com>
Previously we'd set too many bits by accident here. Also, we should
not modify partial write masks to include unnecessary bits. Only do
this if we can actually promote to a full write mask for consistency.
Add a new environment variable DXVK_ENABLE_NVAPI as an environment-level
override for 'nvapiHack'. This will allow for DLSS (and other
NvAPI-backed features) to be available without the user manually writing
a configuration file, allowing for more seamless integration with
Proton's launch script.