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
71b0a63c
Commit
71b0a63c
authored
14 years ago
by
David Parks
Browse files
Options
Downloads
Patches
Plain Diff
Optimize LLViewerJointMesh::updateFaceData
parent
b0554832
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/llcommon/llstrider.h
+1
-1
1 addition, 1 deletion
indra/llcommon/llstrider.h
indra/newview/lldrawpoolavatar.cpp
+1
-1
1 addition, 1 deletion
indra/newview/lldrawpoolavatar.cpp
indra/newview/llviewerjointmesh.cpp
+69
-19
69 additions, 19 deletions
indra/newview/llviewerjointmesh.cpp
with
71 additions
and
21 deletions
indra/llcommon/llstrider.h
+
1
−
1
View file @
71b0a63c
...
...
@@ -51,7 +51,7 @@ template <class Object> class LLStrider
void
setStride
(
S32
skipBytes
)
{
mSkip
=
(
skipBytes
?
skipBytes
:
sizeof
(
Object
));}
void
skip
(
const
U32
index
)
{
mBytep
+=
mSkip
*
index
;}
U32
getSkip
()
const
{
return
mSkip
;
}
Object
*
get
()
{
return
mObjectp
;
}
Object
*
operator
->
()
{
return
mObjectp
;
}
Object
&
operator
*
()
{
return
*
mObjectp
;
}
...
...
This diff is collapsed.
Click to expand it.
indra/newview/lldrawpoolavatar.cpp
+
1
−
1
View file @
71b0a63c
...
...
@@ -123,7 +123,7 @@ void LLDrawPoolAvatar::prerender()
if
(
sShaderLevel
>
0
)
{
sBufferUsage
=
GL_
STAT
IC_DRAW_ARB
;
sBufferUsage
=
GL_
DYNAM
IC_DRAW_ARB
;
}
else
{
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llviewerjointmesh.cpp
+
69
−
19
View file @
71b0a63c
...
...
@@ -661,6 +661,8 @@ void LLViewerJointMesh::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32
//-----------------------------------------------------------------------------
// updateFaceData()
//-----------------------------------------------------------------------------
static
LLFastTimer
::
DeclareTimer
FTM_AVATAR_FACE
(
"Avatar Face"
);
void
LLViewerJointMesh
::
updateFaceData
(
LLFace
*
face
,
F32
pixel_area
,
BOOL
damp_wind
)
{
mFace
=
face
;
...
...
@@ -670,6 +672,8 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w
return
;
}
LLFastTimer
t
(
FTM_AVATAR_FACE
);
LLStrider
<
LLVector3
>
verticesp
;
LLStrider
<
LLVector3
>
normalsp
;
LLStrider
<
LLVector2
>
tex_coordsp
;
...
...
@@ -688,30 +692,76 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w
face
->
mVertexBuffer
->
getIndexStrider
(
indicesp
);
stop_glerror
();
for
(
U16
i
=
0
;
i
<
mMesh
->
getNumVertices
();
i
++
)
verticesp
+=
mMesh
->
mFaceVertexOffset
;
tex_coordsp
+=
mMesh
->
mFaceVertexOffset
;
normalsp
+=
mMesh
->
mFaceVertexOffset
;
vertex_weightsp
+=
mMesh
->
mFaceVertexOffset
;
clothing_weightsp
+=
mMesh
->
mFaceVertexOffset
;
U32
*
__restrict
v
=
(
U32
*
)
verticesp
.
get
();
const
U32
vert_skip
=
verticesp
.
getSkip
()
/
sizeof
(
U32
);
U32
*
__restrict
tc
=
(
U32
*
)
tex_coordsp
.
get
();
const
U32
tc_skip
=
tex_coordsp
.
getSkip
()
/
sizeof
(
U32
);
U32
*
__restrict
n
=
(
U32
*
)
normalsp
.
get
();
const
U32
n_skip
=
normalsp
.
getSkip
()
/
sizeof
(
U32
);
U32
*
__restrict
vw
=
(
U32
*
)
vertex_weightsp
.
get
();
const
U32
vw_skip
=
vertex_weightsp
.
getSkip
()
/
sizeof
(
U32
);
U32
*
__restrict
cw
=
(
U32
*
)
clothing_weightsp
.
get
();
const
U32
cw_skip
=
vertex_weightsp
.
getSkip
()
/
sizeof
(
U32
);
const
U32
*
__restrict
coords
=
(
U32
*
)
mMesh
->
getCoords
();
const
U32
*
__restrict
tex_coords
=
(
U32
*
)
mMesh
->
getTexCoords
();
const
U32
*
__restrict
normals
=
(
U32
*
)
mMesh
->
getNormals
();
const
U32
*
__restrict
weights
=
(
U32
*
)
mMesh
->
getWeights
();
const
U32
*
__restrict
cloth_weights
=
(
U32
*
)
mMesh
->
getClothingWeights
();
const
U32
num_verts
=
mMesh
->
getNumVertices
();
U32
i
=
0
;
do
{
verticesp
[
mMesh
->
mFaceVertexOffset
+
i
]
=
*
(
mMesh
->
getCoords
()
+
i
);
tex_coordsp
[
mMesh
->
mFaceVertexOffset
+
i
]
=
*
(
mMesh
->
getTexCoords
()
+
i
);
normalsp
[
mMesh
->
mFaceVertexOffset
+
i
]
=
*
(
mMesh
->
getNormals
()
+
i
);
vertex_weightsp
[
mMesh
->
mFaceVertexOffset
+
i
]
=
*
(
mMesh
->
getWeights
()
+
i
);
if
(
damp_wind
)
{
clothing_weightsp
[
mMesh
->
mFaceVertexOffset
+
i
]
=
LLVector4
(
0
,
0
,
0
,
0
);
}
else
{
clothing_weightsp
[
mMesh
->
mFaceVertexOffset
+
i
]
=
(
*
(
mMesh
->
getClothingWeights
()
+
i
));
}
v
[
0
]
=
*
(
coords
++
);
v
[
1
]
=
*
(
coords
++
);
v
[
2
]
=
*
(
coords
++
);
v
+=
vert_skip
;
tc
[
0
]
=
*
(
tex_coords
++
);
tc
[
1
]
=
*
(
tex_coords
++
);
tc
+=
tc_skip
;
n
[
0
]
=
*
(
normals
++
);
n
[
1
]
=
*
(
normals
++
);
n
[
2
]
=
*
(
normals
++
);
n
+=
n_skip
;
vw
[
0
]
=
*
(
weights
++
);
vw
+=
vw_skip
;
cw
[
0
]
=
*
(
cloth_weights
++
);
cw
[
1
]
=
*
(
cloth_weights
++
);
cw
[
2
]
=
*
(
cloth_weights
++
);
cw
[
3
]
=
*
(
cloth_weights
++
);
cw
+=
cw_skip
;
}
while
(
++
i
<
num_verts
);
const
U32
idx_count
=
mMesh
->
getNumFaces
()
*
3
;
for
(
S32
i
=
0
;
i
<
mMesh
->
getNumFaces
();
i
++
)
U16
*
__restrict
idx
=
indicesp
.
get
();
S32
*
__restrict
src_idx
=
(
S32
*
)
mMesh
->
getFaces
();
i
=
0
;
do
{
for
(
U32
j
=
0
;
j
<
3
;
j
++
)
{
U32
k
=
i
*
3
+
j
+
mMesh
->
mFaceIndexOffset
;
indicesp
[
k
]
=
mMesh
->
getFaces
()[
i
][
j
]
+
mMesh
->
mFaceVertexOffset
;
}
*
(
idx
++
)
=
*
(
src_idx
++
);
}
while
(
++
i
<
idx_count
);
}
}
}
...
...
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