Skip to content
Snippets Groups Projects
Commit f964e51f authored by David Parks's avatar David Parks
Browse files

Fix for mac build

parent 7ed3d61d
No related branches found
No related tags found
No related merge requests found
...@@ -110,6 +110,14 @@ void LLGLSLShader::initProfile() ...@@ -110,6 +110,14 @@ void LLGLSLShader::initProfile()
} }
struct LLGLSLShaderCompareTimeElapsed
{
bool operator()(const LLGLSLShader* const& lhs, const LLGLSLShader* const& rhs)
{
return lhs->mTimeElapsed < rhs->mTimeElapsed;
}
};
//static //static
void LLGLSLShader::finishProfile() void LLGLSLShader::finishProfile()
{ {
...@@ -122,15 +130,7 @@ void LLGLSLShader::finishProfile() ...@@ -122,15 +130,7 @@ void LLGLSLShader::finishProfile()
sorted.push_back(*iter); sorted.push_back(*iter);
} }
struct comp_func std::sort(sorted.begin(), sorted.end(), LLGLSLShaderCompareTimeElapsed());
{
bool operator()(const LLGLSLShader* const& lhs, const LLGLSLShader* const& rhs)
{
return lhs->mTimeElapsed < rhs->mTimeElapsed;
}
} func;
std::sort(sorted.begin(), sorted.end(), func);
for (std::vector<LLGLSLShader*>::iterator iter = sorted.begin(); iter != sorted.end(); ++iter) for (std::vector<LLGLSLShader*>::iterator iter = sorted.begin(); iter != sorted.end(); ++iter)
{ {
...@@ -205,6 +205,7 @@ void LLGLSLShader::stopProfile(U32 count, U32 mode) ...@@ -205,6 +205,7 @@ void LLGLSLShader::stopProfile(U32 count, U32 mode)
void LLGLSLShader::placeProfileQuery() void LLGLSLShader::placeProfileQuery()
{ {
#if !LL_DARWIN
if (mTimerQuery == 0) if (mTimerQuery == 0)
{ {
glGenQueriesARB(1, &mTimerQuery); glGenQueriesARB(1, &mTimerQuery);
...@@ -212,10 +213,12 @@ void LLGLSLShader::placeProfileQuery() ...@@ -212,10 +213,12 @@ void LLGLSLShader::placeProfileQuery()
glBeginQueryARB(GL_SAMPLES_PASSED, 1); glBeginQueryARB(GL_SAMPLES_PASSED, 1);
glBeginQueryARB(GL_TIME_ELAPSED, mTimerQuery); glBeginQueryARB(GL_TIME_ELAPSED, mTimerQuery);
#endif
} }
void LLGLSLShader::readProfileQuery(U32 count, U32 mode) void LLGLSLShader::readProfileQuery(U32 count, U32 mode)
{ {
#if !LL_DARWIN
glEndQueryARB(GL_TIME_ELAPSED); glEndQueryARB(GL_TIME_ELAPSED);
glEndQueryARB(GL_SAMPLES_PASSED); glEndQueryARB(GL_SAMPLES_PASSED);
...@@ -245,6 +248,7 @@ void LLGLSLShader::readProfileQuery(U32 count, U32 mode) ...@@ -245,6 +248,7 @@ void LLGLSLShader::readProfileQuery(U32 count, U32 mode)
sTotalDrawCalls++; sTotalDrawCalls++;
mDrawCalls++; mDrawCalls++;
#endif
} }
...@@ -512,6 +516,7 @@ void LLGLSLShader::mapUniform(GLint index, const vector<string> * uniforms) ...@@ -512,6 +516,7 @@ void LLGLSLShader::mapUniform(GLint index, const vector<string> * uniforms)
glGetActiveUniformARB(mProgramObject, index, 1024, &length, &size, &type, (GLcharARB *)name); glGetActiveUniformARB(mProgramObject, index, 1024, &length, &size, &type, (GLcharARB *)name);
#if !LL_DARWIN
if (size > 0) if (size > 0)
{ {
switch(type) switch(type)
...@@ -553,6 +558,7 @@ void LLGLSLShader::mapUniform(GLint index, const vector<string> * uniforms) ...@@ -553,6 +558,7 @@ void LLGLSLShader::mapUniform(GLint index, const vector<string> * uniforms)
} }
mTotalUniformSize += size; mTotalUniformSize += size;
} }
#endif
S32 location = glGetUniformLocationARB(mProgramObject, name); S32 location = glGetUniformLocationARB(mProgramObject, name);
if (location != -1) if (location != -1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment