[d3d9] Fix crash if device is freed with bound textures

This commit is contained in:
Alpyne 2023-05-07 21:49:23 -07:00 committed by Joshie
parent bef2ef69ab
commit 2b09932d51
1 changed files with 4 additions and 2 deletions

View File

@ -1358,8 +1358,6 @@ namespace dxvk {
std::atomic<int64_t> m_availableMemory = { 0 };
std::atomic<int32_t> m_samplerCount = { 0 };
Direct3DState9 m_state;
D3D9DeviceLostState m_deviceLostState = D3D9DeviceLostState::Ok;
HWND m_fullscreenWindow = NULL;
@ -1367,6 +1365,10 @@ namespace dxvk {
lru_list<D3D9CommonTexture*> m_mappedTextures;
#endif
// m_state should be declared last (i.e. freed first), because it
// references objects that can call back into the device when freed.
Direct3DState9 m_state;
D3D9VkInteropDevice m_d3d9Interop;
};