mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 01:20:42 +00:00
Use absolute dimensions of viewport to calculate aspect ratio. Refs #856
* On vulkan the viewport height could be negative to flip the NDC, but we don't care about its sign only its magnitude to calculate the aspect ratio.
This commit is contained in:
@@ -2283,8 +2283,11 @@ void BufferViewer::configureMeshColumns()
|
||||
|
||||
Viewport vp = m_Ctx.CurPipelineState().GetViewport(0);
|
||||
|
||||
float vpWidth = qAbs(vp.width);
|
||||
float vpHeight = qAbs(vp.height);
|
||||
|
||||
m_Config.fov = ui->fovGuess->value();
|
||||
m_Config.aspect = (vp.width > 0.0f && vp.height > 0.0f) ? (vp.width / vp.height) : 1.0f;
|
||||
m_Config.aspect = (vpWidth > 0.0f && vpHeight > 0.0f) ? (vpWidth / vpHeight) : 1.0f;
|
||||
m_Config.highlightVert = 0;
|
||||
|
||||
if(ui->aspectGuess->value() > 0.0)
|
||||
|
||||
Reference in New Issue
Block a user