diff options
author | Euclid Linden <euclid@lindenlab.com> | 2022-05-27 21:15:49 +0000 |
---|---|---|
committer | Euclid Linden <euclid@lindenlab.com> | 2022-05-27 21:15:49 +0000 |
commit | 3f98411c56f4daa06c9102346a8dd37af18d2cb6 (patch) | |
tree | 4255c2827cc3e07921275bfd7937f4f43f29d5fa /indra/newview/lldrawpooltree.cpp | |
parent | 3f58ec2fdfb76ce2160884a3e97be49f60b6ac90 (diff) | |
parent | 02c71b0ac2f99dd1c26a649ffce2182b2fc9a7d9 (diff) |
Merged in DV528-merge-6.6.1 (pull request #1000)
DRTVWR-528 merge up to 6.6.1
Diffstat (limited to 'indra/newview/lldrawpooltree.cpp')
-rw-r--r-- | indra/newview/lldrawpooltree.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index 0d5195bdbf..facfb235c9 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -42,7 +42,6 @@ S32 LLDrawPoolTree::sDiffTex = 0; static LLGLSLShader* shader = NULL; -static LLTrace::BlockTimerStatHandle FTM_SHADOW_TREE("Tree Shadow"); LLDrawPoolTree::LLDrawPoolTree(LLViewerTexture *texturep) : LLFacePool(POOL_TREE), @@ -69,7 +68,7 @@ void LLDrawPoolTree::beginRenderPass(S32 pass) shader = &gTreeProgram; } - if (gPipeline.canUseVertexShaders()) + if (gPipeline.shadersLoaded()) { shader->bind(); shader->setMinimumAlpha(0.5f); @@ -78,23 +77,24 @@ void LLDrawPoolTree::beginRenderPass(S32 pass) else { gPipeline.enableLightsDynamic(); - gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); + gGL.flush(); } } void LLDrawPoolTree::render(S32 pass) { - LL_RECORD_BLOCK_TIME(LLPipeline::sShadowRender ? FTM_SHADOW_TREE : FTM_RENDER_TREES); + LL_PROFILE_ZONE_SCOPED; if (mDrawFace.empty()) { return; } - LLGLState test(GL_ALPHA_TEST, LLGLSLShader::sNoFixedFunction ? 0 : 1); + LLGLState test(GL_ALPHA_TEST, 0); + + gGL.getTexUnit(sDiffTex)->bindFast(mTexturep); + gPipeline.touchTexture(mTexturep, 1024.f * 1024.f); // <=== keep Linden tree textures at full res - gGL.getTexUnit(sDiffTex)->bind(mTexturep); - for (std::vector<LLFace*>::iterator iter = mDrawFace.begin(); iter != mDrawFace.end(); iter++) { @@ -117,9 +117,8 @@ void LLDrawPoolTree::render(S32 pass) gPipeline.mMatrixOpCount++; } - buff->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK); - buff->drawRange(LLRender::TRIANGLES, 0, buff->getNumVerts()-1, buff->getNumIndices(), 0); - gPipeline.addTrianglesDrawn(buff->getNumIndices()); + buff->setBufferFast(LLDrawPoolTree::VERTEX_DATA_MASK); + buff->drawRangeFast(LLRender::TRIANGLES, 0, buff->getNumVerts()-1, buff->getNumIndices(), 0); } } } @@ -135,7 +134,7 @@ void LLDrawPoolTree::endRenderPass(S32 pass) if (mShaderLevel <= 0) { - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); + gGL.flush(); } } @@ -153,6 +152,7 @@ void LLDrawPoolTree::beginDeferredPass(S32 pass) void LLDrawPoolTree::renderDeferred(S32 pass) { + LL_PROFILE_ZONE_SCOPED; render(pass); } @@ -168,7 +168,7 @@ void LLDrawPoolTree::endDeferredPass(S32 pass) //============================================ void LLDrawPoolTree::beginShadowPass(S32 pass) { - LL_RECORD_BLOCK_TIME(FTM_SHADOW_TREE); + LL_PROFILE_ZONE_SCOPED; glPolygonOffset(gSavedSettings.getF32("RenderDeferredTreeShadowOffset"), gSavedSettings.getF32("RenderDeferredTreeShadowBias")); @@ -187,7 +187,7 @@ void LLDrawPoolTree::renderShadow(S32 pass) void LLDrawPoolTree::endShadowPass(S32 pass) { - LL_RECORD_BLOCK_TIME(FTM_SHADOW_TREE); + LL_PROFILE_ZONE_SCOPED; glPolygonOffset(gSavedSettings.getF32("RenderDeferredSpotShadowOffset"), gSavedSettings.getF32("RenderDeferredSpotShadowBias")); |