video: Added parameter checks to SDL_Vulkan_GetPresentationSupport

This commit is contained in:
Ethan Lee
2024-07-11 14:45:46 -04:00
parent 5d506a53a6
commit 8d24bb8dfc

View File

@@ -5530,7 +5530,21 @@ SDL_bool SDL_Vulkan_GetPresentationSupport(VkInstance instance,
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
Uint32 queueFamilyIndex) Uint32 queueFamilyIndex)
{ {
if (_this && instance && physicalDevice) { if (!_this) {
SDL_UninitializedVideo();
return SDL_FALSE;
}
if (!instance) {
SDL_InvalidParamError("instance");
return SDL_FALSE;
}
if (!physicalDevice) {
SDL_InvalidParamError("physicalDevice");
return SDL_FALSE;
}
if (_this->Vulkan_GetPresentationSupport) { if (_this->Vulkan_GetPresentationSupport) {
return _this->Vulkan_GetPresentationSupport(_this, instance, physicalDevice, queueFamilyIndex); return _this->Vulkan_GetPresentationSupport(_this, instance, physicalDevice, queueFamilyIndex);
} }
@@ -5541,8 +5555,6 @@ SDL_bool SDL_Vulkan_GetPresentationSupport(VkInstance instance,
*/ */
return SDL_TRUE; return SDL_TRUE;
} }
return SDL_FALSE;
}
SDL_MetalView SDL_Metal_CreateView(SDL_Window *window) SDL_MetalView SDL_Metal_CreateView(SDL_Window *window)
{ {