TheSpydog/SDL_gpu_examples

ComputeSpriteBatch example triggers presentation mode errors

Closed this issue · 4 comments

First of all, this is fantastic work.

On my machine, the ComputeSpriteBatch is the only one failing: nothing shows up, and instead it's a flow of error logs:

WARN: Failed to recreate swapchain!
ERROR: Device does not support requested present mode!

I am on Ubuntu Linux 24.04, with a AMD Radeon 5700XT, a decent GPU:

INFO: Welcome to the SDL_Gpu example suite!
INFO: Press A/D to move between examples!
INFO: STARTING EXAMPLE: ClearScreen
INFO: Validation layers enabled, expect debug level performance!
INFO: SDL_Gpu Driver: Vulkan
INFO: Vulkan Device: AMD Radeon RX 5700 XT (RADV NAVI10)
INFO: Vulkan Driver: radv Mesa 24.0.5-1ubuntu1
INFO: Vulkan Conformance: 1.2.1

All other examples work as expected.

ComputeSpriteBatch seems to be using SDL_GPU_PRESENTMODE_IMMEDIATE.

Many other Vulkan apps do work as expected on my workstation, not sure which presentation mode they do use.

I can try on a Windows machine with different GPU on Monday.

This should be an easy fix, we just need to fall back to mailbox when immediate isn't available (which is the case on Wayland).

Just pushed 39dc1aa, does this fix it on your setup?

Yes, the fallback code added in latest commit does indeed fix it on my setup!

Perfect, thanks for checking this out! We may poke this thread one more time; we're thinking about doing the fallback logic in SDL itself so this may get undone on the example's side assuming that SDL will know what to do with unsupported present modes.