summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-07-06 05:04:23 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-07-06 05:04:23 +0000
commit6c6dd47448a7478884f8856a8543964ab6d981fb (patch)
treefc61c53a2a658d225a003ec7a8f993fe09d0eacf /Graphics/GraphicsEngine
parentEnabled back some Vulkan performance warnings (diff)
downloadDiligentCore-6c6dd47448a7478884f8856a8543964ab6d981fb.tar.gz
DiligentCore-6c6dd47448a7478884f8856a8543964ab6d981fb.zip
Always using negative viewport height in Vulkan to be 100% consistent with Direct3D
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/interface/DeviceCaps.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/Graphics/GraphicsEngine/interface/DeviceCaps.h b/Graphics/GraphicsEngine/interface/DeviceCaps.h
index 496f3599..aacedfcf 100644
--- a/Graphics/GraphicsEngine/interface/DeviceCaps.h
+++ b/Graphics/GraphicsEngine/interface/DeviceCaps.h
@@ -149,7 +149,11 @@ namespace Diligent
{
if (IsVulkanDevice())
{
- static constexpr const NDCAttribs NDCAttribsVk {0.0f, 1.0f, 0.5f};
+ // Note that Vulkan itself does not invert Y coordinate when transforming
+ // normalized device Y to window space. However, we use negative viewport
+ // height which achieves the same effect as in D3D, thererfore we need to
+ // invert y (see comments in DeviceContextVkImpl::CommitViewports() for details)
+ static constexpr const NDCAttribs NDCAttribsVk {0.0f, 1.0f, -0.5f};
return NDCAttribsVk;
}
else if (IsD3DDevice())