summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-10-07 03:12:11 -0500
committerDave Parks <davep@lindenlab.com>2011-10-07 03:12:11 -0500
commit79912f9d3f0807529183521f69f989f947c1cff1 (patch)
treeeebfd21524f2e70d550397edfccdfcaefd6ab290 /indra/newview/pipeline.cpp
parentc834bdd05a134d6b3442a31f351a94f21965d4e9 (diff)
SH-2031 Profile guided optimization of matrix ops
- don't use F64 except where needed (should really factor out calls to gluProject) - get rid of sorting by texture in favor of sorting by matrix (no sort needed, geometry is already matrix sorted as a result of frustum cull tree traversal order) - unroll matrix sync inner loop and cache MVP and normal matrices
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r--indra/newview/pipeline.cpp28
1 files changed, 6 insertions, 22 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index d28bb1f64e..42873dbca8 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -201,13 +201,10 @@ U32 nhpo2(U32 v)
return r;
}
-glh::matrix4f glh_copy_matrix(GLdouble* src)
+glh::matrix4f glh_copy_matrix(F32* src)
{
glh::matrix4f ret;
- for (U32 i = 0; i < 16; i++)
- {
- ret.m[i] = (F32) src[i];
- }
+ ret.set_value(src);
return ret;
}
@@ -231,7 +228,7 @@ glh::matrix4f glh_get_last_projection()
return glh_copy_matrix(gGLLastProjection);
}
-void glh_copy_matrix(const glh::matrix4f& src, GLdouble* dst)
+void glh_copy_matrix(const glh::matrix4f& src, F32* dst)
{
for (U32 i = 0; i < 16; i++)
{
@@ -3171,19 +3168,6 @@ void LLPipeline::postSort(LLCamera& camera)
if (!sShadowRender)
{
- //sort by texture or bump map
- for (U32 i = 0; i < LLRenderPass::NUM_RENDER_TYPES; ++i)
- {
- if (i == LLRenderPass::PASS_BUMP)
- {
- std::sort(sCull->beginRenderMap(i), sCull->endRenderMap(i), LLDrawInfo::CompareBump());
- }
- else
- {
- std::sort(sCull->beginRenderMap(i), sCull->endRenderMap(i), LLDrawInfo::CompareTexturePtrMatrix());
- }
- }
-
std::sort(sCull->beginAlphaGroups(), sCull->endAlphaGroups(), LLSpatialGroup::CompareDepthGreater());
}
llpushcallstacks ;
@@ -3503,8 +3487,8 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
assertInitialized();
- F64 saved_modelview[16];
- F64 saved_projection[16];
+ F32 saved_modelview[16];
+ F32 saved_projection[16];
//HACK: preserve/restore matrices around HUD render
if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD))
@@ -6768,7 +6752,7 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, U32 n
{
cube_map->enable(channel);
cube_map->bind();
- F64* m = gGLModelView;
+ F32* m = gGLModelView;
F32 mat[] = { m[0], m[1], m[2],