protonscr

Feature: possibility to inject VK natively within DX app

dxvkclosed
doitsujin/dxvk#3230 · opened 2023-01-31 by pixeljetstream · updated 2023-03-21 · 5 comments · github
Ppixeljetstream 2023-01-31 github

Hi.

Sorry if this has been asked before, but with the trend of modernizing older engines through modding, would it be possible to have some level of native injection of Vulkan commands. Say an app is using dx9 foremost but wanted to leverage some Vulkan directly. Could it link to dxvk and access it directly to insert custom VK shaders for say post processing. Mixing dx9 with VK essentially. Is that a use-case that came up before?

Mmbriar 2023-01-31 github

This is pretty much how Portal RTX works.

KK0bin maintainer 2023-01-31 github

It's certainly doable but until someone approaches us with a proper use case for this, it's not worth spending any time on it.

Ddoitsujin maintainer 2023-01-31 github

Doing this is possible in theory - we already sort of allow this for D3D11 - but it's guaranteed to be detrimental for performance since we have to essentially wait for the worker thread to finish, flush all sorts of resource states, do a GPU submission, and only then we can safely hand a bunch of Vulkan interfaces to your D3D9 app.

It's better to just fork the project and add the functionality you need specifically for your application as an extension interface to IDirect3DDevice9 in such a way that it interacts with the back-end properly. I know for a fact that people have added compute shader support for D3D9 this way.

We also don't really have good ways right now to create a D3D device from an existing Vulkan device or anything, DXVK wasn't really built with that in mind at all.

Ppixeljetstream 2023-02-19 github

Thank you @doitsujin forking indeed sounds like the best choice then

KK0bin maintainer 2023-03-21 github

I'll close this as I think the question has been answered. If you have any more questions just reopen or open a new issue.

Nothing extracted yet.