From 85f127cb045200fa5fa3608b859e59bb4a9c27b2 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Sat, 1 Sep 2018 19:51:43 +0200 Subject: 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 --- src/gui/vulkan/qvulkanwindow.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src') 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() { -- cgit v1.2.3