From b16f9f8ba4d70d8d60b3472768d0c384687688d7 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Thu, 7 Jul 2022 13:35:08 -0700 Subject: [PATCH] dzn: Only support high/normal queue priorities D3D uses an int which seems like it'd support value between 0 and 100, but in reality it only accepts values of exactly 0, or 100. The space is left in case future values were to be added, so that comparisons would work (e.g. MEDIUM_HIGH < HIGH). Treat higher than 0.5 to be HIGH, and anything less to be NORMAL. Reviewed-by: Bill Kristiansen Part-of: --- src/microsoft/vulkan/dzn_device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/microsoft/vulkan/dzn_device.c b/src/microsoft/vulkan/dzn_device.c index 9b5f82c3fbc..98abf3b6aa9 100644 --- a/src/microsoft/vulkan/dzn_device.c +++ b/src/microsoft/vulkan/dzn_device.c @@ -1813,8 +1813,9 @@ dzn_queue_init(struct dzn_queue *queue, D3D12_COMMAND_QUEUE_DESC queue_desc = pdev->queue_families[pCreateInfo->queueFamilyIndex].desc; + float priority_in = pCreateInfo->pQueuePriorities[index_in_family]; queue_desc.Priority = - (INT)(pCreateInfo->pQueuePriorities[index_in_family] * (float)D3D12_COMMAND_QUEUE_PRIORITY_HIGH); + priority_in > 0.5f ? D3D12_COMMAND_QUEUE_PRIORITY_HIGH : D3D12_COMMAND_QUEUE_PRIORITY_NORMAL; queue_desc.NodeMask = 0; if (FAILED(ID3D12Device1_CreateCommandQueue(device->dev, &queue_desc,