Added profile blocks for GL.

This commit is contained in:
Jeff Hutchinson 2016-05-06 23:44:41 -04:00
parent 6caafc9844
commit db6d91925d
6 changed files with 29 additions and 2 deletions

View file

@ -344,6 +344,7 @@ void GFXGLShaderConstBuffer::set(GFXShaderConstHandle* handle, const MatrixF* ma
void GFXGLShaderConstBuffer::activate()
{
PROFILE_SCOPE(GFXGLShaderConstBuffer_activate);
mShader->setConstantsFromBuffer(this);
mWasLost = false;
}
@ -394,6 +395,7 @@ void GFXGLShader::clearShaders()
bool GFXGLShader::_init()
{
PROFILE_SCOPE(GFXGLShader_Init);
// Don't initialize empty shaders.
if ( mVertexFile.isEmpty() && mPixelFile.isEmpty() )
return false;
@ -1013,6 +1015,7 @@ bool GFXGLShader::initShader( const Torque::Path &file,
bool isVertex,
const Vector<GFXShaderMacro> &macros )
{
PROFILE_SCOPE(GFXGLShader_CompileShader);
GLuint activeShader = glCreateShader(isVertex ? GL_VERTEX_SHADER : GL_FRAGMENT_SHADER);
if(isVertex)
mVertexShader = activeShader;
@ -1072,6 +1075,7 @@ bool GFXGLShader::initShader( const Torque::Path &file,
/// Returns our list of shader constants, the material can get this and just set the constants it knows about
const Vector<GFXShaderConstDesc>& GFXGLShader::getShaderConstDesc() const
{
PROFILE_SCOPE(GFXGLShader_GetShaderConstants);
return mConstants;
}