From 6c6dd47448a7478884f8856a8543964ab6d981fb Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 5 Jul 2018 22:04:23 -0700 Subject: Always using negative viewport height in Vulkan to be 100% consistent with Direct3D --- Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp index 3618354b..e07ce58f 100644 --- a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp @@ -214,10 +214,14 @@ namespace Diligent static_cast(w) == vp.Width && static_cast(h) == vp.Height ) { + // GL_INVALID_VALUE is generated if either width or height is negative + // https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glViewport.xml glViewport( x, y, w, h ); } else { + // GL_INVALID_VALUE is generated if either width or height is negative + // https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glViewportIndexed.xhtml glViewportIndexedf( 0, BottomLeftX, BottomLeftY, vp.Width, vp.Height ); } CHECK_GL_ERROR( "Failed to set viewport" ); -- cgit v1.2.3