GPU: Fix backwards LogError and SetError calls

This commit is contained in:
cosmonaut
2024-09-25 12:47:12 -07:00
parent 1561d7c089
commit 925e47a077
2 changed files with 11 additions and 11 deletions

View File

@@ -831,7 +831,7 @@ static void D3D11_INTERNAL_SetError(
// No message? Screw it, just post the code. // No message? Screw it, just post the code.
if (dwChars == 0) { if (dwChars == 0) {
SDL_LogError(SDL_LOG_CATEGORY_GPU, "%s! Error Code: " HRESULT_FMT, msg, res); SDL_SetError("%s! Error Code: " HRESULT_FMT, msg, res);
return; return;
} }
@@ -850,7 +850,7 @@ static void D3D11_INTERNAL_SetError(
// Ensure null-terminated string // Ensure null-terminated string
wszMsgBuff[dwChars] = '\0'; wszMsgBuff[dwChars] = '\0';
SDL_LogError(SDL_LOG_CATEGORY_GPU, "%s! Error Code: %s " HRESULT_FMT, msg, wszMsgBuff, res); SDL_SetError("%s! Error Code: %s " HRESULT_FMT, msg, wszMsgBuff, res);
} }
static void D3D11_INTERNAL_LogError( static void D3D11_INTERNAL_LogError(
@@ -885,7 +885,7 @@ static void D3D11_INTERNAL_LogError(
// No message? Screw it, just post the code. // No message? Screw it, just post the code.
if (dwChars == 0) { if (dwChars == 0) {
SDL_SetError("%s! Error Code: " HRESULT_FMT, msg, res); SDL_LogError(SDL_LOG_CATEGORY_GPU, "%s! Error Code: " HRESULT_FMT, msg, res);
return; return;
} }
@@ -904,7 +904,7 @@ static void D3D11_INTERNAL_LogError(
// Ensure null-terminated string // Ensure null-terminated string
wszMsgBuff[dwChars] = '\0'; wszMsgBuff[dwChars] = '\0';
SDL_SetError("%s! Error Code: %s " HRESULT_FMT, msg, wszMsgBuff, res); SDL_LogError(SDL_LOG_CATEGORY_GPU, "%s! Error Code: %s " HRESULT_FMT, msg, wszMsgBuff, res);
} }
// Helper Functions // Helper Functions

View File

@@ -1214,18 +1214,18 @@ static inline void LogVulkanResultAsError(
} }
} }
#define ERROR_LOG_RETURN(res, fn, ret) \ #define ERROR_LOG_RETURN(res, fn, ret) \
if (res != VK_SUCCESS) { \
SDL_SetError("%s %s", #fn, VkErrorMessages(res)); \
return ret; \
}
#define ERROR_SET_RETURN(res, fn, ret) \
if (res != VK_SUCCESS) { \ if (res != VK_SUCCESS) { \
SDL_LogError(SDL_LOG_CATEGORY_GPU, "%s %s", #fn, VkErrorMessages(res)); \ SDL_LogError(SDL_LOG_CATEGORY_GPU, "%s %s", #fn, VkErrorMessages(res)); \
return ret; \ return ret; \
} }
#define ERROR_SET_RETURN(res, fn, ret) \
if (res != VK_SUCCESS) { \
SDL_SetError("%s %s", #fn, VkErrorMessages(res)); \
return ret; \
}
// Utility // Utility
static inline VkPolygonMode SDLToVK_PolygonMode( static inline VkPolygonMode SDLToVK_PolygonMode(