mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-23 14:15:42 +00:00
GL Pixel History small code clean up in CalculateFragmentDepthTests
Move constant out of inner loop. Remove if test for depth test being enabled and set the depth function to GL_ALWAYS if the depth test is disabled.
This commit is contained in:
@@ -2035,6 +2035,11 @@ void CalculateFragmentDepthTests(WrappedOpenGL *driver, GLPixelHistoryResources
|
||||
continue;
|
||||
}
|
||||
|
||||
GLboolean depthTestEnabled = driver->glIsEnabled(eGL_DEPTH_TEST);
|
||||
// default for no depth test
|
||||
int depthFunc = eGL_ALWAYS;
|
||||
if(depthTestEnabled)
|
||||
driver->glGetIntegerv(eGL_DEPTH_FUNC, &depthFunc);
|
||||
for(; historyIndex < history.size() && modEvents[i].eventId == history[historyIndex].eventId;
|
||||
++historyIndex)
|
||||
{
|
||||
@@ -2043,19 +2048,8 @@ void CalculateFragmentDepthTests(WrappedOpenGL *driver, GLPixelHistoryResources
|
||||
continue;
|
||||
}
|
||||
|
||||
if(driver->glIsEnabled(eGL_DEPTH_TEST))
|
||||
{
|
||||
int depthFunc;
|
||||
driver->glGetIntegerv(eGL_DEPTH_FUNC, &depthFunc);
|
||||
|
||||
history[historyIndex].depthTestFailed = !depthTestPassed(
|
||||
depthFunc, history[historyIndex].shaderOut.depth, history[historyIndex].preMod.depth);
|
||||
}
|
||||
else
|
||||
{
|
||||
// since there is no depth test, there is no failure.
|
||||
history[historyIndex].depthTestFailed = false;
|
||||
}
|
||||
history[historyIndex].depthTestFailed = !depthTestPassed(
|
||||
depthFunc, history[historyIndex].shaderOut.depth, history[historyIndex].preMod.depth);
|
||||
}
|
||||
|
||||
if(i < modEvents.size() - 1)
|
||||
|
||||
Reference in New Issue
Block a user