diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-09-01 19:51:43 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-09-06 09:17:53 +0000 |
commit | 85f127cb045200fa5fa3608b859e59bb4a9c27b2 (patch) | |
tree | 22bba444eb17f95c4d0dfd4a95c215f5b1e9ee92 /src/gui/vulkan/qvulkanwindow.cpp | |
parent | 689a1e186b76853144802d9c29f0346856bd5fde (diff) |
Revise an incorrect QVulkanWindow doc note
Applying the transformation in question has no effect on the winding
order. Rewrite that section.
While all the examples are correct, clarify the rules for the geometry
they use since the winding order varies. Fix up the triangle example code
to use front=CCW for clarity (even though it does not matter much since
culling is off there).
Change-Id: Icb968c76cc9fa918a5608d3c66b4fccd5668175e
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src/gui/vulkan/qvulkanwindow.cpp')
-rw-r--r-- | src/gui/vulkan/qvulkanwindow.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/gui/vulkan/qvulkanwindow.cpp b/src/gui/vulkan/qvulkanwindow.cpp index 7dea743ea8..e45a16170e 100644 --- a/src/gui/vulkan/qvulkanwindow.cpp +++ b/src/gui/vulkan/qvulkanwindow.cpp @@ -2694,15 +2694,11 @@ QImage QVulkanWindow::grab() system differences between OpenGL and Vulkan. By pre-multiplying the projection matrix with this matrix, applications can - continue to assume OpenGL-style Y coordinates in clip space (i.e. Y pointing - upwards), and can set minDepth and maxDepth to 0 and 1, respectively, - without any further corrections to the vertex Z positions, while using the - projection matrices retrieved from the QMatrix4x4 functions, such as - QMatrix4x4::perspective(), as-is. - - \note With vertex data following the default OpenGL rules (that is, the - front face being CCW), the correct winding order in the rasterization state - after applying this matrix is clockwise (\c{VK_FRONT_FACE_CLOCKWISE}). + continue to assume that Y is pointing upwards, and can set minDepth and + maxDepth in the viewport to 0 and 1, respectively, without having to do any + further corrections to the vertex Z positions. Geometry from OpenGL + applications can then be used as-is, assuming a rasterization state matching + the OpenGL culling and front face settings. */ QMatrix4x4 QVulkanWindow::clipCorrectionMatrix() { |