Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

QSGVulkanTexture Struct

struct QNativeInterface::QSGVulkanTexture

Provides access to and enables adopting Vulkan image objects. More...

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

Public Functions

int nativeImage() const
int nativeImageLayout() const

Static Public Members

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

Detailed Description

Member Function Documentation

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

Creates a new QSGTexture wrapping an existing Vulkan image object for window.

The native object is wrapped, but not owned, by the resulting QSGTexture. The caller of the function is responsible for deleting the returned QSGTexture, but that will not destroy the underlying native object.

This function is currently suitable for 2D RGBA textures only.

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

layout must specify the current layout of the image.

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

size specifies the size in pixels.

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

This function was introduced in Qt 6.0.

See also QQuickWindow::sceneGraphInitialized(), QSGTexture, Scene Graph - Metal Texture Import, and Scene Graph - Vulkan Texture Import.

int QSGVulkanTexture::nativeImage() const

Returns the VkImage handle.

int QSGVulkanTexture::nativeImageLayout() const

Returns the image layout.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded