Part 1 of 4 of a much needed refactor. Instead of translating
the structures in the D3D11Device class, we'll move the code
to the respective view classes in order to clean up.
We don't suppor this for images, and we don't support DiscardView yet.
Buffers can be invalidated, which may in some cases be beneficial in
order to avoid synchronization on the GPU.
In addition to moving the code to a separate class, this also
improves flushing behaviour by limiting the amount of memory
being initialized rather than the number of commands executed.
* [build] do not use shared_library/objects property with MSVC
* [util] use ./com/com_include.h instead of windef.h
It is required for Windows 10 SDK.
* [util] store thread procedure lambda in std::function
* [dxgi] fix annoying MSVC warning
warning C4099: 'IDXGIVkInteropDevice': type name first seen using 'class' now seen using 'struct'
In my winelib builds, I get unresolved dxvk::D3D11ImmediateContext::MinFlushIntervalUs symbol. I'm not sure why it doesn't inline this constexpr, but it doesn't seem useful to expose that in header anyway.
Wine needs to setup each thread that has an access to Windows APIs. It means that in winelib builds, we can't let standard C++ library create threads and need to use Wine for that instead. I wrote a thin wrapper around Windows thread functions so that the rest of code just has to use new dxvk::thread class instead of std::thread.
In some situations, calling Flush without any commands that
could be flushed would unnecessarily prevent the implicit
flush heuristic from kicking in properly.
We're going to flush more often in CPU-limited scenarios, but these
new values are reasonable especially in games which submit large
amounts of GPU work at once, and should help reduce rendering latency.
Improves GPU utilization and frame rates in Hellblade by up to 10%.
The DXGI format info only stores the aspect mask for views created
with that format, but we're dealing with a raw resource here so we
have to query the aspect mask from the Vulkan format in question.
Fixes validation errors with typeless resolve if the formats of
the two involved images are identical.
There are several scenarios when flushing can have
a significant negative impact on performance:
1. When the query result is already available
2. When the game scatters GetData calls when rendering
Frostpunk hits both issues at the same time, which led to
over 120 queue submissions per frame. This patch reduces
that to 3 submissions per frame when the game is GPU-bound.
There currently doesn't seem to be a game which actually renders
to images with linear tiling, but we should handle this anyway.
Only the GENERAL layout is allowed if the tiling is not OPTIMAL.
Spilling the render pass should make shader storage buffer/image writes
visible due to how external subpass dependencies are defined. For UAV
rendering, we need to do this when changing the UAVs, even if the render
targets themselves do not change.
DXVK does not support device-specific counters, which seem to
be useful only for GPU profiling during development, but we
should report this properly to the application.