Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qmultimedia_vulkan_support_p.h
Go to the documentation of this file.
1
// Copyright (C) 2026 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4
#
ifndef
QMULTIMEDIA_VULKAN_SUPPORT_P_H
5
#
define
QMULTIMEDIA_VULKAN_SUPPORT_P_H
6
7
//
8
// W A R N I N G
9
// -------------
10
//
11
// This file is not part of the Qt API. It exists purely as an
12
// implementation detail. This header file may change from version to
13
// version without notice, or even be removed.
14
//
15
// We mean it.
16
//
17
18
#
include
<
QtMultimedia
/
private
/
qtmultimediaglobal_p
.
h
>
19
20
#
include
<
QtGui
/
qvulkaninstance
.
h
>
// defines VK_NO_PROTOTYPES before pulling in vulkan.h
21
#
include
<
QtCore
/
qspan
.
h
>
22
#
include
<
QtCore
/
quuid
.
h
>
23
24
static_assert
(QT_CONFIG(vulkan));
25
26
QT_BEGIN_NAMESPACE
27
28
class
QDebug;
29
30
Q_MULTIMEDIA_EXPORT
QDebug
operator<<(QDebug debug, VkResult result);
31
32
namespace
QtMultimediaPrivate
{
33
34
template
<
typename
Func>
35
Func
resolveVulkanFunction
(QVulkanInstance &inst,
const
char
*name)
36
{
37
return
reinterpret_cast
<Func>(inst.getInstanceProcAddr(name));
38
}
39
40
// Resolves a device-level function, e.g. one of an extension such as VK_KHR_external_memory_fd.
41
// Unlike resolveVulkanFunction(), which yields a loader trampoline even when the extension is not
42
// enabled on the device (and crashes when called), this returns nullptr if the function is not
43
// available on the given device.
44
template
<
typename
Func>
45
Func
resolveVulkanDeviceFunction
(QVulkanInstance &inst, VkDevice dev,
const
char
*name)
46
{
47
const
auto
getDeviceProcAddr =
48
resolveVulkanFunction<PFN_vkGetDeviceProcAddr>(inst,
"vkGetDeviceProcAddr"
);
49
return
getDeviceProcAddr ?
reinterpret_cast
<Func>(getDeviceProcAddr(dev, name)) :
nullptr
;
50
}
51
52
inline
QUuid
uuidFromVkUuid
(QSpan<
const
uint8_t, VK_UUID_SIZE> vkUuidBytes)
53
{
54
static_assert
(VK_UUID_SIZE == 16);
55
return
QUuid::fromRfc4122(
56
QByteArrayView(
reinterpret_cast
<
const
char
*>(vkUuidBytes.data()), VK_UUID_SIZE));
57
}
58
59
}
// namespace QtMultimediaPrivate
60
61
QT_END_NAMESPACE
62
63
#
endif
// QMULTIMEDIA_VULKAN_SUPPORT_P_H
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QtMultimediaPrivate::impl
Definition
qaudiosystem_p.h:257
QtMultimediaPrivate::uuidFromVkUuid
QUuid uuidFromVkUuid(QSpan< const uint8_t, VK_UUID_SIZE > vkUuidBytes)
Definition
qmultimedia_vulkan_support_p.h:52
QtMultimediaPrivate::resolveVulkanDeviceFunction
Func resolveVulkanDeviceFunction(QVulkanInstance &inst, VkDevice dev, const char *name)
Definition
qmultimedia_vulkan_support_p.h:45
QtMultimediaPrivate::resolveVulkanFunction
Func resolveVulkanFunction(QVulkanInstance &inst, const char *name)
Definition
qmultimedia_vulkan_support_p.h:35
operator<<
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition
qdir.cpp:2620
qtmultimedia
src
multimedia
video
qmultimedia_vulkan_support_p.h
Generated on
for Qt by
1.18.0