mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Check for clip origin on GL to enable Y-flipping for output meshes
This commit is contained in:
@@ -739,6 +739,17 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId)
|
||||
if(HasExt[ARB_transform_feedback2])
|
||||
drv.glBindTransformFeedback(eGL_TRANSFORM_FEEDBACK, DebugData.feedbackObj);
|
||||
|
||||
bool flipY = false;
|
||||
|
||||
if(HasExt[ARB_clip_control])
|
||||
{
|
||||
GLenum clipOrigin = eGL_LOWER_LEFT;
|
||||
GL.glGetIntegerv(eGL_CLIP_ORIGIN, (GLint *)&clipOrigin);
|
||||
|
||||
if(clipOrigin == eGL_UPPER_LEFT)
|
||||
flipY = true;
|
||||
}
|
||||
|
||||
GLuint idxBuf = 0;
|
||||
|
||||
if(vsRefl->outputSignature.empty())
|
||||
@@ -1867,6 +1878,8 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId)
|
||||
|
||||
m_PostVSData[eventId].gsout.useIndices = false;
|
||||
|
||||
m_PostVSData[eventId].gsout.flipY = flipY;
|
||||
|
||||
m_PostVSData[eventId].gsout.hasPosOut = hasPosition;
|
||||
|
||||
m_PostVSData[eventId].gsout.idxBuf = 0;
|
||||
@@ -1877,6 +1890,10 @@ void GLReplay::InitPostVSBuffers(uint32_t eventId)
|
||||
m_PostVSData[eventId].gsout.instData = instData;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_PostVSData[eventId].vsout.flipY = flipY;
|
||||
}
|
||||
|
||||
// delete temporary program we made
|
||||
drv.glDeleteProgram(feedbackProg);
|
||||
@@ -1989,6 +2006,8 @@ MeshFormat GLReplay::GetPostVSBuffers(uint32_t eventId, uint32_t instID, uint32_
|
||||
ret.nearPlane = s.nearPlane;
|
||||
ret.farPlane = s.farPlane;
|
||||
|
||||
ret.flipY = s.flipY;
|
||||
|
||||
if(instID < s.instData.size())
|
||||
{
|
||||
GLPostVSData::InstData inst = s.instData[instID];
|
||||
|
||||
@@ -62,6 +62,8 @@ struct GLPostVSData
|
||||
GLuint idxBuf = 0;
|
||||
uint32_t idxByteWidth = 0;
|
||||
|
||||
bool flipY = false;
|
||||
|
||||
bool hasPosOut = false;
|
||||
|
||||
float nearPlane = 0.0f;
|
||||
|
||||
Reference in New Issue
Block a user