Skip to content

Commit

Permalink
Better diagnostics when an SDL_GPU backend fails to initialize (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
kg authored Dec 6, 2024
1 parent 31813ba commit ebcf916
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/FNA3D_Driver_SDL.c
Original file line number Diff line number Diff line change
Expand Up @@ -4026,7 +4026,12 @@ static void SDLGPU_DestroyDevice(FNA3D_Device *device)

static uint8_t SDLGPU_PrepareWindowAttributes(uint32_t *flags)
{
return SDL_GPUSupportsShaderFormats(MOJOSHADER_sdlGetShaderFormats(), NULL);
uint8_t result = SDL_GPUSupportsShaderFormats(MOJOSHADER_sdlGetShaderFormats(), NULL);
if (!result)
{
FNA3D_LogWarn("SDL_GPUSupportsShaderFormats failed: %s", SDL_GetError());
}
return result;
}

static FNA3D_Device* SDLGPU_CreateDevice(
Expand Down Expand Up @@ -4057,7 +4062,7 @@ static FNA3D_Device* SDLGPU_CreateDevice(

if (device == NULL)
{
FNA3D_LogError("Failed to create SDLGPU device!");
FNA3D_LogError("Failed to create SDLGPU device: %s", SDL_GetError());
return NULL;
}

Expand Down

0 comments on commit ebcf916

Please sign in to comment.