Mesa (main): dzn: Only support high/normal queue priorities

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 8 03:25:11 UTC 2022


Module: Mesa
Branch: main
Commit: b16f9f8ba4d70d8d60b3472768d0c384687688d7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b16f9f8ba4d70d8d60b3472768d0c384687688d7

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Thu Jul  7 13:35:08 2022 -0700

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 <billkris at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17406>

---

 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,



More information about the mesa-commit mailing list