Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
f964e51f
Commit
f964e51f
authored
11 years ago
by
David Parks
Browse files
Options
Downloads
Patches
Plain Diff
Fix for mac build
parent
7ed3d61d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/llrender/llglslshader.cpp
+15
-9
15 additions, 9 deletions
indra/llrender/llglslshader.cpp
with
15 additions
and
9 deletions
indra/llrender/llglslshader.cpp
+
15
−
9
View file @
f964e51f
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment