GPU: More robust error reporting (#10958)

---------

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>
This commit is contained in:
Evan Hemsley
2024-09-27 00:30:18 -07:00
committed by GitHub
parent 48e213b4cd
commit be401dd1e3
11 changed files with 805 additions and 844 deletions

View File

@@ -74,7 +74,6 @@ SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
SDL_AppResult SDL_AppIterate(void *appstate)
{
Uint32 w, h;
SDL_GPUCommandBuffer *cmdbuf = SDL_AcquireGPUCommandBuffer(gpu_device);
if (cmdbuf == NULL) {
@@ -82,7 +81,11 @@ SDL_AppResult SDL_AppIterate(void *appstate)
return SDL_APP_FAILURE;
}
SDL_GPUTexture *swapchainTexture = SDL_AcquireGPUSwapchainTexture(cmdbuf, state->windows[0], &w, &h);
SDL_GPUTexture *swapchainTexture;
if (!SDL_AcquireGPUSwapchainTexture(cmdbuf, state->windows[0], &swapchainTexture)) {
SDL_Log("SDL_AcquireGPUSwapchainTexture failed: %s", SDL_GetError());
return SDL_APP_FAILURE;
}
if (swapchainTexture != NULL) {
const double currentTime = (double)SDL_GetPerformanceCounter() / SDL_GetPerformanceFrequency();
SDL_GPURenderPass *renderPass;