mesa/src/asahi/vulkan/hk_queue.h
Alyssa Rosenzweig 5bc8284816 hk: add Vulkan driver for Apple GPUs
Honeykrisp is a Vulkan 1.3 driver for Apple GPUs. It currently support M1 and
M2, future hardware support is planned. It passed CTS a few months ago and with
two exceptions[1] should still pass now.

Compared to the May snapshot that passed conformance [1], this adds a bunch of
new features, most notably:

* Geometry shaders
* Tessellation shaders
* Transform feedback
* Pipeline statistics queries
* Robustness2
* Host image copy

Theoretically, we now support everything DXVK requires for D3D11 with full
FL11_1. To quote Rob Herring:

   How's performance? Great, because I haven't tested it.

This driver is NOT ready for end users... YET. Stay tuned, it won't be long now
:}

I would like to reiterate: Honeykrisp is not yet ready for end users. Please
read [3].

Regardless, as the kernel UAPI is not yet stable, this driver will refuse to
probe without out-of-tree Mesa patches. This is the same situation as our GL
driver.

On the Mesa side, the biggest todo before the release is improving
performance. Right now, I expect WineD3D with our GL4.6 driver to give better
performance. This isn't fundamental, just needs time ... our GL driver is 3
years old and honeykrisp is 3 months old.

On the non-Mesa side, there's still a lot of movement around krun and FEX
packaging before this becomes broadly useful for x86 games.

At any rate, now that I've finished up geometry and tessellation, I'm hopefully
done rewriting the whole driver every 2 weeks. So I think this is settled enough
that it makes sense to upstream this now instead of building up a gigantic
monster commit in a private branch.

[1] Pipeline robustness and pipeline statistics are included in this tree but
    need bug fixes in the CTS to pass. This is being handled internally in
    Khronos. These features may be disabled to get a conformant driver.

[2] https://rosenzweig.io/blog/vk13-on-the-m1-in-1-month.html

[3] https://dont-ship.it/

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30382>
2024-07-26 18:40:47 +00:00

42 lines
1,017 B
C

/*
* Copyright 2024 Valve Corporation
* Copyright 2024 Alyssa Rosenzweig
* Copyright 2022-2023 Collabora Ltd. and Red Hat Inc.
* SPDX-License-Identifier: MIT
*/
#pragma once
#include "hk_private.h"
#include "vk_queue.h"
struct hk_device;
struct hk_queue {
struct vk_queue vk;
struct {
/* Asahi kernel queue ID */
uint32_t id;
/* Timeline syncobj backing the queue */
uint32_t syncobj;
/* Current maximum timeline value for the queue's syncobj. If the
* syncobj's value equals timeline_value, then all work is complete.
*/
uint32_t timeline_value;
} drm;
};
static inline struct hk_device *
hk_queue_device(struct hk_queue *queue)
{
return (struct hk_device *)queue->vk.base.device;
}
VkResult hk_queue_init(struct hk_device *dev, struct hk_queue *queue,
const VkDeviceQueueCreateInfo *pCreateInfo,
uint32_t index_in_family);
void hk_queue_finish(struct hk_device *dev, struct hk_queue *queue);