diff --git a/src/dxvk/dxvk_device.cpp b/src/dxvk/dxvk_device.cpp index 2c476547..3efd383e 100644 --- a/src/dxvk/dxvk_device.cpp +++ b/src/dxvk/dxvk_device.cpp @@ -23,12 +23,9 @@ namespace dxvk { DxvkDevice::~DxvkDevice() { - m_renderPassPool = nullptr; - m_pipelineManager = nullptr; - m_memory = nullptr; - + // Wait for all pending Vulkan commands to be + // executed before we destroy any resources. m_vkd->vkDeviceWaitIdle(m_vkd->device()); - m_vkd->vkDestroyDevice(m_vkd->device(), nullptr); } diff --git a/src/dxvk/dxvk_instance.cpp b/src/dxvk/dxvk_instance.cpp index a87d5d16..98c73b4c 100644 --- a/src/dxvk/dxvk_instance.cpp +++ b/src/dxvk/dxvk_instance.cpp @@ -10,8 +10,7 @@ namespace dxvk { DxvkInstance::~DxvkInstance() { - m_vki->vkDestroyInstance( - m_vki->instance(), nullptr); + } diff --git a/src/dxvk/vulkan/dxvk_vulkan_loader.cpp b/src/dxvk/vulkan/dxvk_vulkan_loader.cpp index 79110a08..70df7aa4 100644 --- a/src/dxvk/vulkan/dxvk_vulkan_loader.cpp +++ b/src/dxvk/vulkan/dxvk_vulkan_loader.cpp @@ -33,11 +33,15 @@ namespace dxvk::vk { InstanceFn::InstanceFn(VkInstance instance) : InstanceLoader(instance) { } - InstanceFn::~InstanceFn() { } + InstanceFn::~InstanceFn() { + this->vkDestroyInstance(m_instance, nullptr); + } DeviceFn::DeviceFn(VkInstance instance, VkDevice device) : DeviceLoader(instance, device) { } - DeviceFn::~DeviceFn() { } + DeviceFn::~DeviceFn() { + this->vkDestroyDevice(m_device, nullptr); + } } \ No newline at end of file diff --git a/src/dxvk/vulkan/dxvk_vulkan_loader.h b/src/dxvk/vulkan/dxvk_vulkan_loader.h index 60adbb74..c653e263 100644 --- a/src/dxvk/vulkan/dxvk_vulkan_loader.h +++ b/src/dxvk/vulkan/dxvk_vulkan_loader.h @@ -28,7 +28,7 @@ namespace dxvk::vk { InstanceLoader(VkInstance instance); PFN_vkVoidFunction sym(const char* name) const; VkInstance instance() const { return m_instance; } - private: + protected: const VkInstance m_instance; }; @@ -43,7 +43,7 @@ namespace dxvk::vk { DeviceLoader(VkInstance instance, VkDevice device); PFN_vkVoidFunction sym(const char* name) const; VkDevice device() const { return m_device; } - private: + protected: const PFN_vkGetDeviceProcAddr m_getDeviceProcAddr; const VkDevice m_device; };