QVulkanDeviceFunctions Class
QVulkanDeviceFunctions 클래스는 디바이스 레벨의 핵심 Vulkan 1.3 API에 대한 크로스 플랫폼 액세스를 제공합니다. 더 보기...
헤더: | #include <QVulkanDeviceFunctions> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
qmake: | QT += gui |
- QVulkanDeviceFunctions는 3D 렌더링의 일부입니다.
자세한 설명
Qt 및 Qt 애플리케이션은 기본적으로 Vulkan 라이브러리에 링크하지 않습니다. 대신 모든 함수는 런타임에 동적으로 해결됩니다. 각 QVulkanInstance 은 QVulkanInstance::functions()을 통해 검색할 수 있는 QVulkanFunctions 객체를 제공합니다. 여기에는 내부 디스패칭의 잠재적 오버헤드를 피하기 위해 디바이스 수준 함수가 포함되어 있지 않습니다. 대신 디바이스 또는 디바이스의 디스패치 가능한 자식 객체에 의존하는 함수는 QVulkanDeviceFunctions 및 QVulkanInstance::deviceFunctions()를 통해 노출됩니다. QVulkanFunctions 및 QVulkanDeviceFunctions를 함께 사용하면 확장을 제외한 전체 핵심 Vulkan API에 대한 액세스를 제공합니다.
참고: QVulkanDeviceFunctions 인스턴스는 직접 생성할 수 없습니다.
일반적인 사용법은 다음과 같습니다:
void Window::render() { QVulkanInstance *inst = vulkanInstance(); QVulkanDeviceFunctions *df = inst->deviceFunctions(device); VkResult err = df->vkAllocateCommandBuffers(device, &cmdBufInfo, &cmdBuf); // ... }
해당 디바이스로 QVulkanInstance::deviceFunctions()를 처음 호출할 때 제공된 VkDevice에 특정한 QVulkanDeviceFunctions 객체가 생성됩니다. 그런 다음 이 객체는 내부적으로 캐시됩니다.
추가 함수에 액세스하려면 애플리케이션은 QVulkanInstance::getInstanceProcAddr() 및 vkGetDeviceProcAddr()을 사용할 수 있습니다. 많은 구현이 핵심 명령에 대한 함수 심볼을 내보내므로 애플리케이션이 Vulkan 라이브러리에 직접 연결할 수도 있습니다. 자세한 내용은 vkGetInstanceProcAddr의 매뉴얼 페이지를 참조하세요.
QVulkanInstance, QVulkanFunctions, QWindow::setVulkanInstance() 및 QWindow::setSurfaceType()도 참조하세요 .
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.