[host] d12: don't attempt to use realtime priority

Some GPUs such as the RX580 seem to completely crash when attempting
to use `D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME`.
This commit is contained in:
Geoffrey McRae 2024-03-09 11:00:44 +11:00
parent 778c21070c
commit d5b32225f4

View file

@ -291,28 +291,18 @@ static bool d12_init(void * ivshmemBase, unsigned * alignSize)
goto exit; goto exit;
} }
/* make this static as we downgrade the priority on failure and we want to D3D12_COMMAND_QUEUE_DESC copyQueueDesc =
remember it */
static D3D12_COMMAND_QUEUE_DESC queueDesc =
{ {
.Type = D3D12_COMMAND_LIST_TYPE_COPY, .Type = D3D12_COMMAND_LIST_TYPE_COPY,
.Priority = D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME, .Priority = D3D12_COMMAND_QUEUE_PRIORITY_HIGH,
.Flags = D3D12_COMMAND_QUEUE_FLAG_NONE, .Flags = D3D12_COMMAND_QUEUE_FLAG_NONE
}; };
comRef_defineLocal(ID3D12CommandQueue, copyQueue); comRef_defineLocal(ID3D12CommandQueue, copyQueue);
retryCreateCommandQueue:
hr = ID3D12Device3_CreateCommandQueue( hr = ID3D12Device3_CreateCommandQueue(
*device, &queueDesc, &IID_ID3D12CommandQueue, (void **)copyQueue); *device, &copyQueueDesc, &IID_ID3D12CommandQueue, (void **)copyQueue);
if (FAILED(hr)) if (FAILED(hr))
{ {
if (queueDesc.Priority == D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME)
{
DEBUG_WARN("Failed to create queue with real time priority");
queueDesc.Priority = D3D12_COMMAND_QUEUE_PRIORITY_HIGH;
goto retryCreateCommandQueue;
}
DEBUG_WINERROR("Failed to create ID3D12CommandQueue (copy)", hr); DEBUG_WINERROR("Failed to create ID3D12CommandQueue (copy)", hr);
goto exit; goto exit;
} }
@ -321,10 +311,10 @@ retryCreateCommandQueue:
// create the compute queue // create the compute queue
D3D12_COMMAND_QUEUE_DESC computeQueueDesc = D3D12_COMMAND_QUEUE_DESC computeQueueDesc =
{ {
.Type = D3D12_COMMAND_LIST_TYPE_COMPUTE, .Type = D3D12_COMMAND_LIST_TYPE_COMPUTE,
.Flags = D3D12_COMMAND_QUEUE_FLAG_NONE, .Priority = D3D12_COMMAND_QUEUE_PRIORITY_HIGH,
.Flags = D3D12_COMMAND_QUEUE_FLAG_NONE
}; };
queueDesc.Priority = queueDesc.Priority;
comRef_defineLocal(ID3D12CommandQueue, computeQueue); comRef_defineLocal(ID3D12CommandQueue, computeQueue);
hr = ID3D12Device3_CreateCommandQueue( hr = ID3D12Device3_CreateCommandQueue(