gpu: Add SDL_PROP_GPU_DEVICE_CREATE_VULKAN_REQUIRE_HARDWARE_ACCELERATION property

This commit is contained in:
Ethan Lee
2025-11-07 14:22:45 -05:00
parent 0b2073d143
commit b5624e14ff
2 changed files with 23 additions and 0 deletions

View File

@@ -2307,6 +2307,14 @@ extern SDL_DECLSPEC SDL_GPUDevice * SDLCALL SDL_CreateGPUDevice(
* either supports Tier 2 Resource Binding or does not support D3D12 in any
* capacity. Defaults to false.
*
* With the Vulkan renderer:
* - `SDL_PROP_GPU_DEVICE_CREATE_VULKAN_REQUIRE_HARDWARE_ACCELERATION`: By
* default, Vulkan device enumeration includes drivers of all types, including
* software renderers (for example, the Lavapipe Mesa driver). This can be
* useful if your application _requires_ SDL_GPU, but if you can provide your
* own fallback renderer (for example, an OpenGL renderer) this property can
* be set to true. Defaults to false.
*
* \param props the properties to use.
* \returns a GPU context on success or NULL on failure; call SDL_GetError()
* for more information.
@@ -2337,6 +2345,7 @@ extern SDL_DECLSPEC SDL_GPUDevice * SDLCALL SDL_CreateGPUDeviceWithProperties(
#define SDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOLEAN "SDL.gpu.device.create.shaders.metallib"
#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_ALLOW_FEWER_RESOURCE_SLOTS_BOOLEAN "SDL.gpu.device.create.d3d12.allowtier1resourcebinding"
#define SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING "SDL.gpu.device.create.d3d12.semantic"
#define SDL_PROP_GPU_DEVICE_CREATE_VULKAN_REQUIRE_HARDWARE_ACCELERATION "SDL.gpu.device.create.vulkan.requirehardwareacceleration"
/**
* Destroys a GPU context previously returned by SDL_CreateGPUDevice.