SDL3 Querying compute size

Firstly, SDL3 is incredible. This is what I’ve been wanting for years, an abstracted GPU API.

For now, if I want to find the maximum compute dispatch limits for the current GPU device, I assume I have query the driver and do this manually currently? i.e., if the driver is “vulkan”, then I do vkGetPhysicalDeviceProperties to query this.

However, for that call, I also need the renderer physical device and I’m not sure if that’s exposed by the API. I’m certain I’m just overlooking something very trivial that I keep skimming over in the SDL API.

We tend to not expose limit queries in this API in favor of just targeting a minimum support level. This gives you maximum portability for the least effort.

For example: maxComputeWorkGroupCount[0] - Vulkan Hardware Database by Sascha Willems

This shows that the overwhelming majority of devices support a max workgroup count of 65535, so that’s a reasonable limit to use in practice.

1 Like

That’s a great resource, thank you! Given the lowest I’m targetting is Intel Mac, workgroup count is already higher than I imagined. Great stuff!

Apple also publishes their own Metal feature set tables, so you can get the limits of what they support straight from the horse’s mouth.

1 Like