26#include <score/gfx/Vulkan.hpp>
30#include <QtGui/private/qrhivulkan_p.h>
32#include <QVulkanInstance>
35class QVulkanDeviceFunctions;
37namespace score::gfx::interop
41struct VulkanRhiContext
43 score::gfx::vkinterop::VulkanCtx vk{};
44 QVulkanDeviceFunctions* devFuncs{};
45 VkQueue gfxQueue{VK_NULL_HANDLE};
52inline bool acquireVulkanRhiContext(QRhi* rhi, VulkanRhiContext& out)
noexcept
54 if(!rhi || rhi->backend() != QRhi::Vulkan)
56 auto* h =
static_cast<const QRhiVulkanNativeHandles*
>(rhi->nativeHandles());
57 QVulkanInstance* qInst = score::gfx::staticVulkanInstance(
false);
58 if(!h || !h->dev || !h->physDev || !qInst)
60 out.vk = {qInst->vkInstance(), h->physDev, h->dev, qInst};
61 out.devFuncs = qInst->deviceFunctions(h->dev);
62 out.gfxQueue = h->gfxQueue;
63 out.gfxFamily = h->gfxQueueFamilyIdx;
64 if(!out.devFuncs || !out.gfxQueue || out.gfxFamily < 0)
Vulkan external-memory image/buffer create + export + import helpers.