d3d11: Respect SDL_HINT_RENDER_DIRECT3D_THREADSAFE when creating device

This commit is contained in:
Cameron Gutman 2022-01-02 15:43:35 -06:00
parent f37e4a94d3
commit c6ec5a07f1
1 changed files with 5 additions and 0 deletions

View File

@ -487,6 +487,11 @@ D3D11_CreateDeviceResources(SDL_Renderer * renderer)
creationFlags |= D3D11_CREATE_DEVICE_DEBUG; creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
} }
/* Create a single-threaded device unless the app requests otherwise. */
if (!SDL_GetHintBoolean(SDL_HINT_RENDER_DIRECT3D_THREADSAFE, SDL_FALSE)) {
creationFlags |= D3D11_CREATE_DEVICE_SINGLETHREADED;
}
/* Create the Direct3D 11 API device object and a corresponding context. */ /* Create the Direct3D 11 API device object and a corresponding context. */
result = D3D11CreateDeviceFunc( result = D3D11CreateDeviceFunc(
data->dxgiAdapter, data->dxgiAdapter,