diff options
author | Roman Kuznetsov <r.kuznetsow@gmail.com> | 2019-02-17 16:55:14 +0300 |
---|---|---|
committer | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2019-03-01 10:45:24 +0300 |
commit | a252aaaf612cdc4d2255bad9896d76f5613fb52a (patch) | |
tree | d3a0b95158e07dd98667961156b9b889dcfa96ab /drape | |
parent | 75febe7a0aa27e4b3a4b9dc12d189aae72ffc6e1 (diff) |
[vulkan] Fixed screen mirroring
Diffstat (limited to 'drape')
-rw-r--r-- | drape/utils/projection.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drape/utils/projection.cpp b/drape/utils/projection.cpp index e5f66ba12b..2418f8e811 100644 --- a/drape/utils/projection.cpp +++ b/drape/utils/projection.cpp @@ -17,14 +17,17 @@ std::array<float, 16> MakeProjection(dp::ApiVersion apiVersion, float left, floa depthOffset = 0.5f; } + // In Vulkan y-direction is inverted. + float const yDir = (apiVersion == dp::ApiVersion::Vulkan ? -1.0f : 1.0f); + float const width = right - left; float const height = top - bottom; float const depth = kMaxDepth - kMinDepth; result[0] = 2.0f / width; result[3] = -(right + left) / width; - result[5] = 2.0f / height; - result[7] = -(top + bottom) / height; + result[5] = 2.0f / height * yDir; + result[7] = -(top + bottom) / height * yDir; result[10] = -2.0f * depthScale / depth; result[11] = depthOffset - (kMaxDepth + kMinDepth) / depth; result[15] = 1.0; |