diff options
Diffstat (limited to 'examples/vulkan/doc')
-rw-r--r-- | examples/vulkan/doc/images/hellovulkantexture.png | bin | 10259 -> 0 bytes | |||
-rw-r--r-- | examples/vulkan/doc/images/hellovulkanwindow.png | bin | 2736 -> 0 bytes | |||
-rw-r--r-- | examples/vulkan/doc/src/hellovulkancubes.qdoc | 1 | ||||
-rw-r--r-- | examples/vulkan/doc/src/hellovulkantexture.qdoc | 18 | ||||
-rw-r--r-- | examples/vulkan/doc/src/hellovulkantriangle.qdoc | 49 | ||||
-rw-r--r-- | examples/vulkan/doc/src/hellovulkanwidget.qdoc | 1 | ||||
-rw-r--r-- | examples/vulkan/doc/src/hellovulkanwindow.qdoc | 78 |
7 files changed, 48 insertions, 99 deletions
diff --git a/examples/vulkan/doc/images/hellovulkantexture.png b/examples/vulkan/doc/images/hellovulkantexture.png Binary files differdeleted file mode 100644 index 0cb47a70be..0000000000 --- a/examples/vulkan/doc/images/hellovulkantexture.png +++ /dev/null diff --git a/examples/vulkan/doc/images/hellovulkanwindow.png b/examples/vulkan/doc/images/hellovulkanwindow.png Binary files differdeleted file mode 100644 index c55029312c..0000000000 --- a/examples/vulkan/doc/images/hellovulkanwindow.png +++ /dev/null diff --git a/examples/vulkan/doc/src/hellovulkancubes.qdoc b/examples/vulkan/doc/src/hellovulkancubes.qdoc index dc60b8bb68..91149911df 100644 --- a/examples/vulkan/doc/src/hellovulkancubes.qdoc +++ b/examples/vulkan/doc/src/hellovulkancubes.qdoc @@ -7,6 +7,7 @@ \title Hello Vulkan Cubes Example \ingroup examples-vulkan \brief Shows the basics of using QVulkanWindow. + \examplecategory {Graphics} The \e{Hello Vulkan Cubes Example} shows more advanced usage of QVulkanWindow. diff --git a/examples/vulkan/doc/src/hellovulkantexture.qdoc b/examples/vulkan/doc/src/hellovulkantexture.qdoc deleted file mode 100644 index 4945000f88..0000000000 --- a/examples/vulkan/doc/src/hellovulkantexture.qdoc +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -/*! - \example hellovulkantexture - \meta installpath vulkan - \ingroup examples-vulkan - \title Hello Vulkan Texture Vulkan Example - \brief Shows the basics of rendering with textures in a QVulkanWindow. - - The \e{Hello Vulkan Texture Example} builds on \l hellovulkantriangle. Here - instead of drawing a single triangle, a triangle strip is drawn in order to - get a quad on the screen. This is then textured using a QImage loaded from - a .png image file. - - \image hellovulkantexture.png - \include examples-run.qdocinc -*/ diff --git a/examples/vulkan/doc/src/hellovulkantriangle.qdoc b/examples/vulkan/doc/src/hellovulkantriangle.qdoc index 71d451c63a..bafa026ccd 100644 --- a/examples/vulkan/doc/src/hellovulkantriangle.qdoc +++ b/examples/vulkan/doc/src/hellovulkantriangle.qdoc @@ -7,13 +7,56 @@ \ingroup examples-vulkan \title Hello Vulkan Triangle Example \brief Shows the basics of rendering with QVulkanWindow and the Vulkan API. + \examplecategory {Graphics} - The \e{Hello Vulkan Triangle Example} builds on \l hellovulkanwindow. This - time a full graphics pipeline is created, including a vertex and fragment - shader. This pipeline is then used to render a triangle. + The \e{Hello Vulkan Triangle Example} creates a full graphics pipeline, + including a vertex and fragment shader, to render a triangle. \image hellovulkantriangle.png + \section1 Startup + + Each Qt application using Vulkan will have to have a \c{Vulkan instance} + which encapsulates application-level state and initializes a Vulkan library. + + A QVulkanWindow must always be associated with a QVulkanInstance and hence + the example performs instance creation before the window. The + QVulkanInstance object must also outlive the window. + + \snippet hellovulkantriangle/main.cpp 0 + + The example enables validation layers, when supported. When the requested + layers are not present, the request will be ignored. Additional layers and + extensions can be enabled in a similar manner. + + \snippet hellovulkantriangle/main.cpp 1 + + Once the instance is ready, it is time to create a window. Note that \c w + lives on the stack and is declared after \c inst. + + \section1 The QVulkanWindow Subclass + + To add custom functionality to a QVulkanWindow, subclassing is used. This + follows the existing patterns from QOpenGLWindow and QOpenGLWidget. + However, QVulkanWindow utilizes a separate QVulkanWindowRenderer object. + + The QVulkanWindow subclass reimplements the factory function + QVulkanWindow::createRenderer(). This simply returns a new instance of the + QVulkanWindowRenderer subclass. In order to be able to access various + Vulkan resources via the window object, a pointer to the window is passed + and stored via the constructor. + + \snippet hellovulkantriangle/main.cpp 2 + + \section1 The Actual Rendering + + QVulkanWindow subclasses queue their draw calls in their reimplementation + of QVulkanWindowRenderer::startNextFrame(). Once done, they are required to + call back QVulkanWindow::frameReady(). The example has no asynchronous + command generation, so the frameReady() call is made directly from + startNextFrame(). To get continuous updates, the example simply invokes + QWindow::requestUpdate() in order to schedule a repaint. + The example also demonstrates multisample antialiasing. Based on the supported sample counts reported by QVulkanWindow::supportedSampleCounts() the example chooses between 8x, 4x, or no multisampling. Once configured diff --git a/examples/vulkan/doc/src/hellovulkanwidget.qdoc b/examples/vulkan/doc/src/hellovulkanwidget.qdoc index 0166a361b1..2a71084fc4 100644 --- a/examples/vulkan/doc/src/hellovulkanwidget.qdoc +++ b/examples/vulkan/doc/src/hellovulkanwidget.qdoc @@ -7,6 +7,7 @@ \ingroup examples-vulkan \title Hello Vulkan Widget Example \brief Shows the usage of QVulkanWindow in QWidget applications. + \examplecategory {Graphics} The \e{Hello Vulkan Widget Example} is a variant of \l hellovulkantriangle that embeds the QVulkanWindow into a QWidget-based user interface using diff --git a/examples/vulkan/doc/src/hellovulkanwindow.qdoc b/examples/vulkan/doc/src/hellovulkanwindow.qdoc deleted file mode 100644 index 4b94457265..0000000000 --- a/examples/vulkan/doc/src/hellovulkanwindow.qdoc +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -/*! - \example hellovulkanwindow - \meta installpath vulkan - \title Hello Vulkan Window Example - \ingroup examples-vulkan - \brief Shows the basics of using QVulkanWindow. - - The \e{Hello Vulkan Window Example} shows the basics of using QVulkanWindow - in order to display rendering with the Vulkan graphics API on systems that - support this. - - \image hellovulkanwindow.png - - In this example there will be no actual rendering: it simply begins and - ends a render pass, which results in clearing the buffers to a fixed value. - The color buffer clear value changes on every frame. - - \section1 Startup - - Each Qt application using Vulkan will have to have a \c{Vulkan instance} - which encapsulates application-level state and initializes a Vulkan library. - - A QVulkanWindow must always be associated with a QVulkanInstance and hence - the example performs instance creation before the window. The - QVulkanInstance object must also outlive the window. - - \snippet hellovulkanwindow/main.cpp 0 - - The example enables validation layers, when supported. When the requested - layers are not present, the request will be ignored. Additional layers and - extensions can be enabled in a similar manner. - - \snippet hellovulkanwindow/main.cpp 1 - - Once the instance is ready, it is time to create a window. Note that \c w - lives on the stack and is declared after \c inst. - - \section1 The QVulkanWindow Subclass - - To add custom functionality to a QVulkanWindow, subclassing is used. This - follows the existing patterns from QOpenGLWindow and QOpenGLWidget. - However, QVulkanWindow utilizes a separate QVulkanWindowRenderer object. - This resembles QQuickFramebufferObject, and allows better separation of the - functions that are supposed to be reimplemented. - - \snippet hellovulkanwindow/hellovulkanwindow.h 0 - - The QVulkanWindow subclass reimplements the factory function - QVulkanWindow::createRenderer(). This simply returns a new instance of the - QVulkanWindowRenderer subclass. In order to be able to access various - Vulkan resources via the window object, a pointer to the window is passed - and stored via the constructor. - - \snippet hellovulkanwindow/hellovulkanwindow.cpp 0 - - Graphics resource creation and destruction is typically done in one of the - init - resource functions. - - \snippet hellovulkanwindow/hellovulkanwindow.cpp 1 - - \section1 The Actual Rendering - - QVulkanWindow subclasses queue their draw calls in their reimplementation - of QVulkanWindowRenderer::startNextFrame(). Once done, they are required to - call back QVulkanWindow::frameReady(). The example has no asynchronous - command generation, so the frameReady() call is made directly from - startNextFrame(). - - \snippet hellovulkanwindow/hellovulkanwindow.cpp 2 - - To get continuous updates, the example simply invokes - QWindow::requestUpdate() in order to schedule a repaint. - - \include examples-run.qdocinc -*/ |