Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better diagnostics when an SDL_GPU backend fails to initialize #222

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading