The stuttering is caused by Vulkan pipeline creation, and Vulkan pipelines are already being cached. The DXBC->SPIR-V translation is done in the D3D11Device::Create*Shader methods, and the application is responsible for getting those right (many games just compile all shaders right at the start, or when loading a level).
The way D3D11 is designed, there is no way for DXVK to tell which shaders are going to be used together in advance, so Vulkan pipelines have to be compiled at draw time. There's basically no room for further optimization.
Maybe take a look at https://dev.wine-staging.com/patches/204/? Obviously OpenGL and Vulkan are different, but maybe something similar could be implemented in DXVK?
No, because the problem is entirely different.
Sometimes it is necessary to provide additional information in GLSL shaders that are only known when the shader is used for the first time and which are not required for HLSL shaders
This just doesn't happen in DXVK, so there's nothing to improve on that front. On the other hand, Wine doesn't have to deal with Vulkan pipelines.
@doitsujin :.. and Vulkan pipelines are already being cached.. Thanks for the info. Are they also saved to disk to be reusable again after restarting ?
Not yet, but in practice, at least RADV already does this so it's relatively low on my TODO list.
thx, not sure how the nvidia driver handles that, will ask at their forum.
I guess "something similar" exist in Dolphin emulator:
I don't see the point. Creating an already cached pipeline takes only a few microseconds on Nvidia, and it only takes a few microseconds on RADV. I already tested that. So even in the most extreme case, we'd gain something in the order of 1-2 milliseconds in one single frame, i.e. when the game renders a scene for the very first time.
Also, you need to understand that a pipeline cache doesn't solve anything if the pipeline in quesion is not cached. And when you run a game for the first time, the pipeline cache for that game is completely empty.
Getting the initial compile time down would of course be nice, and in theory it is possible to optimize that by creating an unoptimized pipeline first (RadeonSI does something similar internally), but as of now, no driver actually implements the required functionality.
Nothing extracted yet.
With dxvk there is noticeably more stuttering going on than with wined3d, and it can be related to shaders compilation (see some background on this here at least in the context of wined3d). Can anything be done to cache these?