@@ -1250,13 +1250,20 @@ static inline const char *VkErrorMessages(VkResult code)
1250
1250
#undef ERR_TO_STR
1251
1251
}
1252
1252
1253
- #define SET_ERROR_AND_RETURN (fmt , msg , ret ) \
1253
+ #define SET_ERROR (fmt , msg ) \
1254
1254
do { \
1255
1255
if (renderer -> debugMode ) { \
1256
1256
SDL_LogError (SDL_LOG_CATEGORY_GPU , fmt , msg ); \
1257
1257
} \
1258
1258
SDL_SetError ((fmt ), (msg )); \
1259
- return ret ; \
1259
+ } while (0 )
1260
+
1261
+ #define SET_STRING_ERROR (msg ) SET_ERROR("%s", msg)
1262
+
1263
+ #define SET_ERROR_AND_RETURN (fmt , msg , ret ) \
1264
+ do { \
1265
+ SET_ERROR(fmt, msg); \
1266
+ return ret; \
1260
1267
} while (0)
1261
1268
1262
1269
#define SET_STRING_ERROR_AND_RETURN (msg , ret ) SET_ERROR_AND_RETURN("%s", msg, ret)
@@ -11721,9 +11728,10 @@ static SDL_GPUDevice *VULKAN_CreateDevice(bool debugMode, bool preferLowPower, S
11721
11728
renderer -> desiredDeviceFeatures .imageCubeArray = VK_TRUE ;
11722
11729
11723
11730
if (!VULKAN_INTERNAL_PrepareVulkan (renderer )) {
11731
+ SET_STRING_ERROR ("Failed to initialize Vulkan!" );
11724
11732
SDL_free (renderer );
11725
11733
SDL_Vulkan_UnloadLibrary ();
11726
- SET_STRING_ERROR_AND_RETURN ( "Failed to initialize Vulkan!" , NULL ) ;
11734
+ return NULL ;
11727
11735
}
11728
11736
11729
11737
renderer -> props = SDL_CreateProperties ();
@@ -11828,9 +11836,10 @@ static SDL_GPUDevice *VULKAN_CreateDevice(bool debugMode, bool preferLowPower, S
11828
11836
11829
11837
if (!VULKAN_INTERNAL_CreateLogicalDevice (
11830
11838
renderer )) {
11839
+ SET_STRING_ERROR ("Failed to create logical device!" );
11831
11840
SDL_free (renderer );
11832
11841
SDL_Vulkan_UnloadLibrary ();
11833
- SET_STRING_ERROR_AND_RETURN ( "Failed to create logical device!" , NULL ) ;
11842
+ return NULL ;
11834
11843
}
11835
11844
11836
11845
// FIXME: just move this into this function
0 commit comments