diff --git a/lib/graphics_engine/include/ge_vulkan_driver.hpp b/lib/graphics_engine/include/ge_vulkan_driver.hpp index 9249eb820..e4f761a17 100644 --- a/lib/graphics_engine/include/ge_vulkan_driver.hpp +++ b/lib/graphics_engine/include/ge_vulkan_driver.hpp @@ -34,7 +34,8 @@ namespace GE public: //! constructor - GEVulkanDriver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, SDL_Window* window); + GEVulkanDriver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, SDL_Window* window, + IrrlichtDevice* device); //! destructor virtual ~GEVulkanDriver(); @@ -332,6 +333,7 @@ namespace GE std::unique_lock getGraphicsQueue(VkQueue* queue) const; void waitIdle(); void setDisableWaitIdle(bool val) { m_disable_wait_idle = val; } + IrrlichtDevice* getIrrlichtDevice() const { return m_irrlicht_device; } private: struct SwapChainSupportDetails { @@ -448,6 +450,8 @@ namespace GE SDL_Window* m_window; bool m_disable_wait_idle; + IrrlichtDevice* m_irrlicht_device; + void createInstance(SDL_Window* window); void findPhysicalDevice(); bool checkDeviceExtensions(VkPhysicalDevice device); diff --git a/lib/graphics_engine/src/ge_vulkan_driver.cpp b/lib/graphics_engine/src/ge_vulkan_driver.cpp index 93892e903..037ae3af3 100644 --- a/lib/graphics_engine/src/ge_vulkan_driver.cpp +++ b/lib/graphics_engine/src/ge_vulkan_driver.cpp @@ -450,9 +450,10 @@ std::atomic_bool g_schedule_pausing_rendering(false); std::atomic_bool g_paused_rendering(false); GEVulkanDriver::GEVulkanDriver(const SIrrlichtCreationParameters& params, - io::IFileSystem* io, SDL_Window* window) + io::IFileSystem* io, SDL_Window* window, + IrrlichtDevice* device) : CNullDriver(io, core::dimension2d(0, 0)), - m_params(params) + m_params(params), m_irrlicht_device(device) { m_vk.reset(new VK()); m_physical_device = VK_NULL_HANDLE; @@ -2029,9 +2030,10 @@ namespace irr namespace video { IVideoDriver* createVulkanDriver(const SIrrlichtCreationParameters& params, - io::IFileSystem* io, SDL_Window* window) + io::IFileSystem* io, SDL_Window* window, + IrrlichtDevice* device) { - return new GE::GEVulkanDriver(params, io, window); + return new GE::GEVulkanDriver(params, io, window, device); } // createVulkanDriver } } diff --git a/lib/irrlicht/source/Irrlicht/CIrrDeviceSDL.cpp b/lib/irrlicht/source/Irrlicht/CIrrDeviceSDL.cpp index bda8c62a0..d7504fe3f 100644 --- a/lib/irrlicht/source/Irrlicht/CIrrDeviceSDL.cpp +++ b/lib/irrlicht/source/Irrlicht/CIrrDeviceSDL.cpp @@ -42,7 +42,7 @@ namespace irr #endif #ifdef _IRR_COMPILE_WITH_VULKAN_ IVideoDriver* createVulkanDriver(const SIrrlichtCreationParameters& params, - io::IFileSystem* io, SDL_Window* win); + io::IFileSystem* io, SDL_Window* win, IrrlichtDevice* device); #endif } // end namespace video @@ -637,7 +637,7 @@ void CIrrDeviceSDL::createDriver() #ifdef _IRR_COMPILE_WITH_VULKAN_ try { - VideoDriver = video::createVulkanDriver(CreationParams, FileSystem, Window); + VideoDriver = video::createVulkanDriver(CreationParams, FileSystem, Window, this); } catch (std::exception& e) {