summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2008-04-28 23:29:46 +0000
committerSteven Bennetts <steve@lindenlab.com>2008-04-28 23:29:46 +0000
commit16baf6c9d43fc29e697b5a460439ca664897450c (patch)
tree6c3ae45c538cbc90408ab72f3a02564cf5dce754 /indra/newview
parent75ee8558abb662b6a0a6b559c61a9549818d2962 (diff)
merge release-QAR-499 Viewer 1.20 RC 3
merge release-QAR-508 Viewer 1.20 RC 4 merge Branch_1-20-Viewer -r 85278 : 85828 -> release
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml13
-rw-r--r--indra/newview/llappviewer.cpp102
-rw-r--r--indra/newview/llcylinder.cpp1
-rw-r--r--indra/newview/lldrawable.cpp7
-rw-r--r--indra/newview/lldrawpool.cpp29
-rw-r--r--indra/newview/lldrawpool.h5
-rw-r--r--indra/newview/lldrawpoolalpha.cpp17
-rw-r--r--indra/newview/lldrawpoolavatar.cpp32
-rw-r--r--indra/newview/lldrawpoolbump.cpp40
-rw-r--r--indra/newview/lldrawpoolground.cpp3
-rw-r--r--indra/newview/lldrawpoolsimple.cpp11
-rw-r--r--indra/newview/lldrawpoolsky.cpp10
-rw-r--r--indra/newview/lldrawpoolterrain.cpp108
-rw-r--r--indra/newview/lldrawpooltree.cpp13
-rw-r--r--indra/newview/lldrawpoolwater.cpp33
-rw-r--r--indra/newview/lldrawpoolwlsky.cpp11
-rw-r--r--indra/newview/lldynamictexture.cpp6
-rw-r--r--indra/newview/llface.cpp67
-rw-r--r--indra/newview/llface.h2
-rw-r--r--indra/newview/llflexibleobject.cpp18
-rw-r--r--indra/newview/llflexibleobject.h2
-rw-r--r--indra/newview/llfloateranimpreview.cpp4
-rw-r--r--indra/newview/llfloaterauction.cpp3
-rw-r--r--indra/newview/llfloaterhud.cpp26
-rw-r--r--indra/newview/llfloaterhud.h2
-rw-r--r--indra/newview/llfloaterimagepreview.cpp8
-rw-r--r--indra/newview/llglsandbox.cpp35
-rw-r--r--indra/newview/llimpanel.cpp4
-rw-r--r--indra/newview/llmemoryview.cpp2
-rw-r--r--indra/newview/llpanellogin.cpp1
-rw-r--r--indra/newview/llspatialpartition.cpp21
-rw-r--r--indra/newview/lltexlayer.cpp4
-rw-r--r--indra/newview/lltoolmorph.cpp5
-rw-r--r--indra/newview/llviewerdisplay.cpp13
-rw-r--r--indra/newview/llviewerjointmesh.cpp29
-rw-r--r--indra/newview/llviewerkeyboard.cpp22
-rw-r--r--indra/newview/llviewermenu.cpp4
-rw-r--r--indra/newview/llviewermessage.cpp2
-rw-r--r--indra/newview/llvotree.cpp6
-rw-r--r--indra/newview/llvovolume.cpp26
-rw-r--r--indra/newview/llvowlsky.cpp33
-rw-r--r--indra/newview/pipeline.cpp58
-rw-r--r--indra/newview/pipeline.h3
43 files changed, 289 insertions, 552 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 41566d68d0..73a832ead7 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -5829,7 +5829,7 @@
<key>RenderUseCleverUI</key>
<map>
<key>Comment</key>
- <string>Turns on the \"clever\" UI rendering optimization. It's a known performace gain (and enabled by default) on apple.</string>
+ <string>Turns on the \"clever\" UI rendering optimization. It's a known performace gain on apple.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@@ -9825,17 +9825,6 @@
<integer>0</integer>
</array>
</map>
- <key>AlertedUnsupportedHardware</key>
- <map>
- <key>Comment</key>
- <string>Toggle that lets us tell the user he's on old hardware only once</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>0</integer>
- </map>
<key>RenderFastAlpha</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 572927f918..ee471d21ac 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -64,6 +64,7 @@
#include "llurldispatcher.h"
#include "llurlhistory.h"
#include "llfirstuse.h"
+#include "llglimmediate.h"
#include "llweb.h"
#include "llsecondlifeurls.h"
@@ -416,10 +417,11 @@ static void settings_to_globals()
static void settings_modify()
{
LLRenderTarget::sUseFBO = gSavedSettings.getBOOL("RenderUseFBO");
- LLVOAvatar::sUseImpostors = FALSE; //gSavedSettings.getBOOL("RenderUseImpostors");
+ LLVOAvatar::sUseImpostors = gSavedSettings.getBOOL("RenderUseImpostors");
LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor");
LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //sqaure lod factor to get exponential range of [1,4]
-
+ gGL.setClever(gSavedSettings.getBOOL("RenderUseCleverUI"));
+
#if LL_VECTORIZE
if (gSysCPU.hasAltivec())
{
@@ -774,15 +776,6 @@ bool LLAppViewer::init()
return 1;
}
-#if LL_DARWIN
- // Display the release notes for the current version
- if(!gHideLinks && gCurrentVersion != gLastRunVersion)
- {
- // Current version and last run version don't match exactly. Display the release notes.
- DisplayReleaseNotes();
- }
-#endif
-
//
// Initialize the window
//
@@ -821,51 +814,55 @@ bool LLAppViewer::init()
return 0;
}
- // alert the user if they are using unsupported hardware
- if(!gSavedSettings.getBOOL("AlertedUnsupportedHardware"))
- {
- bool unsupported = false;
- LLString::format_map_t args;
- LLString minSpecs;
+
+ bool unsupported = false;
+ LLString::format_map_t args;
+ LLString minSpecs;
- // get cpu data from xml
- std::stringstream minCPUString(LLAlertDialog::getTemplateMessage("UnsupportedCPUAmount"));
- S32 minCPU = 0;
- minCPUString >> minCPU;
-
- // get RAM data from XML
- std::stringstream minRAMString(LLAlertDialog::getTemplateMessage("UnsupportedRAMAmount"));
- U64 minRAM = 0;
- minRAMString >> minRAM;
- minRAM = minRAM * 1024 * 1024;
-
- if(!LLFeatureManager::getInstance()->isGPUSupported())
- {
- minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedGPU");
- minSpecs += "\n";
- unsupported = true;
- }
- if(gSysCPU.getMhz() < minCPU)
- {
- minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedCPU");
- minSpecs += "\n";
- unsupported = true;
- }
- if(gSysMemory.getPhysicalMemoryClamped() < minRAM)
- {
- minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedRAM");
- minSpecs += "\n";
- unsupported = true;
- }
+ // get cpu data from xml
+ std::stringstream minCPUString(LLAlertDialog::getTemplateMessage("UnsupportedCPUAmount"));
+ S32 minCPU = 0;
+ minCPUString >> minCPU;
+
+ // get RAM data from XML
+ std::stringstream minRAMString(LLAlertDialog::getTemplateMessage("UnsupportedRAMAmount"));
+ U64 minRAM = 0;
+ minRAMString >> minRAM;
+ minRAM = minRAM * 1024 * 1024;
+
+ if(!LLFeatureManager::getInstance()->isGPUSupported() && LLFeatureManager::getInstance()->getGPUClass() != GPU_CLASS_UNKNOWN)
+ {
+ minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedGPU");
+ minSpecs += "\n";
+ unsupported = true;
+ }
+ if(gSysCPU.getMhz() < minCPU)
+ {
+ minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedCPU");
+ minSpecs += "\n";
+ unsupported = true;
+ }
+ if(gSysMemory.getPhysicalMemoryClamped() < minRAM)
+ {
+ minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedRAM");
+ minSpecs += "\n";
+ unsupported = true;
+ }
- if(unsupported)
+ if (LLFeatureManager::getInstance()->getGPUClass() == GPU_CLASS_UNKNOWN)
+ {
+ gViewerWindow->alertXml("UnknownGPU");
+ }
+
+ if(unsupported)
+ {
+ if(!gSavedSettings.controlExists("WarnUnsupportedHardware")
+ || gSavedSettings.getBOOL("WarnUnsupportedHardware"))
{
args["MINSPECS"] = minSpecs;
gViewerWindow->alertXml("UnsupportedHardware", args );
-
- // turn off flag
- gSavedSettings.setBOOL("AlertedUnsupportedHardware", TRUE);
}
+
}
// Save the current version to the prefs file
@@ -1452,10 +1449,13 @@ void LLAppViewer::loadSettingsFromDirectory(ELLPath path_index)
LLString full_settings_path = gDirUtilp->getExpandedFilename(path_index, settings_file);
- if(settings_name == sGlobalSettingsName)
+ if(settings_name == sGlobalSettingsName
+ && path_index == LL_PATH_USER_SETTINGS)
{
// The non-persistent setting, ClientSettingsFile, specifies a
// custom name to use for the global settings file.
+ // Only apply this setting if this method is setting the 'Global'
+ // settings from the user_settings path.
std::string custom_path;
if(gSettings[sGlobalSettingsName]->controlExists("ClientSettingsFile"))
{
diff --git a/indra/newview/llcylinder.cpp b/indra/newview/llcylinder.cpp
index 58a80c21e4..82db7788d6 100644
--- a/indra/newview/llcylinder.cpp
+++ b/indra/newview/llcylinder.cpp
@@ -255,7 +255,6 @@ void LLCone::render(S32 level_of_detail)
// center object at 0
glTranslatef(0.f, 0.f, - height / 2.0f);
- LLVertexBuffer::unbind();
drawSide(level_of_detail);
drawBottom(level_of_detail);
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index 198c235a1e..06536660e2 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -1188,10 +1188,11 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>*
LLVector3 center = (mExtents[0] + mExtents[1]) * 0.5f;
LLVector3 size = (mExtents[1]-mExtents[0]) * 0.5f;
- if (camera_in.AABBInFrustumNoFarClip(center, size) &&
- AABBSphereIntersect(mExtents[0], mExtents[1], camera_in.getOrigin(), camera_in.mFrustumCornerDist))
+ if (LLPipeline::sImpostorRender ||
+ (camera_in.AABBInFrustumNoFarClip(center, size) &&
+ AABBSphereIntersect(mExtents[0], mExtents[1], camera_in.getOrigin(), camera_in.mFrustumCornerDist)))
{
- if (LLPipeline::calcPixelArea(center, size, camera_in) < FORCE_INVISIBLE_AREA)
+ if (!LLPipeline::sImpostorRender && LLPipeline::calcPixelArea(center, size, camera_in) < FORCE_INVISIBLE_AREA)
{
return;
}
diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp
index c987f3e035..6cd2152a28 100644
--- a/indra/newview/lldrawpool.cpp
+++ b/indra/newview/lldrawpool.cpp
@@ -115,7 +115,6 @@ LLDrawPool::LLDrawPool(const U32 type)
sNumDrawPools++;
mId = sNumDrawPools;
mVertexShaderLevel = 0;
- mIndicesDrawn = 0;
}
LLDrawPool::~LLDrawPool()
@@ -136,24 +135,6 @@ void LLDrawPool::beginRenderPass( S32 pass )
//virtual
void LLDrawPool::endRenderPass( S32 pass )
{
- glDisableClientState ( GL_TEXTURE_COORD_ARRAY );
- glDisableClientState ( GL_COLOR_ARRAY );
- glDisableClientState ( GL_NORMAL_ARRAY );
-}
-
-U32 LLDrawPool::getTrianglesDrawn() const
-{
- return mIndicesDrawn / 3;
-}
-
-void LLDrawPool::resetTrianglesDrawn()
-{
- mIndicesDrawn = 0;
-}
-
-void LLDrawPool::addIndicesDrawn(const U32 indices)
-{
- mIndicesDrawn += indices;
}
//=============================
@@ -224,7 +205,7 @@ void LLFacePool::drawLoop()
{
if (!mDrawFace.empty())
{
- mIndicesDrawn += drawLoop(mDrawFace);
+ drawLoop(mDrawFace);
}
}
@@ -382,10 +363,6 @@ void LLRenderPass::renderTexture(U32 type, U32 mask)
void LLRenderPass::pushBatches(U32 type, U32 mask, BOOL texture)
{
-#if !LL_RELEASE_FOR_DOWNLOAD
- LLGLState::checkClientArrays(mask);
-#endif
-
for (LLCullResult::drawinfo_list_t::iterator i = gPipeline.beginRenderMap(type); i != gPipeline.endRenderMap(type); ++i)
{
LLDrawInfo* pparams = *i;
@@ -436,9 +413,7 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture)
if (params.mVertexBuffer.notNull())
{
params.mVertexBuffer->setBuffer(mask);
- U16* indices_pointer = (U16*) params.mVertexBuffer->getIndicesPointer();
- glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
- GL_UNSIGNED_SHORT, indices_pointer+params.mOffset);
+ params.mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset);
gPipeline.addTrianglesDrawn(params.mCount/3);
}
diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h
index 30a16a24ba..3bd1f686d1 100644
--- a/indra/newview/lldrawpool.h
+++ b/indra/newview/lldrawpool.h
@@ -90,15 +90,10 @@ public:
virtual BOOL isFacePool() { return FALSE; }
virtual void resetDrawOrders() = 0;
- U32 getTrianglesDrawn() const;
- void resetTrianglesDrawn();
- void addIndicesDrawn(const U32 indices);
-
protected:
S32 mVertexShaderLevel;
S32 mId;
U32 mType; // Type of draw pool
- S32 mIndicesDrawn;
};
class LLRenderPass : public LLDrawPool
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index d22c459278..795f6bc396 100644
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -77,9 +77,6 @@ void LLDrawPoolAlpha::prerender()
void LLDrawPoolAlpha::beginRenderPass(S32 pass)
{
LLFastTimer t(LLFastTimer::FTM_RENDER_ALPHA);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
- glEnableClientState(GL_COLOR_ARRAY);
if (LLPipeline::sUnderWaterRender)
{
@@ -128,8 +125,6 @@ void LLDrawPoolAlpha::render(S32 pass)
{
glUseProgramObjectARB(0);
}
- glDisableClientState(GL_NORMAL_ARRAY);
- glDisableClientState(GL_COLOR_ARRAY);
gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
glColor4f(1,0,0,1);
LLViewerImage::sSmokeImagep->addTextureStats(1024.f*1024.f);
@@ -141,10 +136,6 @@ void LLDrawPoolAlpha::render(S32 pass)
void LLDrawPoolAlpha::renderAlpha(U32 mask)
{
-#if !LL_RELEASE_FOR_DOWNLOAD
- LLGLState::checkClientArrays(mask);
-#endif
-
for (LLCullResult::sg_list_t::iterator i = gPipeline.beginAlphaGroups(); i != gPipeline.endAlphaGroups(); ++i)
{
LLSpatialGroup* group = *i;
@@ -182,9 +173,7 @@ void LLDrawPoolAlpha::renderAlphaHighlight(U32 mask)
LLRenderPass::applyModelMatrix(params);
params.mVertexBuffer->setBuffer(mask);
- U16* indices_pointer = (U16*) params.mVertexBuffer->getIndicesPointer();
- glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
- GL_UNSIGNED_SHORT, indices_pointer+params.mOffset);
+ params.mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset);
gPipeline.addTrianglesDrawn(params.mCount/3);
}
}
@@ -303,9 +292,7 @@ void LLDrawPoolAlpha::renderGroupAlpha(LLSpatialGroup* group, U32 type, U32 mask
}
params.mVertexBuffer->setBuffer(mask);
- U16* indices_pointer = (U16*) params.mVertexBuffer->getIndicesPointer();
- glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
- GL_UNSIGNED_SHORT, indices_pointer+params.mOffset);
+ params.mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset);
gPipeline.addTrianglesDrawn(params.mCount/3);
if (params.mTextureMatrix && texture && params.mTexture.notNull())
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 6db67fb269..99bb2049b5 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -216,13 +216,11 @@ void LLDrawPoolAvatar::beginFootShadow()
}
gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
}
void LLDrawPoolAvatar::endFootShadow()
{
gPipeline.enableLightsDynamic();
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
void LLDrawPoolAvatar::beginRigid()
@@ -247,16 +245,11 @@ void LLDrawPoolAvatar::beginRigid()
{
sVertexProgram = NULL;
}
-
- glEnableClientState(GL_NORMAL_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
}
void LLDrawPoolAvatar::endRigid()
{
sShaderLevel = mVertexShaderLevel;
- glDisableClientState(GL_NORMAL_ARRAY);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
if (sVertexProgram != NULL)
{
sVertexProgram->unbind();
@@ -265,9 +258,6 @@ void LLDrawPoolAvatar::endRigid()
void LLDrawPoolAvatar::beginSkinned()
{
- glEnableClientState(GL_NORMAL_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-
if (sShaderLevel > 0)
{
if (LLPipeline::sUnderWaterRender)
@@ -295,8 +285,7 @@ void LLDrawPoolAvatar::beginSkinned()
if (sShaderLevel > 0) // for hardware blending
{
sRenderingSkinned = TRUE;
- glClientActiveTextureARB(GL_TEXTURE1_ARB);
-
+
sVertexProgram->bind();
if (sShaderLevel >= SHADER_LEVEL_CLOTH)
{
@@ -331,7 +320,6 @@ void LLDrawPoolAvatar::endSkinned()
sRenderingSkinned = FALSE;
sVertexProgram->disableTexture(LLShaderMgr::BUMP_MAP);
glActiveTextureARB(GL_TEXTURE0_ARB);
- glClientActiveTextureARB(GL_TEXTURE0_ARB);
disable_vertex_weighting(sVertexProgram->mAttribute[LLShaderMgr::AVATAR_WEIGHT]);
if (sShaderLevel >= SHADER_LEVEL_BUMP)
{
@@ -356,10 +344,6 @@ void LLDrawPoolAvatar::endSkinned()
}
glActiveTextureARB(GL_TEXTURE0_ARB);
- glClientActiveTextureARB(GL_TEXTURE0_ARB);
-
- glDisableClientState(GL_NORMAL_ARRAY);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
@@ -438,7 +422,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
}
else if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FOOT_SHADOWS))
{
- mIndicesDrawn += avatarp->renderFootShadows();
+ avatarp->renderFootShadows();
}
return;
}
@@ -451,7 +435,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
if (pass == 1)
{
// render rigid meshes (eyeballs) first
- mIndicesDrawn += avatarp->renderRigid();
+ avatarp->renderRigid();
return;
}
@@ -548,7 +532,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
color.setColor(1.0f, 1.0f, 1.0f, 1.0f);
}
- mIndicesDrawn += avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE);
+ avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE);
}
}
@@ -609,9 +593,6 @@ void LLDrawPoolAvatar::renderForSelect()
return;
}
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
sVertexProgram = &gAvatarPickProgram;
if (sShaderLevel > 0)
{
@@ -624,13 +605,12 @@ void LLDrawPoolAvatar::renderForSelect()
if ((sShaderLevel > 0) && !gUseGLPick) // for hardware blending
{
- glClientActiveTextureARB(GL_TEXTURE0_ARB);
sRenderingSkinned = TRUE;
sVertexProgram->bind();
enable_vertex_weighting(sVertexProgram->mAttribute[LLShaderMgr::AVATAR_WEIGHT]);
}
- mIndicesDrawn += avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE);
+ avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE);
// if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done
if ((sShaderLevel > 0) && !gUseGLPick)
@@ -645,8 +625,6 @@ void LLDrawPoolAvatar::renderForSelect()
// restore texture mode
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- glDisableClientState(GL_NORMAL_ARRAY);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
//-----------------------------------------------------------------------------
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index b35ef81803..e5c9200cad 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -316,12 +316,8 @@ void LLDrawPoolBump::beginShiny(bool invisible)
mShiny = TRUE;
sVertexMask = VERTEX_MASK_SHINY;
// Second pass: environment map
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
- glEnableClientState(GL_COLOR_ARRAY);
if (!invisible && mVertexShaderLevel > 1)
{
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
sVertexMask = VERTEX_MASK_SHINY | LLVertexBuffer::MAP_TEXCOORD;
}
@@ -456,13 +452,7 @@ void LLDrawPoolBump::endShiny(bool invisible)
LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- glDisableClientState(GL_NORMAL_ARRAY);
- glDisableClientState(GL_COLOR_ARRAY);
- if (!invisible && mVertexShaderLevel > 1)
- {
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- }
-
+
diffuse_channel = -1;
cube_channel = 0;
mShiny = FALSE;
@@ -479,10 +469,6 @@ void LLDrawPoolBump::beginFullbrightShiny()
sVertexMask = VERTEX_MASK_SHINY | LLVertexBuffer::MAP_TEXCOORD;
// Second pass: environment map
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
- glEnableClientState(GL_COLOR_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
if (LLPipeline::sUnderWaterRender)
{
@@ -564,9 +550,6 @@ void LLDrawPoolBump::endFullbrightShiny()
LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- glDisableClientState(GL_NORMAL_ARRAY);
- glDisableClientState(GL_COLOR_ARRAY);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
diffuse_channel = -1;
cube_channel = 0;
@@ -607,9 +590,7 @@ void LLDrawPoolBump::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL
applyModelMatrix(params);
params.mVertexBuffer->setBuffer(mask);
- U16* indices_pointer = (U16*) params.mVertexBuffer->getIndicesPointer();
- glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
- GL_UNSIGNED_SHORT, indices_pointer+params.mOffset);
+ params.mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset);
gPipeline.addTrianglesDrawn(params.mCount/3);
}
}
@@ -670,8 +651,6 @@ void LLDrawPoolBump::beginBump()
// TEXTURE UNIT 0
// Output.rgb = texture at texture coord 0
glActiveTextureARB(GL_TEXTURE0_ARB);
- glClientActiveTextureARB(GL_TEXTURE0_ARB);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE);
@@ -686,8 +665,6 @@ void LLDrawPoolBump::beginBump()
// TEXTURE UNIT 1
glActiveTextureARB(GL_TEXTURE1_ARB);
- glClientActiveTextureARB(GL_TEXTURE1_ARB);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_TEXTURE_2D); // Texture unit 1
@@ -752,15 +729,11 @@ void LLDrawPoolBump::endBump()
// Disable texture unit 1
glActiveTextureARB(GL_TEXTURE1_ARB);
- glClientActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D); // Texture unit 1
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
// Disable texture unit 0
glActiveTextureARB(GL_TEXTURE0_ARB);
- glClientActiveTextureARB(GL_TEXTURE0_ARB);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
gGL.blendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
@@ -1091,10 +1064,6 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerImage *src_vi, LLIma
void LLDrawPoolBump::renderBump(U32 type, U32 mask)
{
-#if !LL_RELEASE_FOR_DOWNLOAD
- LLGLState::checkClientArrays(mask);
-#endif
-
LLCullResult::drawinfo_list_t::iterator begin = gPipeline.beginRenderMap(type);
LLCullResult::drawinfo_list_t::iterator end = gPipeline.endRenderMap(type);
@@ -1178,11 +1147,8 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture)
}
params.mVertexBuffer->setBuffer(mask);
- U16* indices_pointer = (U16*) params.mVertexBuffer->getIndicesPointer();
- glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
- GL_UNSIGNED_SHORT, indices_pointer+params.mOffset);
+ params.mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset);
gPipeline.addTrianglesDrawn(params.mCount/3);
-
if (params.mTextureMatrix)
{
if (mShiny)
diff --git a/indra/newview/lldrawpoolground.cpp b/indra/newview/lldrawpoolground.cpp
index d71c6de9cd..3500d9471f 100644
--- a/indra/newview/lldrawpoolground.cpp
+++ b/indra/newview/lldrawpoolground.cpp
@@ -68,9 +68,6 @@ void LLDrawPoolGround::render(S32 pass)
return;
}
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glEnableClientState(GL_VERTEX_ARRAY);
-
LLGLSPipelineSkyBox gls_skybox;
LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp
index 174a9ac427..a2a82eada5 100644
--- a/indra/newview/lldrawpoolsimple.cpp
+++ b/indra/newview/lldrawpoolsimple.cpp
@@ -65,13 +65,10 @@ void LLDrawPoolGlow::render(S32 pass)
gPipeline.enableLightsFullbright(LLColor4(1,1,1,1));
}
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE);
renderTexture(LLRenderPass::PASS_GLOW, getVertexDataMask());
-
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-
+
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE);
gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -101,10 +98,6 @@ void LLDrawPoolSimple::prerender()
void LLDrawPoolSimple::beginRenderPass(S32 pass)
{
LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE);
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
- glEnableClientState(GL_COLOR_ARRAY);
if (LLPipeline::sUnderWaterRender)
{
@@ -136,7 +129,6 @@ void LLDrawPoolSimple::endRenderPass(S32 pass)
{
LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE);
LLRenderPass::endRenderPass(pass);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
if (mVertexShaderLevel > 0){
@@ -177,7 +169,6 @@ void LLDrawPoolSimple::render(S32 pass)
}
LLFastTimer t(LLFastTimer::FTM_RENDER_FULLBRIGHT);
U32 fullbright_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD | LLVertexBuffer::MAP_COLOR;
- glDisableClientState(GL_NORMAL_ARRAY);
renderTexture(LLRenderPass::PASS_FULLBRIGHT, fullbright_mask);
}
diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp
index d3273f2eeb..828c9b0848 100644
--- a/indra/newview/lldrawpoolsky.cpp
+++ b/indra/newview/lldrawpoolsky.cpp
@@ -113,10 +113,6 @@ void LLDrawPoolSky::render(S32 pass)
LLVector3 origin = LLViewerCamera::getInstance()->getOrigin();
glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]);
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisableClientState(GL_NORMAL_ARRAY);
-
S32 face_count = (S32)mDrawFace.size();
for (S32 i = 0; i < llmin(6, face_count); ++i)
@@ -160,8 +156,6 @@ void LLDrawPoolSky::render(S32 pass)
// renderHeavenlyBody(1, hbfaces[1]);
}
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-
glPopMatrix();
}
@@ -184,8 +178,6 @@ void LLDrawPoolSky::renderSkyCubeFace(U8 side)
glColor4f(1, 1, 1, LLSkyTex::getInterpVal()); // lighting is disabled
face.renderIndexed();
}
-
- mIndicesDrawn += face.getIndicesCount();
}
void LLDrawPoolSky::renderHeavenlyBody(U8 hb, LLFace* face)
@@ -198,7 +190,6 @@ void LLDrawPoolSky::renderHeavenlyBody(U8 hb, LLFace* face)
LLColor4 color(mHB[hb]->getInterpColor());
LLOverrideFaceColor override(this, color);
face->renderIndexed();
- mIndicesDrawn += face->getIndicesCount();
}
@@ -215,7 +206,6 @@ void LLDrawPoolSky::renderSunHalo(LLFace* face)
LLOverrideFaceColor override(this, color);
face->renderIndexed();
- mIndicesDrawn += face->getIndicesCount();
}
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index 634b502057..4747043c78 100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -217,14 +217,6 @@ void LLDrawPoolTerrain::render(S32 pass)
void LLDrawPoolTerrain::renderFullShader()
{
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
-
- if (gPipeline.getLightingDetail() >= 2)
- {
- glEnableClientState(GL_COLOR_ARRAY);
- }
-
// Hack! Get the region that this draw pool is rendering from!
LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion();
LLVLComposition *compp = regionp->getComposition();
@@ -247,10 +239,8 @@ void LLDrawPoolTerrain::renderFullShader()
//
S32 detail0 = sShader->enableTexture(LLShaderMgr::TERRAIN_DETAIL0);
LLViewerImage::bindTexture(detail_texture0p,detail0);
- glClientActiveTextureARB(GL_TEXTURE0_ARB);
glActiveTextureARB(GL_TEXTURE0_ARB);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
@@ -269,9 +259,7 @@ void LLDrawPoolTerrain::renderFullShader()
LLViewerImage::bindTexture(detail_texture1p,detail1);
/// ALPHA TEXTURE COORDS 0:
- glClientActiveTextureARB(GL_TEXTURE1_ARB);
glActiveTextureARB(GL_TEXTURE1_ARB);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
@@ -283,9 +271,7 @@ void LLDrawPoolTerrain::renderFullShader()
glEnable(GL_TEXTURE_2D);
/// ALPHA TEXTURE COORDS 1:
- glClientActiveTextureARB(GL_TEXTURE2_ARB);
glActiveTextureARB(GL_TEXTURE2_ARB);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glTranslatef(-2.f, 0.f, 0.f);
@@ -298,9 +284,7 @@ void LLDrawPoolTerrain::renderFullShader()
LLViewerImage::bindTexture(detail_texture3p,detail3);
/// ALPHA TEXTURE COORDS 2:
- glClientActiveTextureARB(GL_TEXTURE3_ARB);
glActiveTextureARB(GL_TEXTURE3_ARB);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glTranslatef(-1.f, 0.f, 0.f);
@@ -323,7 +307,6 @@ void LLDrawPoolTerrain::renderFullShader()
sShader->disableTexture(LLShaderMgr::TERRAIN_DETAIL3);
LLImageGL::unbindTexture(alpha_ramp, GL_TEXTURE_2D);
- glClientActiveTextureARB(GL_TEXTURE4_ARB);
glActiveTextureARB(GL_TEXTURE4_ARB);
glDisable(GL_TEXTURE_2D); // Texture unit 4
glDisable(GL_TEXTURE_GEN_S);
@@ -333,10 +316,8 @@ void LLDrawPoolTerrain::renderFullShader()
glMatrixMode(GL_MODELVIEW);
LLImageGL::unbindTexture(detail3, GL_TEXTURE_2D);
- glClientActiveTextureARB(GL_TEXTURE3_ARB);
glActiveTextureARB(GL_TEXTURE3_ARB);
glDisable(GL_TEXTURE_2D);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glMatrixMode(GL_TEXTURE);
@@ -344,10 +325,8 @@ void LLDrawPoolTerrain::renderFullShader()
glMatrixMode(GL_MODELVIEW);
LLImageGL::unbindTexture(detail2, GL_TEXTURE_2D);
- glClientActiveTextureARB(GL_TEXTURE2_ARB);
glActiveTextureARB(GL_TEXTURE2_ARB);
glDisable(GL_TEXTURE_2D);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glMatrixMode(GL_TEXTURE);
@@ -355,10 +334,8 @@ void LLDrawPoolTerrain::renderFullShader()
glMatrixMode(GL_MODELVIEW);
LLImageGL::unbindTexture(detail1, GL_TEXTURE_2D);
- glClientActiveTextureARB(GL_TEXTURE1_ARB);
glActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glMatrixMode(GL_TEXTURE);
@@ -369,7 +346,6 @@ void LLDrawPoolTerrain::renderFullShader()
// Restore Texture Unit 0 defaults
LLImageGL::unbindTexture(detail0, GL_TEXTURE_2D);
- glClientActiveTextureARB(GL_TEXTURE0_ARB);
glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glDisable(GL_TEXTURE_GEN_S);
@@ -377,14 +353,11 @@ void LLDrawPoolTerrain::renderFullShader()
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
-
- // Restore non Texture Unit specific defaults
- glDisableClientState(GL_NORMAL_ARRAY);
}
void LLDrawPoolTerrain::renderFull4TU()
{
- glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
// Hack! Get the region that this draw pool is rendering from!
@@ -434,9 +407,8 @@ void LLDrawPoolTerrain::renderFull4TU()
//
// Stage 1: Generate alpha ramp for detail0/detail1 transition
//
- glActiveTextureARB(GL_TEXTURE1_ARB);
LLViewerImage::bindTexture(m2DAlphaRampImagep,1);
-
+ glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D); // Texture unit 1
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
@@ -454,8 +426,8 @@ void LLDrawPoolTerrain::renderFull4TU()
//
// Stage 2: Interpolate detail1 with existing based on ramp
//
- glActiveTextureARB(GL_TEXTURE2_ARB);
LLViewerImage::bindTexture(detail_texture1p,2);
+ glActiveTextureARB(GL_TEXTURE2_ARB);
glEnable(GL_TEXTURE_2D); // Texture unit 2
glClientActiveTextureARB(GL_TEXTURE2_ARB);
@@ -480,8 +452,8 @@ void LLDrawPoolTerrain::renderFull4TU()
//
// Stage 3: Modulate with primary (vertex) color for lighting
//
- glActiveTextureARB(GL_TEXTURE3_ARB);
LLViewerImage::bindTexture(detail_texture1p,3); // bind any texture
+ glActiveTextureARB(GL_TEXTURE3_ARB);
glEnable(GL_TEXTURE_2D); // Texture unit 3
glClientActiveTextureARB(GL_TEXTURE3_ARB);
@@ -494,6 +466,7 @@ void LLDrawPoolTerrain::renderFull4TU()
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, GL_PRIMARY_COLOR_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_ARB, GL_SRC_COLOR);
+ glActiveTextureARB(GL_TEXTURE0_ARB);
// GL_BLEND disabled by default
drawLoop();
@@ -524,9 +497,8 @@ void LLDrawPoolTerrain::renderFull4TU()
//
// Stage 1: Generate alpha ramp for detail2/detail3 transition
//
- glActiveTextureARB(GL_TEXTURE1_ARB);
LLViewerImage::bindTexture(m2DAlphaRampImagep,1);
-
+ glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D); // Texture unit 1
glClientActiveTextureARB(GL_TEXTURE1_ARB);
@@ -551,8 +523,8 @@ void LLDrawPoolTerrain::renderFull4TU()
//
// Stage 2: Interpolate detail2 with existing based on ramp
//
- glActiveTextureARB(GL_TEXTURE2_ARB);
LLViewerImage::bindTexture(detail_texture2p,2);
+ glActiveTextureARB(GL_TEXTURE2_ARB);
glEnable(GL_TEXTURE_2D); // Texture unit 2
glClientActiveTextureARB(GL_TEXTURE2_ARB);
@@ -578,9 +550,9 @@ void LLDrawPoolTerrain::renderFull4TU()
//
// Stage 3: Generate alpha ramp for detail1/detail2 transition
//
- glActiveTextureARB(GL_TEXTURE3_ARB);
LLViewerImage::bindTexture(m2DAlphaRampImagep,3);
-
+ glActiveTextureARB(GL_TEXTURE3_ARB);
+
glEnable(GL_TEXTURE_2D); // Texture unit 3
glClientActiveTextureARB(GL_TEXTURE3_ARB);
@@ -603,7 +575,7 @@ void LLDrawPoolTerrain::renderFull4TU()
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_TEXTURE);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA);
-
+ glActiveTextureARB(GL_TEXTURE0_ARB);
{
LLGLEnable blend(GL_BLEND);
drawLoop();
@@ -611,6 +583,7 @@ void LLDrawPoolTerrain::renderFull4TU()
// Disable multitexture
LLImageGL::unbindTexture(3, GL_TEXTURE_2D);
+ glActiveTextureARB(GL_TEXTURE3_ARB);
glClientActiveTextureARB(GL_TEXTURE3_ARB);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_TEXTURE_2D); // Texture unit 3
@@ -619,6 +592,7 @@ void LLDrawPoolTerrain::renderFull4TU()
glMatrixMode(GL_MODELVIEW);
LLImageGL::unbindTexture(2, GL_TEXTURE_2D);
+ glActiveTextureARB(GL_TEXTURE2_ARB);
glClientActiveTextureARB(GL_TEXTURE2_ARB);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_TEXTURE_2D); // Texture unit 2
@@ -629,6 +603,7 @@ void LLDrawPoolTerrain::renderFull4TU()
glMatrixMode(GL_MODELVIEW);
LLImageGL::unbindTexture(1, GL_TEXTURE_2D);
+ glActiveTextureARB(GL_TEXTURE1_ARB);
glClientActiveTextureARB(GL_TEXTURE1_ARB);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_TEXTURE_2D); // Texture unit 1
@@ -642,6 +617,7 @@ void LLDrawPoolTerrain::renderFull4TU()
//----------------------------------------------------------------------------
// Restore Texture Unit 0 defaults
+ glActiveTextureARB(GL_TEXTURE0_ARB);
LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glActiveTextureARB(GL_TEXTURE0_ARB);
@@ -658,9 +634,6 @@ void LLDrawPoolTerrain::renderFull4TU()
void LLDrawPoolTerrain::renderFull2TU()
{
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
-
// Hack! Get the region that this draw pool is rendering from!
LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion();
LLVLComposition *compp = regionp->getComposition();
@@ -687,9 +660,6 @@ void LLDrawPoolTerrain::renderFull2TU()
// Stage 0: Render detail 0 into base
//
LLViewerImage::bindTexture(detail_texture0p,0);
- glClientActiveTextureARB(GL_TEXTURE0_ARB);
-
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
@@ -715,12 +685,10 @@ void LLDrawPoolTerrain::renderFull2TU()
// Stage 0: Generate alpha ramp for detail0/detail1 transition
//
LLViewerImage::bindTexture(m2DAlphaRampImagep,0);
- glClientActiveTextureARB(GL_TEXTURE0_ARB);
-
+
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-
+
// Care about alpha only
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE);
@@ -736,10 +704,8 @@ void LLDrawPoolTerrain::renderFull2TU()
// Stage 1: Write detail1
//
LLViewerImage::bindTexture(detail_texture1p,1); // Texture unit 1
+ glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D); // Texture unit 1
- glClientActiveTextureARB(GL_TEXTURE1_ARB);
-
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
@@ -758,6 +724,7 @@ void LLDrawPoolTerrain::renderFull2TU()
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_PREVIOUS);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA);
+ glActiveTextureARB(GL_TEXTURE0_ARB);
{
LLGLEnable blend(GL_BLEND);
drawLoop();
@@ -769,14 +736,11 @@ void LLDrawPoolTerrain::renderFull2TU()
// Stage 0: Generate alpha ramp for detail1/detail2 transition
//
LLViewerImage::bindTexture(m2DAlphaRampImagep,0);
- glClientActiveTextureARB(GL_TEXTURE0_ARB);
// Set the texture matrix
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glTranslatef(-1.f, 0.f, 0.f);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-
// Care about alpha only
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE);
@@ -793,9 +757,7 @@ void LLDrawPoolTerrain::renderFull2TU()
LLViewerImage::bindTexture(detail_texture2p,1);
glEnable(GL_TEXTURE_2D); // Texture unit 1
- glClientActiveTextureARB(GL_TEXTURE1_ARB);
-
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
@@ -826,14 +788,11 @@ void LLDrawPoolTerrain::renderFull2TU()
// Stage 0: Generate alpha ramp for detail2/detail3 transition
//
LLViewerImage::bindTexture(m2DAlphaRampImagep,0);
- glClientActiveTextureARB(GL_TEXTURE0_ARB);
// Set the texture matrix
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glTranslatef(-2.f, 0.f, 0.f);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-
// Care about alpha only
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE);
@@ -847,10 +806,8 @@ void LLDrawPoolTerrain::renderFull2TU()
// Stage 1: Write detail3
LLViewerImage::bindTexture(detail_texture3p,1);
+ glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D); // Texture unit 1
- glClientActiveTextureARB(GL_TEXTURE1_ARB);
-
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
@@ -869,6 +826,7 @@ void LLDrawPoolTerrain::renderFull2TU()
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_PREVIOUS);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA);
+ glActiveTextureARB(GL_TEXTURE0_ARB);
{
LLGLEnable blend(GL_BLEND);
drawLoop();
@@ -879,8 +837,7 @@ void LLDrawPoolTerrain::renderFull2TU()
// Disable multitexture
LLImageGL::unbindTexture(1, GL_TEXTURE_2D);
- glClientActiveTextureARB(GL_TEXTURE1_ARB);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ glActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D); // Texture unit 1
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
@@ -891,9 +848,9 @@ void LLDrawPoolTerrain::renderFull2TU()
//----------------------------------------------------------------------------
// Restore Texture Unit 0 defaults
+ glActiveTextureARB(GL_TEXTURE0_ARB);
LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
- glClientActiveTextureARB(GL_TEXTURE0_ARB);
glActiveTextureARB(GL_TEXTURE0_ARB);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
@@ -902,16 +859,12 @@ void LLDrawPoolTerrain::renderFull2TU()
glMatrixMode(GL_MODELVIEW);
// Restore non Texture Unit specific defaults
- glDisableClientState(GL_NORMAL_ARRAY);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
}
void LLDrawPoolTerrain::renderSimple()
{
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
-
LLVector4 tp0, tp1;
//----------------------------------------------------------------------------
@@ -923,14 +876,12 @@ void LLDrawPoolTerrain::renderSimple()
glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D); // Texture unit 2
- glClientActiveTextureARB(GL_TEXTURE0_ARB);
-
+
LLVector3 origin_agent = mDrawFace[0]->getDrawable()->getVObj()->getRegion()->getOriginAgent();
F32 tscale = 1.f/256.f;
tp0.setVec(tscale, 0.f, 0.0f, -1.f*(origin_agent.mV[0]/256.f));
tp1.setVec(0.f, tscale, 0.0f, -1.f*(origin_agent.mV[1]/256.f));
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
@@ -952,7 +903,6 @@ void LLDrawPoolTerrain::renderSimple()
// Restore Texture Unit 0 defaults
LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
- glClientActiveTextureARB(GL_TEXTURE0_ARB);
glActiveTextureARB(GL_TEXTURE0_ARB);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
@@ -961,7 +911,6 @@ void LLDrawPoolTerrain::renderSimple()
glMatrixMode(GL_MODELVIEW);
// Restore non Texture Unit specific defaults
- glDisableClientState(GL_NORMAL_ARRAY);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
}
@@ -986,14 +935,8 @@ void LLDrawPoolTerrain::renderOwnership()
LLViewerParcelOverlay *overlayp = regionp->getParcelOverlay();
LLImageGL *texturep = overlayp->getTexture();
- glEnableClientState(GL_VERTEX_ARRAY);
- glDisableClientState(GL_NORMAL_ARRAY);
-
LLViewerImage::bindTexture(texturep);
- glClientActiveTextureARB(GL_TEXTURE0_ARB);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-
// *NOTE: Because the region is 256 meters wide, but has 257 pixels, the
// texture coordinates for pixel 256x256 is not 1,1. This makes the
// ownership map not line up with the selection. We address this with
@@ -1014,9 +957,6 @@ void LLDrawPoolTerrain::renderOwnership()
glMatrixMode(GL_TEXTURE);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
-
- // Restore non Texture Unit specific defaults
- glDisableClientState(GL_NORMAL_ARRAY);
}
diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp
index f70904eba4..eabc0f1268 100644
--- a/indra/newview/lldrawpooltree.cpp
+++ b/indra/newview/lldrawpooltree.cpp
@@ -67,9 +67,6 @@ void LLDrawPoolTree::prerender()
void LLDrawPoolTree::beginRenderPass(S32 pass)
{
LLFastTimer t(LLFastTimer::FTM_RENDER_TREES);
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glAlphaFunc(GL_GREATER, 0.5f);
if (LLPipeline::sUnderWaterRender)
@@ -110,9 +107,7 @@ void LLDrawPoolTree::endRenderPass(S32 pass)
{
LLFastTimer t(LLFastTimer::FTM_RENDER_TREES);
glAlphaFunc(GL_GREATER, 0.01f);
- glDisableClientState(GL_NORMAL_ARRAY);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-
+
if (gPipeline.canUseWindLightShadersOnObjects())
{
shader->unbind();
@@ -126,9 +121,6 @@ void LLDrawPoolTree::renderForSelect()
return;
}
- glEnableClientState (GL_VERTEX_ARRAY);
- glEnableClientState (GL_TEXTURE_COORD_ARRAY);
-
LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f);
LLGLSObjectSelectAlpha gls_alpha;
@@ -155,7 +147,6 @@ void LLDrawPoolTree::renderForSelect()
gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- glDisableClientState (GL_TEXTURE_COORD_ARRAY);
}
void LLDrawPoolTree::renderTree(BOOL selecting)
@@ -278,8 +269,6 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
//glPopMatrix();
}
}
-
- addIndicesDrawn(indices_drawn);
}
BOOL LLDrawPoolTree::verify() const
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp
index f4e22a57f6..9ffa552895 100644
--- a/indra/newview/lldrawpoolwater.cpp
+++ b/indra/newview/lldrawpoolwater.cpp
@@ -163,17 +163,11 @@ void LLDrawPoolWater::render(S32 pass)
LLGLDisable cullFace(GL_CULL_FACE);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
-
// Set up second pass first
- glActiveTextureARB(GL_TEXTURE1_ARB);
mWaterImagep->addTextureStats(1024.f*1024.f);
mWaterImagep->bind(1);
-
- glClientActiveTextureARB(GL_TEXTURE1_ARB);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ glActiveTextureARB(GL_TEXTURE1_ARB);
+
glEnable(GL_TEXTURE_2D); // Texture unit 1
LLVector3 camera_up = LLViewerCamera::getInstance()->getUpAxis();
@@ -215,7 +209,6 @@ void LLDrawPoolWater::render(S32 pass)
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_PREVIOUS_ARB);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA);
- glClientActiveTextureARB(GL_TEXTURE0_ARB);
glActiveTextureARB(GL_TEXTURE0_ARB);
glClearStencil(1);
@@ -234,11 +227,9 @@ void LLDrawPoolWater::render(S32 pass)
}
face->bindTexture();
face->renderIndexed();
- mIndicesDrawn += face->getIndicesCount();
}
// Now, disable texture coord generation on texture state 1
- glClientActiveTextureARB(GL_TEXTURE1_ARB);
glActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D); // Texture unit 1
glDisable(GL_TEXTURE_GEN_S); //texture unit 1
@@ -246,11 +237,9 @@ void LLDrawPoolWater::render(S32 pass)
LLImageGL::unbindTexture(1, GL_TEXTURE_2D);
// Disable texture coordinate and color arrays
- glClientActiveTextureARB(GL_TEXTURE0_ARB);
glActiveTextureARB(GL_TEXTURE0_ARB);
LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
stop_glerror();
if (gSky.mVOSkyp->getCubeMap())
@@ -284,7 +273,6 @@ void LLDrawPoolWater::render(S32 pass)
if (face->getGeomCount() > 0)
{
face->renderIndexed();
- mIndicesDrawn += face->getIndicesCount();
}
}
@@ -310,9 +298,6 @@ void LLDrawPoolWater::render(S32 pass)
renderReflection(refl_face);
}
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisableClientState(GL_NORMAL_ARRAY);
-
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
}
@@ -338,16 +323,10 @@ void LLDrawPoolWater::renderReflection(LLFace* face)
LLGLSNoFog noFog;
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-
LLViewerImage::bindTexture(mHBTex[dr]);
LLOverrideFaceColor override(this, face->getFaceColor().mV);
face->renderIndexed();
- mIndicesDrawn += face->getIndicesCount();
-
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
void LLDrawPoolWater::shade()
@@ -361,10 +340,6 @@ void LLDrawPoolWater::shade()
return;
}
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
-
LLGLDisable blend(GL_BLEND);
LLColor3 light_diffuse(0,0,0);
@@ -562,8 +537,6 @@ void LLDrawPoolWater::shade()
face->renderIndexed();
}
}
-
- mIndicesDrawn += face->getIndicesCount();
}
}
@@ -576,8 +549,6 @@ void LLDrawPoolWater::shade()
shader->unbind();
glActiveTextureARB(GL_TEXTURE0_ARB);
- glClientActiveTextureARB(GL_TEXTURE0_ARB);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_TEXTURE_2D);
glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_FALSE);
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index 63d13d61d9..e2d0c6088a 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -159,9 +159,7 @@ void LLDrawPoolWLSky::renderStars(void) const
// combiners blending below requires something to be bound
// and we might as well only bind once.
//LLGLEnable gl_texture_2d(GL_TEXTURE_2D);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisableClientState(GL_NORMAL_ARRAY);
-
+
gPipeline.disableLights();
if (!LLPipeline::sReflectionRender)
@@ -224,9 +222,6 @@ void LLDrawPoolWLSky::renderSkyClouds(F32 camHeightLocal) const
void LLDrawPoolWLSky::renderHeavenlyBodies()
{
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisableClientState(GL_NORMAL_ARRAY);
LLGLSPipelineSkyBox gls_skybox;
LLGLEnable blend_on(GL_BLEND);
gPipeline.disableLights();
@@ -240,7 +235,6 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
LLColor4 color(gSky.mVOSkyp->getSun().getInterpColor());
LLFacePool::LLOverrideFaceColor color_override(this, color);
face->renderIndexed();
- mIndicesDrawn += face->getIndicesCount();
}
#endif
@@ -264,10 +258,7 @@ void LLDrawPoolWLSky::renderHeavenlyBodies()
LLFacePool::LLOverrideFaceColor color_override(this, color);
face->renderIndexed();
- mIndicesDrawn += face->getIndicesCount();
}
-
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
void LLDrawPoolWLSky::render(S32 pass)
diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp
index 24ee701ff2..cdb7531341 100644
--- a/indra/newview/lldynamictexture.cpp
+++ b/indra/newview/lldynamictexture.cpp
@@ -223,17 +223,15 @@ BOOL LLDynamicTexture::updateAllInstances()
glClear(GL_DEPTH_BUFFER_BIT);
gDisplaySwapBuffers = FALSE;
- LLVertexBuffer::startRender();
- gGL.start();
-
dynamicTexture->preRender(); // Must be called outside of startRender()
+ LLVertexBuffer::startRender();
+
if (dynamicTexture->render())
{
result = TRUE;
sNumRenders++;
}
- gGL.stop();
LLVertexBuffer::stopRender();
dynamicTexture->postRender(result);
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index 2157b50eb5..5a683c4c2e 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -263,8 +263,14 @@ void LLFace::setDrawable(LLDrawable *drawable)
void LLFace::setSize(const S32 num_vertices, const S32 num_indices)
{
- mGeomCount = num_vertices;
- mIndicesCount = num_indices;
+ if (mGeomCount != num_vertices ||
+ mIndicesCount != num_indices)
+ {
+ mGeomCount = num_vertices;
+ mIndicesCount = num_indices;
+ mVertexBuffer = NULL;
+ mLastVertexBuffer = NULL;
+ }
}
//============================================================================
@@ -368,8 +374,6 @@ void LLFace::renderForSelect(U32 data_mask)
#if !LL_RELEASE_FOR_DOWNLOAD
LLGLState::checkClientArrays(data_mask);
#endif
- U16* indicesp = (U16*) mVertexBuffer->getIndicesPointer() + mIndicesIndex;
-
if (gPickFaces && mTEOffset != -1)
{
// mask off high 4 bits (16 total possible faces)
@@ -386,40 +390,26 @@ void LLFace::renderForSelect(U32 data_mask)
{
glPushMatrix();
glMultMatrixf((float*) mDrawablep->getRegion()->mRenderMatrix.mMatrix);
- glDrawElements(GL_TRIANGLES, mIndicesCount, GL_UNSIGNED_SHORT, indicesp);
+ mVertexBuffer->draw(LLVertexBuffer::TRIANGLES, mIndicesCount, mIndicesIndex);
glPopMatrix();
}
else
{
- glDrawElements(GL_TRIANGLES, mIndicesCount, GL_UNSIGNED_SHORT, indicesp);
+ mVertexBuffer->draw(LLVertexBuffer::TRIANGLES, mIndicesCount, mIndicesIndex);
}
}
else
{
glPushMatrix();
glMultMatrixf((float*)getRenderMatrix().mMatrix);
- glDrawElements(GL_TRIANGLES, mIndicesCount, GL_UNSIGNED_SHORT, indicesp);
- glPopMatrix();
- }
- }
- else if (mGeomCount > 0)
- {
- if (isState(GLOBAL))
- {
- glDrawArrays(GL_TRIANGLES, mGeomIndex, mGeomCount);
- }
- else
- {
- glPushMatrix();
- glMultMatrixf((float*)getRenderMatrix().mMatrix);
- glDrawArrays(GL_TRIANGLES, mGeomIndex, mGeomCount);
+ mVertexBuffer->draw(LLVertexBuffer::TRIANGLES, mIndicesCount, mIndicesIndex);
glPopMatrix();
}
}
}
}
-void LLFace::renderSelected(LLImageGL *imagep, const LLColor4& color, const S32 offset, const S32 count)
+void LLFace::renderSelected(LLImageGL *imagep, const LLColor4& color)
{
if(mDrawablep.isNull() || mVertexBuffer.isNull())
{
@@ -443,27 +433,12 @@ void LLFace::renderSelected(LLImageGL *imagep, const LLColor4& color, const S32
glMultMatrixf((GLfloat*)mDrawablep->getRegion()->mRenderMatrix.mMatrix);
}
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
-
mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD);
#if !LL_RELEASE_FOR_DOWNLOAD
LLGLState::checkClientArrays(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD);
#endif
- U16* indicesp = ((U16*) mVertexBuffer->getIndicesPointer()) + mIndicesIndex;
-
- if (count)
- {
- glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, indicesp + offset);
- }
- else
- {
- glDrawElements(GL_TRIANGLES, mIndicesCount, GL_UNSIGNED_SHORT, indicesp);
- }
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisableClientState(GL_NORMAL_ARRAY);
-
+ mVertexBuffer->draw(LLVertexBuffer::TRIANGLES, mIndicesCount, mIndicesIndex);
+
glPopMatrix();
}
}
@@ -542,8 +517,6 @@ void LLFace::renderSelectedUV(const S32 offset, const S32 count)
}
else
{
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glEnableClientState(GL_VERTEX_ARRAY);
llassert(mGeomIndex >= 0);
if (count)
{
@@ -568,7 +541,6 @@ void LLFace::renderSelectedUV(const S32 offset, const S32 count)
glDrawArrays(GL_TRIANGLES, mGeomIndex, mGeomCount);
}
}
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
glDisable(GL_POLYGON_OFFSET_FILL);
@@ -1251,16 +1223,7 @@ S32 LLFace::pushVertices(const U16* index_array) const
{
if (mIndicesCount)
{
- if (mGeomCount <= gGLManager.mGLMaxVertexRange &&
- mIndicesCount <= (U32) gGLManager.mGLMaxIndexRange)
- {
- glDrawRangeElements(GL_TRIANGLES, mGeomIndex, mGeomIndex + mGeomCount-1, mIndicesCount,
- GL_UNSIGNED_SHORT, index_array + mIndicesIndex);
- }
- else
- {
- glDrawElements(GL_TRIANGLES, mIndicesCount, GL_UNSIGNED_SHORT, index_array+mIndicesIndex);
- }
+ mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, mGeomIndex, mGeomIndex+mGeomCount-1, mIndicesCount, mIndicesIndex);
gPipeline.addTrianglesDrawn(mIndicesCount/3);
}
diff --git a/indra/newview/llface.h b/indra/newview/llface.h
index 6142ba6672..070283ecd2 100644
--- a/indra/newview/llface.h
+++ b/indra/newview/llface.h
@@ -167,7 +167,7 @@ public:
void renderSelectedUV(const S32 offset = 0, const S32 count = 0);
void renderForSelect(U32 data_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD);
- void renderSelected(LLImageGL *image, const LLColor4 &color, const S32 offset = 0, const S32 count = 0);
+ void renderSelected(LLImageGL *image, const LLColor4 &color);
F32 getKey() const { return mDistance; }
diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp
index c18dc069a4..248e680c1b 100644
--- a/indra/newview/llflexibleobject.cpp
+++ b/indra/newview/llflexibleobject.cpp
@@ -195,7 +195,7 @@ void LLVolumeImplFlexible::remapSections(LLFlexibleObjectSection *source, S32 so
//-----------------------------------------------------------------------------
-void LLVolumeImplFlexible::setAttributesOfAllSections()
+void LLVolumeImplFlexible::setAttributesOfAllSections(LLVector3* inScale)
{
LLVector2 bottom_scale, top_scale;
F32 begin_rot = 0, end_rot = 0;
@@ -215,8 +215,16 @@ void LLVolumeImplFlexible::setAttributesOfAllSections()
S32 num_sections = 1 << mSimulateRes;
- LLVector3 scale = mVO->mDrawable->getScale();
-
+ LLVector3 scale;
+ if (inScale == (LLVector3*)NULL)
+ {
+ scale = mVO->mDrawable->getScale();
+ }
+ else
+ {
+ scale = *inScale;
+ }
+
mSection[0].mPosition = getAnchorPosition();
mSection[0].mDirection = LLVector3::z_axis * getFrameRotation();
mSection[0].mdPosition = mSection[0].mDirection;
@@ -297,7 +305,7 @@ BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F6
new_res = mRenderRes;
}
- if (!mInitialized || (mSimulateRes != new_res))
+ if (!mInitialized)
{
mSimulateRes = new_res;
setAttributesOfAllSections();
@@ -644,7 +652,7 @@ void LLVolumeImplFlexible::doFlexibleRebuild()
void LLVolumeImplFlexible::onSetScale(const LLVector3& scale, BOOL damped)
{
- setAttributesOfAllSections();
+ setAttributesOfAllSections((LLVector3*) &scale);
}
BOOL LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable)
diff --git a/indra/newview/llflexibleobject.h b/indra/newview/llflexibleobject.h
index d4b79fb536..f711d0a57d 100644
--- a/indra/newview/llflexibleobject.h
+++ b/indra/newview/llflexibleobject.h
@@ -138,7 +138,7 @@ class LLVolumeImplFlexible : public LLVolumeInterface
//--------------------------------------
// private methods
//--------------------------------------
- void setAttributesOfAllSections ();
+ void setAttributesOfAllSections (LLVector3* inScale = NULL);
void remapSections(LLFlexibleObjectSection *source, S32 source_sections,
LLFlexibleObjectSection *dest, S32 dest_sections);
diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp
index afa3fcddbe..aba92791e0 100644
--- a/indra/newview/llfloateranimpreview.cpp
+++ b/indra/newview/llfloateranimpreview.cpp
@@ -293,7 +293,6 @@ BOOL LLFloaterAnimPreview::postBuild()
mAnimPreview = NULL;
mMotionID.setNull();
childSetValue("bad_animation_text", getString("failed_to_initialize"));
- setEnabled(FALSE);
}
}
else
@@ -1039,6 +1038,8 @@ BOOL LLPreviewAnimation::render()
{
mNeedsUpdate = FALSE;
LLVOAvatar* avatarp = mDummyAvatar;
+
+ gGL.start();
glMatrixMode(GL_PROJECTION);
gGL.pushMatrix();
@@ -1109,7 +1110,6 @@ BOOL LLPreviewAnimation::render()
avatarPoolp->renderAvatars(avatarp); // renders only one avatar
}
- gGL.start();
return TRUE;
}
diff --git a/indra/newview/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp
index 25b275c8cb..2e971a8324 100644
--- a/indra/newview/llfloaterauction.cpp
+++ b/indra/newview/llfloaterauction.cpp
@@ -53,6 +53,7 @@
#include "llviewerdisplay.h"
#include "llviewercontrol.h"
#include "llui.h"
+#include "llglimmediate.h"
///----------------------------------------------------------------------------
/// Local function declarations, constants, enums, and typedefs
@@ -153,7 +154,7 @@ void LLFloaterAuction::draw()
}
{
LLGLSUIDefault gls_ui;
- glColor3f(1.f, 1.f, 1.f);
+ gGL.color3f(1.f, 1.f, 1.f);
gl_draw_scaled_image(rect.mLeft,
rect.mBottom,
rect.getWidth(),
diff --git a/indra/newview/llfloaterhud.cpp b/indra/newview/llfloaterhud.cpp
index 7f311be9fd..12b1f0b4f1 100644
--- a/indra/newview/llfloaterhud.cpp
+++ b/indra/newview/llfloaterhud.cpp
@@ -29,16 +29,20 @@ LLFloaterHUD::LLFloaterHUD()
: LLFloater("floater_hud"),
mWebBrowser(0)
{
+ // Create floater from its XML definition
+ LLUICtrlFactory::getInstance()->buildFloater(this, "floater_hud.xml");
+
// Don't grab the focus as it will impede performing in-world actions
// while using the HUD
- setAutoFocus(FALSE);
+ setIsChrome(TRUE);
+
+ // Chrome doesn't show the window title by default, but here we
+ // want to show it.
+ setTitleVisible(true);
// Opaque background since we never get the focus
setBackgroundOpaque(TRUE);
- // Create floater from its XML definition
- LLUICtrlFactory::getInstance()->buildFloater(this, "floater_hud.xml");
-
// Position floater based on saved location
LLRect saved_position_rect = gSavedSettings.getRect("FloaterHUDRect");
reshape(saved_position_rect.getWidth(), saved_position_rect.getHeight(), FALSE);
@@ -47,12 +51,14 @@ LLFloaterHUD::LLFloaterHUD()
mWebBrowser = getChild<LLWebBrowserCtrl>("floater_hud_browser" );
if (mWebBrowser)
{
- // Always refresh the browser
- mWebBrowser->setAlwaysRefresh(true);
-
// Open links in internal browser
mWebBrowser->setOpenInExternalBrowser(false);
+ // This is a "chrome" floater, so we don't want anything to
+ // take focus (as the user needs to be able to walk with
+ // arrow keys during tutorial).
+ mWebBrowser->setTakeFocusOnClick(false);
+
LLString language(gSavedSettings.getString("Language"));
if(language == "default")
{
@@ -110,9 +116,3 @@ void LLFloaterHUD::close()
{
if (sInstance) sInstance->close();
}
-
-void LLFloaterHUD::onFocusReceived()
-{
- // Never get the focus
- setFocus(FALSE);
-}
diff --git a/indra/newview/llfloaterhud.h b/indra/newview/llfloaterhud.h
index 9c1140986e..06da9fb44e 100644
--- a/indra/newview/llfloaterhud.h
+++ b/indra/newview/llfloaterhud.h
@@ -36,7 +36,7 @@ protected:
LLWebBrowserCtrl* mWebBrowser; ///< the actual web browser control
LLFloaterHUD(); ///< default constructor
- virtual void onFocusReceived(); ///< called when we get the focus
+
private:
static LLFloaterHUD* sInstance;
};
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp
index 51e67dcf2b..67f9ebe6b4 100644
--- a/indra/newview/llfloaterimagepreview.cpp
+++ b/indra/newview/llfloaterimagepreview.cpp
@@ -667,6 +667,8 @@ void LLImagePreviewAvatar::setPreviewTarget(const char* joint_name, const char*
//-----------------------------------------------------------------------------
BOOL LLImagePreviewAvatar::render()
{
+ gGL.start();
+
mNeedsUpdate = FALSE;
LLVOAvatar* avatarp = mDummyAvatar;
@@ -723,8 +725,6 @@ BOOL LLImagePreviewAvatar::render()
avatarPoolp->renderAvatars(avatarp); // renders only one avatar
}
- gGL.start();
-
return TRUE;
}
@@ -823,6 +823,8 @@ void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance)
//-----------------------------------------------------------------------------
BOOL LLImagePreviewSculpted::render()
{
+ gGL.start();
+
mNeedsUpdate = FALSE;
LLGLSUIDefault def;
@@ -917,6 +919,8 @@ BOOL LLImagePreviewSculpted::render()
delete [] normals;
}
+ gGL.stop();
+
return TRUE;
}
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp
index 493b69f99e..f6d9ee9761 100644
--- a/indra/newview/llglsandbox.cpp
+++ b/indra/newview/llglsandbox.cpp
@@ -1006,17 +1006,17 @@ void LLViewerObjectList::renderObjectBeacons()
return;
}
- S32 i;
//const LLFontGL *font = LLResMgr::getInstance()->getRes(LLFONT_SANSSERIF);
LLGLSUIDefault gls_ui;
- S32 last_line_width = -1;
-
{
LLGLSNoTexture gls_ui_no_texture;
- gGL.begin(GL_LINES);
- for (i = 0; i < mDebugBeacons.count(); i++)
+
+ S32 last_line_width = -1;
+ // gGL.begin(GL_LINES); // Always happens in (line_width != last_line_width)
+
+ for (S32 i = 0; i < mDebugBeacons.count(); i++)
{
const LLDebugBeacon &debug_beacon = mDebugBeacons[i];
LLColor4 color = debug_beacon.mColor;
@@ -1024,8 +1024,11 @@ void LLViewerObjectList::renderObjectBeacons()
S32 line_width = debug_beacon.mLineWidth;
if (line_width != last_line_width)
{
- gGL.end();
- gGL.flush();
+ if (i > 0)
+ {
+ gGL.end();
+ gGL.flush();
+ }
glLineWidth( (F32)line_width );
last_line_width = line_width;
gGL.begin(GL_LINES);
@@ -1049,17 +1052,21 @@ void LLViewerObjectList::renderObjectBeacons()
LLGLSNoTexture gls_ui_no_texture;
LLGLDepthTest gls_depth(GL_TRUE);
- gGL.begin(GL_LINES);
- last_line_width = -1;
- for (i = 0; i < mDebugBeacons.count(); i++)
+ S32 last_line_width = -1;
+ // gGL.begin(GL_LINES); // Always happens in (line_width != last_line_width)
+
+ for (S32 i = 0; i < mDebugBeacons.count(); i++)
{
const LLDebugBeacon &debug_beacon = mDebugBeacons[i];
S32 line_width = debug_beacon.mLineWidth;
if (line_width != last_line_width)
{
- gGL.end();
- gGL.flush();
+ if (i > 0)
+ {
+ gGL.end();
+ gGL.flush();
+ }
glLineWidth( (F32)line_width );
last_line_width = line_width;
gGL.begin(GL_LINES);
@@ -1076,12 +1083,12 @@ void LLViewerObjectList::renderObjectBeacons()
draw_line_cube(0.10f, thisline);
}
+
gGL.end();
-
gGL.flush();
glLineWidth(1.f);
- for (i = 0; i < mDebugBeacons.count(); i++)
+ for (S32 i = 0; i < mDebugBeacons.count(); i++)
{
LLDebugBeacon &debug_beacon = mDebugBeacons[i];
if (debug_beacon.mString == "")
diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp
index 7eac7eb598..35cf36bd07 100644
--- a/indra/newview/llimpanel.cpp
+++ b/indra/newview/llimpanel.cpp
@@ -1061,7 +1061,7 @@ LLFloaterIMPanel::LLFloaterIMPanel(
mSessionUUID(session_id),
mVoiceChannel(NULL),
mSessionInitialized(FALSE),
-
+ mSessionStartMsgPos(0),
mOtherParticipantUUID(other_participant_id),
mDialog(dialog),
mTyping(FALSE),
@@ -1090,6 +1090,7 @@ LLFloaterIMPanel::LLFloaterIMPanel(
mSessionUUID(session_id),
mVoiceChannel(NULL),
mSessionInitialized(FALSE),
+ mSessionStartMsgPos(0),
mOtherParticipantUUID(other_participant_id),
mDialog(dialog),
mTyping(FALSE),
@@ -1182,6 +1183,7 @@ void LLFloaterIMPanel::init(const LLString& session_label)
//we don't need to need to wait for any responses
//so we're already initialized
mSessionInitialized = TRUE;
+ mSessionStartMsgPos = 0;
}
else
{
diff --git a/indra/newview/llmemoryview.cpp b/indra/newview/llmemoryview.cpp
index 4b4b0a36dc..e124af1427 100644
--- a/indra/newview/llmemoryview.cpp
+++ b/indra/newview/llmemoryview.cpp
@@ -121,6 +121,8 @@ static const struct mtv_display_info mtv_display_table[] =
{ LLMemType::MTYPE_VERTEX_DATA, "Vertex Buffer", &LLColor4::blue3 },
{ LLMemType::MTYPE_AVATAR, "Avatar", &LLColor4::purple1 },
{ LLMemType::MTYPE_REGIONS, "Regions", &LLColor4::blue1 },
+ { LLMemType::MTYPE_VOLUME, "Volume", &LLColor4::pink1 },
+ { LLMemType::MTYPE_PRIMITIVE, "Profile", &LLColor4::pink2 },
{ LLMemType::MTYPE_TEMP1, "Temp1", &LLColor4::red1 },
{ LLMemType::MTYPE_TEMP2, "Temp2", &LLColor4::magenta1 },
{ LLMemType::MTYPE_TEMP3, "Temp3", &LLColor4::red2 },
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index b6805f42fa..a94fcf7bc2 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -951,6 +951,7 @@ void LLPanelLogin::loadLoginPage()
{
LLAppViewer::instance()->resetURIs();
gGridChoice = (EGridInfo)grid_index;
+ gSavedSettings.setString("GridChoice", gGridInfo[gGridChoice].mLabel);
gViewerWindow->setMenuBackgroundColor(false,
!LLAppViewer::instance()->isInProductionGrid());
gLoginMenuBarView->setBackgroundColor(gMenuBarView->getBackgroundColor());
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 331505166e..59fa2c4bcc 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -1906,9 +1906,8 @@ void pushVerts(LLDrawInfo* params, U32 mask)
{
LLRenderPass::applyModelMatrix(*params);
params->mVertexBuffer->setBuffer(mask);
- U16* indicesp = (U16*) params->mVertexBuffer->getIndicesPointer();
- glDrawRangeElements(params->mParticle ? GL_POINTS : GL_TRIANGLES, params->mStart, params->mEnd, params->mCount,
- GL_UNSIGNED_SHORT, indicesp+params->mOffset);
+ params->mVertexBuffer->drawRange(params->mParticle ? LLVertexBuffer::POINTS : LLVertexBuffer::TRIANGLES,
+ params->mStart, params->mEnd, params->mCount, params->mOffset);
}
void pushVerts(LLSpatialGroup* group, U32 mask)
@@ -1932,13 +1931,11 @@ void pushVerts(LLFace* face, U32 mask)
if (buffer)
{
buffer->setBuffer(mask);
- U16* indicesp = (U16*) buffer->getIndicesPointer();
U16 start = face->getGeomStart();
U16 end = start + face->getGeomCount()-1;
U32 count = face->getIndicesCount();
U16 offset = face->getIndicesStart();
-
- glDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, indicesp + offset);
+ buffer->drawRange(LLVertexBuffer::TRIANGLES, start, end, count, offset);
}
}
@@ -1948,9 +1945,7 @@ void pushBufferVerts(LLVertexBuffer* buffer, U32 mask)
if (buffer)
{
buffer->setBuffer(mask);
- U16* indicesp = (U16*) buffer->getIndicesPointer();
- glDrawRangeElements(GL_TRIANGLES, 0, buffer->getRequestedVerts(), buffer->getRequestedIndices(),
- GL_UNSIGNED_SHORT, indicesp);
+ buffer->drawRange(LLVertexBuffer::TRIANGLES, 0, buffer->getRequestedVerts()-1, buffer->getRequestedIndices(), 0);
}
}
@@ -1999,9 +1994,8 @@ void pushVertsColorCoded(LLSpatialGroup* group, U32 mask)
LLRenderPass::applyModelMatrix(*params);
glColor4f(colors[col].mV[0], colors[col].mV[1], colors[col].mV[2], 0.5f);
params->mVertexBuffer->setBuffer(mask);
- U16* indicesp = (U16*) params->mVertexBuffer->getIndicesPointer();
- glDrawRangeElements(params->mParticle ? GL_POINTS : GL_TRIANGLES, params->mStart, params->mEnd, params->mCount,
- GL_UNSIGNED_SHORT, indicesp+params->mOffset);
+ params->mVertexBuffer->drawRange(params->mParticle ? LLVertexBuffer::POINTS : LLVertexBuffer::TRIANGLES,
+ params->mStart, params->mEnd, params->mCount, params->mOffset);
col = (col+1)%col_count;
}
}
@@ -2070,8 +2064,7 @@ void renderOctree(LLSpatialGroup* group)
face->mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX);
//drawBox((face->mExtents[0] + face->mExtents[1])*0.5f,
// (face->mExtents[1]-face->mExtents[0])*0.5f);
- glDrawElements(GL_TRIANGLES, face->getIndicesCount(), GL_UNSIGNED_SHORT,
- ((U16*) face->mVertexBuffer->getIndicesPointer())+face->getIndicesStart());
+ face->mVertexBuffer->draw(LLVertexBuffer::TRIANGLES, face->getIndicesCount(), face->getIndicesStart());
}
}
diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp
index 7a2d232de6..f8931cb18b 100644
--- a/indra/newview/lltexlayer.cpp
+++ b/indra/newview/lltexlayer.cpp
@@ -244,6 +244,8 @@ BOOL LLTexLayerSetBuffer::render()
BOOL upload_now = (gAgent.mNumPendingQueries == 0 && mNeedsUpload && mTexLayerSet->isLocalTextureDataFinal());
BOOL success = TRUE;
+ gGL.start();
+
// Composite bump
if( mBumpTexName )
{
@@ -295,6 +297,8 @@ BOOL LLTexLayerSetBuffer::render()
glColorMask( GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE );
gGL.blendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
+ gGL.stop();
+
// we have valid texture data now
mInitialized = TRUE;
mNeedsUpdate = FALSE;
diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp
index 265d1082d1..85ea204645 100644
--- a/indra/newview/lltoolmorph.cpp
+++ b/indra/newview/lltoolmorph.cpp
@@ -163,6 +163,8 @@ void LLVisualParamHint::preRender(BOOL clear_depth)
//-----------------------------------------------------------------------------
BOOL LLVisualParamHint::render()
{
+ gGL.start();
+
LLVisualParamReset::sDirty = TRUE;
LLVOAvatar* avatarp = gAgent.getAvatarObject();
@@ -223,6 +225,7 @@ BOOL LLVisualParamHint::render()
LLVector3 camera_pos = target_joint_pos + (camera_snapshot_offset * avatar_rotation);
gGL.stop();
+
LLViewerCamera::getInstance()->setAspect((F32)mWidth / (F32)mHeight);
LLViewerCamera::getInstance()->setOriginAndLookAt(
camera_pos, // camera
@@ -238,7 +241,7 @@ BOOL LLVisualParamHint::render()
avatarPoolp->renderAvatars(avatarp); // renders only one avatar
}
avatarp->setVisualParamWeight(mVisualParam, mLastParamWeight);
- gGL.start();
+
return TRUE;
}
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 3d0daa73a2..583139298f 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -886,6 +886,11 @@ void render_ui_and_swap()
LLGLState::checkStates();
#endif
+ glPushMatrix();
+ glLoadMatrixd(gGLLastModelView);
+ glh::matrix4f saved_view = glh_get_current_modelview();
+ glh_set_current_modelview(glh_copy_matrix(gGLLastModelView));
+
{
BOOL to_texture = gPipeline.canUseVertexShaders() &&
LLPipeline::sRenderGlow &&
@@ -936,6 +941,9 @@ void render_ui_and_swap()
LLVertexBuffer::stopRender();
}
+
+ glh_set_current_modelview(saved_view);
+ glPopMatrix();
}
void render_ui_and_swap_if_needed()
@@ -1030,11 +1038,6 @@ void render_ui_3d()
// so 3d elements requiring Z buffer are moved to LLDrawPoolHUD
//
- // Render selections
- //glDisableClientState(GL_COLOR_ARRAY);
- //glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- //glDisableClientState(GL_NORMAL_ARRAY);
-
/////////////////////////////////////////////////////////////
//
// Render 2.5D elements (2D elements in the world)
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp
index fe00c25c63..ce23efe2f0 100644
--- a/indra/newview/llviewerjointmesh.cpp
+++ b/indra/newview/llviewerjointmesh.cpp
@@ -501,21 +501,6 @@ int compare_int(const void *a, const void *b)
else return 0;
}
-void llDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices)
-{
- if (end-start+1 > (U32) gGLManager.mGLMaxVertexRange ||
- count > gGLManager.mGLMaxIndexRange)
- {
- glDrawElements(mode,count,type,indices);
- }
- else
- {
- glDrawRangeElements(mode,start,end,count,type,indices);
- }
-
- gPipeline.addTrianglesDrawn(count/3);
-}
-
//--------------------------------------------------------------------
// LLViewerJointMesh::drawShape()
//--------------------------------------------------------------------
@@ -626,7 +611,7 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass)
U32 start = mMesh->mFaceVertexOffset;
U32 end = start + mMesh->mFaceVertexCount - 1;
U32 count = mMesh->mFaceIndexCount;
- U16* indicesp = ((U16*) mFace->mVertexBuffer->getIndicesPointer()) + mMesh->mFaceIndexOffset;
+ U32 offset = mMesh->mFaceIndexOffset;
if (mMesh->hasWeights())
{
@@ -636,23 +621,21 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass)
{
uploadJointMatrices();
}
- llDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, indicesp);
- }
- else
- {
- llDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, indicesp);
}
+
+ mFace->mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, start, end, count, offset);
}
else
{
glPushMatrix();
LLMatrix4 jointToWorld = getWorldMatrix();
glMultMatrixf((GLfloat*)jointToWorld.mMatrix);
- llDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, indicesp);
+ mFace->mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, start, end, count, offset);
glPopMatrix();
}
+ gPipeline.addTrianglesDrawn(count/3);
- triangle_count += mMesh->mFaceIndexCount;
+ triangle_count += count;
if (mTestImageName)
{
diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp
index bea4b910b6..e21c14637b 100644
--- a/indra/newview/llviewerkeyboard.cpp
+++ b/indra/newview/llviewerkeyboard.cpp
@@ -88,8 +88,6 @@ static void agent_handle_doubletap_run(EKeystate s, LLAgent::EDoubleTapRunMode m
{
if (KEYSTATE_UP == s)
{
- // Releasing a walk-key resets the double-tap timer
- gAgent.mDoubleTapRunTimer.reset();
if (gAgent.mDoubleTapRunMode == mode &&
gAgent.getRunning() &&
!gAgent.getAlwaysRun())
@@ -98,17 +96,23 @@ static void agent_handle_doubletap_run(EKeystate s, LLAgent::EDoubleTapRunMode m
gAgent.clearRunning();
gAgent.sendWalkRun(gAgent.getRunning());
}
- gAgent.mDoubleTapRunMode = mode;
}
else if (gAllowTapTapHoldRun &&
KEYSTATE_DOWN == s &&
- gAgent.mDoubleTapRunMode == mode &&
- gAgent.mDoubleTapRunTimer.getElapsedTimeF32() < NUDGE_TIME)
+ !gAgent.getRunning())
{
- // Same walk-key was pushed again quickly; this is a double-tap
- // so engage temporary running.
- gAgent.setRunning();
- gAgent.sendWalkRun(gAgent.getRunning());
+ if (gAgent.mDoubleTapRunMode == mode &&
+ gAgent.mDoubleTapRunTimer.getElapsedTimeF32() < NUDGE_TIME)
+ {
+ // Same walk-key was pushed again quickly; this is a
+ // double-tap so engage temporary running.
+ gAgent.setRunning();
+ gAgent.sendWalkRun(gAgent.getRunning());
+ }
+
+ // Pressing any walk-key resets the double-tap timer
+ gAgent.mDoubleTapRunTimer.reset();
+ gAgent.mDoubleTapRunMode = mode;
}
}
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index cfcd446b55..2cb60785d3 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -4897,12 +4897,12 @@ BOOL menu_check_build_tool( void* user_data )
void handle_reload_settings(void*)
{
gSavedSettings.resetToDefaults();
- gSavedSettings.loadFromFile(gSavedSettings.getString("ClientSettingsFile"), TRUE);
+ gSavedSettings.loadFromFile(gSavedSettings.getString("ClientSettingsFile"));
llinfos << "Loading colors from colors.xml" << llendl;
std::string color_file = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"colors.xml");
gColors.resetToDefaults();
- gColors.loadFromFile(color_file, FALSE, TYPE_COL4U);
+ gColors.loadFromFileLegacy(color_file, FALSE, TYPE_COL4U);
}
class LLWorldSetHomeLocation : public view_listener_t
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 99f1af61e5..8afb0879a3 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -5063,7 +5063,7 @@ void callback_load_url(S32 option, void* data)
if (0 == option)
{
- LLWeb::loadURL(infop->mUrl);
+ LLWeb::loadURLExternal(infop->mUrl);
}
delete infop;
diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp
index 16555fdc9a..5f83dd4b06 100644
--- a/indra/newview/llvotree.cpp
+++ b/indra/newview/llvotree.cpp
@@ -821,7 +821,7 @@ U32 LLVOTree::drawBranchPipeline(LLMatrix4& matrix, U16* indicesp, S32 trunk_LOD
glLoadMatrixf((F32*) scale_mat.mMatrix);
glDrawElements(GL_TRIANGLES, sLODIndexCount[trunk_LOD], GL_UNSIGNED_SHORT, indicesp + sLODIndexOffset[trunk_LOD]);
-
+ gPipeline.addTrianglesDrawn(LEAF_INDICES/3);
stop_glerror();
ret += sLODIndexCount[trunk_LOD];
}
@@ -871,7 +871,7 @@ U32 LLVOTree::drawBranchPipeline(LLMatrix4& matrix, U16* indicesp, S32 trunk_LOD
glLoadMatrixf((F32*) scale_mat.mMatrix);
glDrawElements(GL_TRIANGLES, LEAF_INDICES, GL_UNSIGNED_SHORT, indicesp);
-
+ gPipeline.addTrianglesDrawn(LEAF_INDICES/3);
stop_glerror();
ret += LEAF_INDICES;
}
@@ -896,7 +896,7 @@ U32 LLVOTree::drawBranchPipeline(LLMatrix4& matrix, U16* indicesp, S32 trunk_LOD
glLoadMatrixf((F32*) scale_mat.mMatrix);
glDrawElements(GL_TRIANGLES, LEAF_INDICES, GL_UNSIGNED_SHORT, indicesp);
-
+ gPipeline.addTrianglesDrawn(LEAF_INDICES/3);
stop_glerror();
ret += LEAF_INDICES;
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index e7dbf0bfb8..a440ae2957 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -762,16 +762,30 @@ void LLVOVolume::sculpt()
return;
LLPointer<LLImageRaw> raw_image = new LLImageRaw();
- mSculptTexture->readBackRaw(discard_level, raw_image, FALSE);
+ BOOL is_valid = mSculptTexture->readBackRaw(discard_level, raw_image, FALSE);
sculpt_height = raw_image->getHeight();
sculpt_width = raw_image->getWidth();
+ sculpt_components = raw_image->getComponents();
- sculpt_components = raw_image->getComponents();
- sculpt_data = raw_image->getData();
-
- llassert_always(raw_image->getDataSize() >= sculpt_height * sculpt_width * sculpt_components);
-
+ if(is_valid)
+ {
+ is_valid = mSculptTexture->isValidForSculpt(discard_level, sculpt_width, sculpt_height, sculpt_components) ;
+ }
+ if(!is_valid)
+ {
+ sculpt_width = 0;
+ sculpt_height = 0;
+ sculpt_data = NULL ;
+ }
+ else
+ {
+ if (raw_image->getDataSize() < sculpt_height * sculpt_width * sculpt_components)
+ llerrs << "Sculpt: image data size = " << raw_image->getDataSize()
+ << " < " << sculpt_height << " x " << sculpt_width << " x " <<sculpt_components << llendl;
+
+ sculpt_data = raw_image->getData();
+ }
getVolume()->sculpt(sculpt_width, sculpt_height, sculpt_components, sculpt_data, discard_level);
}
}
diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp
index ca9f328e48..18c03d870f 100644
--- a/indra/newview/llvowlsky.cpp
+++ b/indra/newview/llvowlsky.cpp
@@ -484,17 +484,12 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable)
void LLVOWLSky::drawStars(void)
{
- glEnableClientState(GL_COLOR_ARRAY);
-
// render the stars as a sphere centered at viewer camera
if (mStarsVerts.notNull())
{
mStarsVerts->setBuffer(LLDrawPoolWLSky::STAR_VERTEX_DATA_MASK);
- U16* indicesp = (U16*) mStarsVerts->getIndicesPointer();
- glDrawElements(GL_POINTS, getStarsNumIndices(), GL_UNSIGNED_SHORT, indicesp);
+ mStarsVerts->draw(LLVertexBuffer::POINTS, getStarsNumIndices(), 0);
}
-
- glDisableClientState(GL_COLOR_ARRAY);
}
void LLVOWLSky::drawDome(void)
@@ -507,19 +502,8 @@ void LLVOWLSky::drawDome(void)
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
const U32 data_mask = LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK;
-
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-
+
#if DOME_SLICES
- //mFanVerts->setBuffer(data_mask);
- //glDrawRangeElements(
- // GL_TRIANGLES,
- // 0, getFanNumVerts()-1, getFanNumIndices(),
- // GL_UNSIGNED_SHORT,
- // mFanVerts->getIndicesPointer());
-
- //gPipeline.addTrianglesDrawn(getFanNumIndices()/3);
-
std::vector< LLPointer<LLVertexBuffer> >::const_iterator strips_vbo_iter, end_strips;
end_strips = mStripsVerts.end();
for(strips_vbo_iter = mStripsVerts.begin(); strips_vbo_iter != end_strips; ++strips_vbo_iter)
@@ -528,13 +512,10 @@ void LLVOWLSky::drawDome(void)
strips_segment->setBuffer(data_mask);
- glDrawRangeElements(
- //GL_TRIANGLES,
- GL_TRIANGLE_STRIP,
- 0, strips_segment->getRequestedVerts()-1, strips_segment->getRequestedIndices(),
- GL_UNSIGNED_SHORT,
- strips_segment->getIndicesPointer());
-
+ strips_segment->drawRange(
+ LLVertexBuffer::TRIANGLE_STRIP,
+ 0, strips_segment->getRequestedVerts()-1, strips_segment->getRequestedIndices(),
+ 0);
gPipeline.addTrianglesDrawn(strips_segment->getRequestedIndices() - 2);
}
@@ -547,8 +528,6 @@ void LLVOWLSky::drawDome(void)
mStripsVerts->getIndicesPointer());
#endif
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-
LLVertexBuffer::unbind();
}
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 4e679d28d5..69f2a4c4b7 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -168,7 +168,7 @@ glh::matrix4f glh_get_current_projection()
return glh_copy_matrix(gGLProjection);
}
-void glh_copy_matrix(glh::matrix4f& src, GLdouble* dst)
+void glh_copy_matrix(const glh::matrix4f& src, GLdouble* dst)
{
for (U32 i = 0; i < 16; i++)
{
@@ -176,7 +176,7 @@ void glh_copy_matrix(glh::matrix4f& src, GLdouble* dst)
}
}
-void glh_set_current_modelview(glh::matrix4f& mat)
+void glh_set_current_modelview(const glh::matrix4f& mat)
{
glh_copy_matrix(mat, gGLModelView);
}
@@ -2144,9 +2144,9 @@ void render_hud_elements()
LLViewerParcelMgr::getInstance()->renderParcelCollision();
// Render debugging beacons.
- gObjectList.renderObjectBeacons();
- LLHUDObject::renderAll();
- gObjectList.resetObjectBeacons();
+ //gObjectList.renderObjectBeacons();
+ //LLHUDObject::renderAll();
+ //gObjectList.resetObjectBeacons();
}
else if (gForceRenderLandFence)
{
@@ -2253,11 +2253,11 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
//
//
- glEnableClientState(GL_VERTEX_ARRAY);
-
stop_glerror();
gFrameStats.start(LLFrameStats::RENDER_SYNC);
+ glEnableClientState(GL_VERTEX_ARRAY);
+
// Do verification of GL state
#ifndef LL_RELEASE_FOR_DOWNLOAD
LLGLState::checkStates();
@@ -2377,10 +2377,10 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
break;
}
- p->resetTrianglesDrawn();
p->render(i);
}
poolp->endRenderPass(i);
+ LLVertexBuffer::unbind();
#ifndef LL_RELEASE_FOR_DOWNLOAD
# if LL_DEBUG_GL
GLint depth;
@@ -2413,6 +2413,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
}
}
+ LLVertexBuffer::unbind();
#ifndef LL_RELEASE_FOR_DOWNLOAD
LLGLState::checkStates();
LLGLState::checkTextureChannels();
@@ -2452,6 +2453,15 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
LLVertexBuffer::stopRender();
LLVertexBuffer::unbind();
+ if (!LLPipeline::sReflectionRender && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
+ {
+ gGL.start();
+ // Render debugging beacons.
+ gObjectList.renderObjectBeacons();
+ LLHUDObject::renderAll();
+ gObjectList.resetObjectBeacons();
+ gGL.stop();
+ }
//HACK: preserve/restore matrices around HUD render
if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD))
@@ -2472,15 +2482,9 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate)
void LLPipeline::renderGeomDeferred()
{
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
- glEnableClientState(GL_COLOR_ARRAY);
gDeferredDiffuseProgram.bind();
gPipeline.renderObjects(LLRenderPass::PASS_SIMPLE, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD | LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_NORMAL, TRUE);
gDeferredDiffuseProgram.unbind();
- glDisableClientState(GL_COLOR_ARRAY);
- glDisableClientState(GL_NORMAL_ARRAY);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
void LLPipeline::addTrianglesDrawn(S32 count)
@@ -2506,11 +2510,6 @@ void LLPipeline::renderDebug()
gGL.start();
- // Disable all client state
- //glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- //glDisableClientState(GL_NORMAL_ARRAY);
- //glDisableClientState(GL_COLOR_ARRAY);
-
gGLLastMatrix = NULL;
glLoadMatrixd(gGLModelView);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE);
@@ -2603,8 +2602,6 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects)
LLGLDepthTest gls_depth(GL_TRUE,GL_TRUE);
disableLights();
- glEnableClientState ( GL_VERTEX_ARRAY );
-
//for each drawpool
#ifndef LL_RELEASE_FOR_DOWNLOAD
LLGLState::checkStates();
@@ -2619,7 +2616,7 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects)
{
LLFacePool* face_pool = (LLFacePool*) poolp;
face_pool->renderForSelect();
-
+ LLVertexBuffer::unbind();
gGLLastMatrix = NULL;
glLoadMatrixd(gGLModelView);
@@ -2635,7 +2632,6 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects)
}
}
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
LLGLEnable alpha_test(GL_ALPHA_TEST);
if (gPickTransparent)
{
@@ -2759,10 +2755,10 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects)
}
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- glDisableClientState( GL_TEXTURE_COORD_ARRAY );
+ LLVertexBuffer::unbind();
LLVertexBuffer::stopRender();
-
+
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
}
@@ -4866,6 +4862,12 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
{
if (LLPipeline::sWaterReflections && assertInitialized() && LLDrawPoolWater::sNeedsReflectionUpdate)
{
+#ifndef LL_RELEASE_FOR_DOWNLOAD
+ LLGLState::checkStates();
+ LLGLState::checkTextureChannels();
+ LLGLState::checkClientArrays();
+#endif
+
LLCamera camera = camera_in;
camera.setFar(camera.getFar()*0.87654321f);
LLPipeline::sReflectionRender = TRUE;
@@ -5052,6 +5054,12 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
LLDrawPoolWater::sNeedsDistortionUpdate = FALSE;
LLViewerCamera::getInstance()->setUserClipPlane(LLPlane(-pnorm, -pd));
LLPipeline::sUseOcclusion = occlusion;
+
+#ifndef LL_RELEASE_FOR_DOWNLOAD
+ LLGLState::checkStates();
+ LLGLState::checkTextureChannels();
+ LLGLState::checkClientArrays();
+#endif
}
}
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 6e02b55daf..7e38628d87 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -67,8 +67,9 @@ BOOL compute_min_max(LLMatrix4& box, LLVector2& min, LLVector2& max); // Shouldn
bool LLRayAABB(const LLVector3 &center, const LLVector3 &size, const LLVector3& origin, const LLVector3& dir, LLVector3 &coord, F32 epsilon = 0);
BOOL LLLineSegmentAABB(const LLVector3& start, const LLVector3& end, const LLVector3& center, const LLVector3& size);
BOOL setup_hud_matrices(BOOL for_select);
+glh::matrix4f glh_copy_matrix(GLdouble* src);
glh::matrix4f glh_get_current_modelview();
-void glh_set_current_modelview(glh::matrix4f& mat);
+void glh_set_current_modelview(const glh::matrix4f& mat);
glh::matrix4f glh_get_current_projection();
void glh_set_current_projection(glh::matrix4f& mat);
glh::matrix4f gl_ortho(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat znear, GLfloat zfar);