diff --git a/util/test/demos/d3d11/d3d11_test.cpp b/util/test/demos/d3d11/d3d11_test.cpp index 2445e6c8f..80822ec8e 100644 --- a/util/test/demos/d3d11/d3d11_test.cpp +++ b/util/test/demos/d3d11/d3d11_test.cpp @@ -339,7 +339,7 @@ void D3D11GraphicsTest::PostDeviceCreate() dev1->CheckFeatureSupport(D3D11_FEATURE_D3D11_OPTIONS1, &opts1, sizeof(opts1)); } -D3D11GraphicsTest::~D3D11GraphicsTest() +void D3D11GraphicsTest::Shutdown() { delete mainWindow; diff --git a/util/test/demos/d3d11/d3d11_test.h b/util/test/demos/d3d11/d3d11_test.h index 2c57154e7..aa87f043f 100644 --- a/util/test/demos/d3d11/d3d11_test.h +++ b/util/test/demos/d3d11/d3d11_test.h @@ -45,9 +45,8 @@ struct D3D11GraphicsTest : public GraphicsTest { static const TestAPI API = TestAPI::D3D11; - ~D3D11GraphicsTest(); - bool Init(int argc, char **argv); + void Shutdown(); GraphicsWindow *MakeWindow(int width, int height, const char *title); bool IsSupported(); diff --git a/util/test/demos/d3d12/d3d12_test.cpp b/util/test/demos/d3d12/d3d12_test.cpp index 179f0f98a..3a8ee6f94 100644 --- a/util/test/demos/d3d12/d3d12_test.cpp +++ b/util/test/demos/d3d12/d3d12_test.cpp @@ -407,11 +407,8 @@ bool D3D12GraphicsTest::IsSupported() return result; } -D3D12GraphicsTest::~D3D12GraphicsTest() +void D3D12GraphicsTest::Shutdown() { - if(dev == NULL) - return; - GPUSync(); infoqueue = NULL; diff --git a/util/test/demos/d3d12/d3d12_test.h b/util/test/demos/d3d12/d3d12_test.h index cad937a2a..0d7cba3cc 100644 --- a/util/test/demos/d3d12/d3d12_test.h +++ b/util/test/demos/d3d12/d3d12_test.h @@ -46,9 +46,8 @@ struct D3D12GraphicsTest : public GraphicsTest { static const TestAPI API = TestAPI::D3D12; - ~D3D12GraphicsTest(); - bool Init(int argc, char **argv); + void Shutdown(); GraphicsWindow *MakeWindow(int width, int height, const char *title); bool IsSupported(); diff --git a/util/test/demos/gl/gl_test.cpp b/util/test/demos/gl/gl_test.cpp index 6f28bc59f..2d1a5e7b6 100644 --- a/util/test/demos/gl/gl_test.cpp +++ b/util/test/demos/gl/gl_test.cpp @@ -44,7 +44,7 @@ void OpenGLGraphicsTest::PostInit() } } -OpenGLGraphicsTest::~OpenGLGraphicsTest() +void OpenGLGraphicsTest::Shutdown() { if(!managedResources.bufs.empty()) glDeleteBuffers((GLsizei)managedResources.bufs.size(), &managedResources.bufs[0]); diff --git a/util/test/demos/gl/gl_test.h b/util/test/demos/gl/gl_test.h index 4652c57b3..293331a67 100644 --- a/util/test/demos/gl/gl_test.h +++ b/util/test/demos/gl/gl_test.h @@ -34,9 +34,8 @@ struct OpenGLGraphicsTest : public GraphicsTest { static const TestAPI API = TestAPI::OpenGL; - ~OpenGLGraphicsTest(); - bool Init(int argc, char **argv); + void Shutdown(); bool IsSupported(); GraphicsWindow *MakeWindow(int width, int height, const char *title); void *MakeContext(GraphicsWindow *win, void *share); diff --git a/util/test/demos/main.cpp b/util/test/demos/main.cpp index d86a45442..b23243edc 100644 --- a/util/test/demos/main.cpp +++ b/util/test/demos/main.cpp @@ -451,6 +451,7 @@ Usage: %s Test_Name [test_options] { TEST_LOG("\n\n======\nRunning %s\n\n", test.Name); int ret = test.test->main(argc, argv); + test.test->Shutdown(); return ret; } } diff --git a/util/test/demos/test_common.cpp b/util/test/demos/test_common.cpp index 04f55acb7..ba2792ec1 100644 --- a/util/test/demos/test_common.cpp +++ b/util/test/demos/test_common.cpp @@ -406,6 +406,10 @@ bool GraphicsTest::Init(int argc, char **argv) return true; } +void GraphicsTest::Shutdown() +{ +} + std::string GraphicsTest::GetDataPath(const std::string &filename) { return dataRoot + filename; diff --git a/util/test/demos/test_common.h b/util/test/demos/test_common.h index 2e0e81a40..0b731ef80 100644 --- a/util/test/demos/test_common.h +++ b/util/test/demos/test_common.h @@ -155,6 +155,7 @@ struct GraphicsTest virtual int main(int argc, char **argv) { return 9; } virtual bool IsSupported() { return false; } virtual bool Init(int argc, char **argv); + virtual void Shutdown(); std::string GetDataPath(const std::string &filename); diff --git a/util/test/demos/vk/vk_test.cpp b/util/test/demos/vk/vk_test.cpp index 0b23bf300..efda03acc 100644 --- a/util/test/demos/vk/vk_test.cpp +++ b/util/test/demos/vk/vk_test.cpp @@ -414,11 +414,8 @@ GraphicsWindow *VulkanGraphicsTest::MakeWindow(int width, int height, const char #endif } -VulkanGraphicsTest::~VulkanGraphicsTest() +void VulkanGraphicsTest::Shutdown() { - if(volkGetInstanceVersion() == 0) - return; - vmaDestroyAllocator(allocator); if(device) diff --git a/util/test/demos/vk/vk_test.h b/util/test/demos/vk/vk_test.h index 307dc07d2..3fb6c8dd2 100644 --- a/util/test/demos/vk/vk_test.h +++ b/util/test/demos/vk/vk_test.h @@ -139,9 +139,9 @@ struct VulkanGraphicsTest : public GraphicsTest static const TestAPI API = TestAPI::Vulkan; VulkanGraphicsTest(); - ~VulkanGraphicsTest(); bool Init(int argc, char **argv); + void Shutdown(); bool IsSupported(); GraphicsWindow *MakeWindow(int width, int height, const char *title); VkResult CreateSurface(GraphicsWindow *win, VkSurfaceKHR *outSurf);