libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
9.94k stars 1.84k forks source link

GPU: logging an error when no backend available. #10923

Closed icculus closed 1 month ago

icculus commented 1 month ago

This line in src/gpu/SDL_gpu.c's SDL_GPUSelectBackend() ...

    SDL_LogError(SDL_LOG_CATEGORY_GPU, "No supported SDL_GPU backend found!");

...causes the console to pop up on all the examples, because we don't have WebGPU support yet (and when we do, there still may be browsers without it). Since we have a GPU renderer backend, we hit this even though the system falls back to the completely-usable opengles2 backend for 2D stuff.

You can see it here: https://examples.libsdl.org/SDL3/renderer/05-rectangles/

Can we remove this logging, or make it not log as an error?

Akaricchi commented 1 month ago

Related #10779

slouken commented 1 month ago

In general the GPU code over-logs and needs to have the verbosity reduced.

flibitijibibo commented 1 month ago

I should be able to clear out all the logging in gpu.c tomorrow. What will take much longer are the backends; really we just need to make recoverable errors SetError and nonrecoverable errors either log or call an internal SDL_FatalGPUError helper to both log and SetError. Info/Warnings should be able to stay as they are unless I've forgotten any particularly bad ones.

flibitijibibo commented 1 month ago

gpu.c logs are fixed via https://github.com/libsdl-org/SDL/commit/4a3faf20ac670825462de5a95ac748cd560c9e56

For the overall logging situation, see #10779