From f64e2ce1d1ca55ba217aaf1407cbc83ebd607fd0 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 9 Feb 2015 11:50:11 +0000 Subject: [PATCH] Do a default inversion of Y co-ordinates on GL and invert w/ height-1 --- renderdocui/Windows/TextureViewer.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/renderdocui/Windows/TextureViewer.cs b/renderdocui/Windows/TextureViewer.cs index c8bdbbd37..a6c05e546 100644 --- a/renderdocui/Windows/TextureViewer.cs +++ b/renderdocui/Windows/TextureViewer.cs @@ -1408,8 +1408,10 @@ namespace renderdocui.Windows } int y = m_CurHoverPixel.Y >> (int)m_TexDisplay.mip; + if (m_Core.APIProps.pipelineType == APIPipelineStateType.OpenGL) + y = (int)(tex.height-1) - y; if (m_TexDisplay.FlipY) - y = (int)tex.height - y; + y = (int)(tex.height-1) - y; int x = m_CurHoverPixel.X >> (int)m_TexDisplay.mip; float invWidth = tex.width > 0 ? 1.0f / tex.width : 0.0f;