QSGVulkanTexture Struct

struct QNativeInterface ::QSGVulkanTexture

Provides access to and enables adopting Vulkan image objects. 更多...

頭: #include < QSGTexture >
CMake: find_package(Qt6 REQUIRED COMPONENTS Quick)
target_link_libraries(mytarget PRIVATE Qt6::Quick)
qmake: QT += quick
Since: Qt 6.0

公共函數

virtual VkImage nativeImage () const = 0
virtual VkImageLayout nativeImageLayout () const = 0

靜態公共成員

QSGTexture * fromNative (VkImage image , VkImageLayout layout , QQuickWindow * window , const QSize & size , QQuickWindow::CreateTextureOptions options = {})

詳細描述

成員函數文檔編製

[static, since 6.0] QSGTexture *QSGVulkanTexture:: fromNative ( VkImage image , VkImageLayout layout , QQuickWindow * window , const QSize & size , QQuickWindow::CreateTextureOptions options = {})

創建新的 QSGTexture wrapping an existing Vulkan image 對象為 window .

本機對象被包裹 (但不歸其所有) 通過結果 QSGTexture 。函數調用者負責刪除返迴的 QSGTexture ,但不會銷毀底層本機對象。

此函數目前僅適於 2D RGBA 紋理。

警告: This function will return null if the scene graph has not yet been initialized.

layout must specify the current layout of the image.

使用 options to customize the texture attributes. Only the TextureHasAlphaChannel and TextureHasMipmaps are taken into account here.

size 指定大小 (以像素為單位)。

注意: This function must be called on the scene graph rendering thread.

該函數在 Qt 6.0 引入。

另請參閱 QQuickWindow::sceneGraphInitialized (), QSGTexture , 場景圖形 - Metal 紋理導入 ,和 場景圖形 - Vulkan 紋理導入 .

[pure virtual] VkImage QSGVulkanTexture:: nativeImage () const

Returns the VkImage handle.

[pure virtual] VkImageLayout QSGVulkanTexture:: nativeImageLayout () const

Returns the image layout.