Added 'shaderswitches' to love.graphics.getStats.

This commit is contained in:
Alex Szpakowski
2016-04-02 18:14:52 -03:00
parent b365574bff
commit 901cc362df
7 changed files with 35 additions and 64 deletions
+6 -4
View File
@@ -452,8 +452,8 @@ void Graphics::clear(Colorf c)
{
// This seems to be enough to fix the bug for me. Other methods I've
// tried (e.g. dummy draws) don't work in all cases.
glUseProgram(0);
glUseProgram(Shader::current->getProgram());
gl.useProgram(0);
gl.useProgram(Shader::current->getProgram());
}
}
@@ -530,8 +530,8 @@ void Graphics::clear(const std::vector<OptionalColorf> &colors)
{
// This seems to be enough to fix the bug for me. Other methods I've
// tried (e.g. dummy draws) don't work in all cases.
glUseProgram(0);
glUseProgram(Shader::current->getProgram());
gl.useProgram(0);
gl.useProgram(Shader::current->getProgram());
}
}
@@ -610,6 +610,7 @@ void Graphics::present()
// Reset the per-frame stat counts.
gl.stats.drawCalls = 0;
gl.stats.framebufferBinds = 0;
gl.stats.shaderSwitches = 0;
}
int Graphics::getWidth() const
@@ -1653,6 +1654,7 @@ Graphics::Stats Graphics::getStats() const
stats.drawCalls = gl.stats.drawCalls;
stats.canvasSwitches = gl.stats.framebufferBinds;
stats.shaderSwitches = gl.stats.shaderSwitches;
stats.canvases = Canvas::canvasCount;
stats.images = Image::imageCount;
stats.fonts = Font::fontCount;