Skip to content

Commit

Permalink
RMG: slightly improve VidExt_VK_GetSurface()
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosalie241 committed Aug 26, 2023
1 parent 38b9469 commit 422f7d0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Source/RMG/VidExt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,16 @@ EXPORT m64p_error CALL VidExt_VK_GetSurface(void** Surface, void* Instance)
return M64ERR_INVALID_STATE;
}

// we don't support receiving a null handle
// for the VkInstance
if ((VkInstance)Instance == VK_NULL_HANDLE)
{
return M64ERR_UNSUPPORTED;
}

// use VkInstance from plugin
// when we don't have a VkInstance yet
if (!l_VulkanInstance.vkInstance())
if (l_VulkanInstance.vkInstance() == VK_NULL_HANDLE)
{
l_VulkanInstance.setVkInstance((VkInstance)Instance);
if (!l_VulkanInstance.create())
Expand Down

0 comments on commit 422f7d0

Please sign in to comment.