AlpyneDreams / d8vk

Direct3D 8 to Vulkan translation for DXVK! Merged into dxvk: https://github.com/doitsujin/dxvk
zlib License
486 stars 6 forks source link

Properly handle device reset (& DEVICENOTRESET) #168

Closed WinterSnowfall closed 1 year ago

WinterSnowfall commented 1 year ago

Something to keep in mind for the next rebase.

I've checked the documentation on the topic and it looks like d3d8 is pretty much in line with how d3d9 handles it (or the reverse, if you want to be historically accurate).

The good news is that upstream d3d9 should do most of the work for us now (thanks to @K0bin) and I believe it's just a matter of piping through calls to TestCooperativeLevel() to get the right behavior in place in d3d8 as well, but we'll have to test and see.

I'm not aware of any d3d8 games explicitly needing this, though there are some issues we have yet to determine the cause of, so I wouldn't be too surprised if it did solve some overall weirdness.

Also wrote a short test to confirm that even in d3d8 a call to Reset() will fail if the application hasn't released all the D3DPOOL_DEFAULT resources tied to the device. WineD3D seems to enforce it.

WinterSnowfall commented 1 year ago

Also commenting on my findings here: the bridge uses an extended d3d9 device, which messes up the new Reset() logic. We want it to act as a regular device in this case, basically.

P.S.: The intended behavior might also be thrown off by MANAGED buffer placement, as the validation is done against DEFAULT resources. We may need to think a bit on that one as well...

AlpyneDreams commented 1 year ago

We now use a regular d3d9 device.