From 4519cc6734111b6b7b0a55343293d41c82438c8e Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Mon, 6 Mar 2023 18:50:28 -0500
Subject: [PATCH] Diving deep into the digital abyss

---
 indra/llcommon/llqueuedthread.cpp        |  1 +
 indra/llrender/llvertexbuffer.cpp        | 12 ++++++++----
 indra/llrender/llvertexbuffer.h          |  9 +++------
 indra/newview/llcompilequeue.cpp         |  2 +-
 indra/newview/lldrawpoolbump.cpp         | 11 -----------
 indra/newview/lldrawpoolwlsky.cpp        |  1 -
 indra/newview/llface.cpp                 |  2 +-
 indra/newview/llfloaterassetrecovery.cpp |  4 ++--
 indra/newview/llfloaterhexeditor.cpp     |  8 ++++----
 indra/newview/llfloatertexturepicker.cpp |  5 +++++
 indra/newview/llgltfmateriallist.cpp     |  3 ---
 indra/newview/lllocalgltfmaterials.cpp   |  2 +-
 indra/newview/llpanelface.cpp            |  2 +-
 indra/newview/llpresetsmanager.cpp       |  1 -
 indra/newview/llreflectionmapmanager.cpp |  3 +--
 indra/newview/llsnapshotlivepreview.cpp  |  1 -
 indra/newview/llspatialpartition.cpp     |  1 +
 indra/newview/lltexturectrl.h            |  2 ++
 indra/newview/llviewercontrol.cpp        |  6 +++---
 indra/newview/llviewerdisplay.cpp        |  2 --
 indra/newview/llviewerstats.cpp          |  4 +++-
 indra/newview/llviewertexlayer.cpp       |  2 +-
 indra/newview/llvopartgroup.cpp          |  1 -
 indra/newview/llvovolume.cpp             |  7 +++++--
 indra/newview/pipeline.h                 |  4 ++++
 25 files changed, 47 insertions(+), 49 deletions(-)

diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp
index 309bd2761f1..a0c5d691b36 100644
--- a/indra/llcommon/llqueuedthread.cpp
+++ b/indra/llcommon/llqueuedthread.cpp
@@ -242,6 +242,7 @@ bool LLQueuedThread::addRequest(QueuedRequest* req)
 #if _DEBUG
 // 	LL_INFOS() << llformat("LLQueuedThread::Added req [%08d]",handle) << LL_ENDL;
 #endif
+
 	unlockData();
 
     llassert(!mDataLock->isSelfLocked());
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index e75a6424bd8..5dae7b23413 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -1315,6 +1315,10 @@ bool LLVertexBuffer::getNormalStrider(LLStrider<LLVector3>& strider, U32 index,
 {
 	return VertexBufferStrider<LLVector3,TYPE_NORMAL>::get(*this, strider, index, count);
 }
+bool LLVertexBuffer::getNormalStrider(LLStrider<LLVector4a>& strider, U32 index, S32 count)
+{
+	return VertexBufferStrider<LLVector4a,TYPE_NORMAL>::get(*this, strider, index, count);
+}
 bool LLVertexBuffer::getTangentStrider(LLStrider<LLVector3>& strider, U32 index, S32 count)
 {
 	return VertexBufferStrider<LLVector3,TYPE_TANGENT>::get(*this, strider, index, count);
@@ -1336,14 +1340,14 @@ bool LLVertexBuffer::getWeightStrider(LLStrider<F32>& strider, U32 index, S32 co
 	return VertexBufferStrider<F32,TYPE_WEIGHT>::get(*this, strider, index, count);
 }
 
-bool LLVertexBuffer::getWeight4Strider(LLStrider<LLVector4>& strider, U32 index, S32 count)
+bool LLVertexBuffer::getWeight4Strider(LLStrider<LLVector4a>& strider, U32 index, S32 count)
 {
-	return VertexBufferStrider<LLVector4,TYPE_WEIGHT4>::get(*this, strider, index, count);
+	return VertexBufferStrider<LLVector4a,TYPE_WEIGHT4>::get(*this, strider, index, count);
 }
 
-bool LLVertexBuffer::getClothWeightStrider(LLStrider<LLVector4>& strider, U32 index, S32 count)
+bool LLVertexBuffer::getClothWeightStrider(LLStrider<LLVector4a>& strider, U32 index, S32 count)
 {
-	return VertexBufferStrider<LLVector4,TYPE_CLOTHWEIGHT>::get(*this, strider, index, count);
+	return VertexBufferStrider<LLVector4a,TYPE_CLOTHWEIGHT>::get(*this, strider, index, count);
 }
 
 //----------------------------------------------------------------------------
diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h
index 571856f0138..b2a1121bb63 100644
--- a/indra/llrender/llvertexbuffer.h
+++ b/indra/llrender/llvertexbuffer.h
@@ -180,17 +180,14 @@ class LLVertexBuffer final : public LLRefCount
 	bool getTexCoord1Strider(LLStrider<LLVector2>& strider, U32 index=0, S32 count = -1);
 	bool getTexCoord2Strider(LLStrider<LLVector2>& strider, U32 index=0, S32 count = -1);
 	bool getNormalStrider(LLStrider<LLVector3>& strider, U32 index=0, S32 count = -1);
+	bool getNormalStrider(LLStrider<LLVector4a>& strider, U32 index=0, S32 count = -1);
 	bool getTangentStrider(LLStrider<LLVector3>& strider, U32 index=0, S32 count = -1);
 	bool getTangentStrider(LLStrider<LLVector4a>& strider, U32 index=0, S32 count = -1);
 	bool getColorStrider(LLStrider<LLColor4U>& strider, U32 index=0, S32 count = -1);
 	bool getEmissiveStrider(LLStrider<LLColor4U>& strider, U32 index=0, S32 count = -1);
 	bool getWeightStrider(LLStrider<F32>& strider, U32 index=0, S32 count = -1);
-	bool getWeight4Strider(LLStrider<LLVector4>& strider, U32 index=0, S32 count = -1);
-	bool getClothWeightStrider(LLStrider<LLVector4>& strider, U32 index=0, S32 count = -1);
-    bool getBasecolorTexcoordStrider(LLStrider<LLVector2>& strider, U32 index=0, S32 count = -1);
-    bool getNormalTexcoordStrider(LLStrider<LLVector2>& strider, U32 index=0, S32 count = -1);
-    bool getMetallicRoughnessTexcoordStrider(LLStrider<LLVector2>& strider, U32 index=0, S32 count = -1);
-    bool getEmissiveTexcoordStrider(LLStrider<LLVector2>& strider, U32 index=0, S32 count = -1);
+	bool getWeight4Strider(LLStrider<LLVector4a>& strider, U32 index=0, S32 count = -1);
+	bool getClothWeightStrider(LLStrider<LLVector4a>& strider, U32 index=0, S32 count = -1);
 	
     void setPositionData(const LLVector4a* data);
     void setTexCoordData(const LLVector2* data);
diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp
index 1af1286c73a..6773fd7f892 100644
--- a/indra/newview/llcompilequeue.cpp
+++ b/indra/newview/llcompilequeue.cpp
@@ -922,7 +922,7 @@ class LLScriptAssetUploadWithId: public LLScriptAssetUpload
 public:
 	LLScriptAssetUploadWithId(	LLUUID taskId, LLUUID itemId, TargetType_t targetType, 
 		bool isRunning, std::string scriptName, LLUUID queueId, LLUUID exerienceId, std::string buffer, taskUploadFinish_f finish )
-		:  LLScriptAssetUpload( taskId, itemId, targetType,  isRunning, exerienceId, buffer, finish),
+        :  LLScriptAssetUpload( taskId, itemId, targetType,  isRunning, exerienceId, buffer, finish, nullptr),
 		mScriptName(scriptName),
         mQueueId(queueId)
 	{
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 0dea0e2313f..123a83867ea 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -313,17 +313,6 @@ void LLDrawPoolBump::beginFullbrightShiny()
     }
 
 	{
-		LLMatrix4 mat;
-		mat.initRows(LLVector4(gGLModelView+0),
-					 LLVector4(gGLModelView+4),
-					 LLVector4(gGLModelView+8),
-					 LLVector4(gGLModelView+12));
-		shader->bind();
-        
-		LLVector3 vec = LLVector3(gShinyOrigin) * mat;
-		LLVector4 vec4(vec, gShinyOrigin.mV[3]);
-		shader->uniform4fv(LLViewerShaderMgr::SHINY_ORIGIN, 1, vec4.mV);
-
         if (LLPipeline::sReflectionProbesEnabled)
         {
             gPipeline.bindReflectionProbes(*shader);
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index acbc3495674..d6c938c14e0 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -32,7 +32,6 @@
 #include "llface.h"
 #include "llimage.h"
 #include "llrender.h"
-#include "llatmosphere.h"
 #include "llenvironment.h" 
 #include "llglslshader.h"
 #include "llgl.h"
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index ab81401019b..50f46a46d9b 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -2347,7 +2347,7 @@ void LLFace::setViewerObject(LLViewerObject* objp)
 }
 
 
-const LLMatrix4& LLFace::getRenderMatrix() const
+const LLMatrix4a& LLFace::getRenderMatrix() const
 {
 	return mDrawablep->getRenderMatrix();
 }
diff --git a/indra/newview/llfloaterassetrecovery.cpp b/indra/newview/llfloaterassetrecovery.cpp
index 28a5927c1e2..6e66901d39c 100644
--- a/indra/newview/llfloaterassetrecovery.cpp
+++ b/indra/newview/llfloaterassetrecovery.cpp
@@ -341,12 +341,12 @@ void LLAssetRecoverQueue::onCreateItem(const LLUUID& idItem)
 			case LLAssetType::AT_LSL_TEXT:
 				strCapsUrl = gAgent.getRegion()->getCapability("UpdateScriptAgent");
 				uploadInfo = std::make_shared<LLScriptAssetUpload>(idItem, strBuffer,
-                                                                   boost::bind(&LLAssetRecoverQueue::onSavedAsset, this, _1, _4));
+                                                                   boost::bind(&LLAssetRecoverQueue::onSavedAsset, this, _1, _4), nullptr);
 				break;
 			case LLAssetType::AT_NOTECARD:
 				strCapsUrl = gAgent.getRegion()->getCapability("UpdateNotecardAgentInventory");
 				uploadInfo = std::make_shared<LLBufferedAssetUploadInfo>(itItem->idItem, LLAssetType::AT_NOTECARD, strBuffer,
-                                                                         boost::bind(&LLAssetRecoverQueue::onSavedAsset, this, _1, _4));
+                                                                         boost::bind(&LLAssetRecoverQueue::onSavedAsset, this, _1, _4), nullptr);
 				break;
 			default:
 				LL_WARNS() << "Unsupported iventory type '" << pItem->getType() << "' for asset recovery" << LL_ENDL;
diff --git a/indra/newview/llfloaterhexeditor.cpp b/indra/newview/llfloaterhexeditor.cpp
index 7c7e3649c32..ca61995fa94 100644
--- a/indra/newview/llfloaterhexeditor.cpp
+++ b/indra/newview/llfloaterhexeditor.cpp
@@ -363,7 +363,7 @@ void LLFloaterHexEditor::onClickSave()
 		url = gAgent.getRegion()->getCapability("UpdateScriptAgent");
             uploadInfo = std::make_shared<LLScriptAssetUpload>(mItem->getUUID(), 
                                                                std::string(reinterpret_cast<char*>(buffer.get())), 
-                                                               boost::bind(&LLFloaterHexEditor::onSavedAsset, this, _1, _4));
+                                                               boost::bind(&LLFloaterHexEditor::onSavedAsset, this, _1, _4), nullptr);
 		break;
 	}
 	case LLAssetType::AT_GESTURE:
@@ -371,7 +371,7 @@ void LLFloaterHexEditor::onClickSave()
 		url = gAgent.getRegion()->getCapability("UpdateGestureAgentInventory");
         uploadInfo = std::make_shared<LLBufferedAssetUploadInfo>(mItem->getUUID(), LLAssetType::AT_GESTURE,
                                                                  std::string(reinterpret_cast<char*>(buffer.get())),
-                                                                 boost::bind(&LLFloaterHexEditor::onSavedAsset, this, _1, _4));
+                                                                 boost::bind(&LLFloaterHexEditor::onSavedAsset, this, _1, _4), nullptr);
 		break;
 	}
 	case LLAssetType::AT_NOTECARD:
@@ -379,7 +379,7 @@ void LLFloaterHexEditor::onClickSave()
 		url = gAgent.getRegion()->getCapability("UpdateNotecardAgentInventory");
         uploadInfo = std::make_shared<LLBufferedAssetUploadInfo>(mItem->getUUID(), LLAssetType::AT_NOTECARD,
                                                                  std::string(reinterpret_cast<char*>(buffer.get())),
-                                                                 boost::bind(&LLFloaterHexEditor::onSavedAsset, this, _1, _4));
+                                                                 boost::bind(&LLFloaterHexEditor::onSavedAsset, this, _1, _4), nullptr);
 		break;
 	}
 	case LLAssetType::AT_SETTINGS:
@@ -387,7 +387,7 @@ void LLFloaterHexEditor::onClickSave()
         url = gAgent.getRegion()->getCapability("UpdateSettingsAgentInventory");
         uploadInfo = std::make_shared<LLBufferedAssetUploadInfo>(mItem->getUUID(), LLAssetType::AT_SETTINGS,
                                                                  std::string(reinterpret_cast<char*>(buffer.get())),
-                                                                 boost::bind(&LLFloaterHexEditor::onSavedAsset, this, _1, _4));
+                                                                 boost::bind(&LLFloaterHexEditor::onSavedAsset, this, _1, _4), nullptr);
         break;
     }
 	default:
diff --git a/indra/newview/llfloatertexturepicker.cpp b/indra/newview/llfloatertexturepicker.cpp
index 0ef42536f4a..4efe2e2243a 100644
--- a/indra/newview/llfloatertexturepicker.cpp
+++ b/indra/newview/llfloatertexturepicker.cpp
@@ -31,11 +31,15 @@
 #include "llcheckboxctrl.h"
 #include "llcombobox.h"
 #include "lldraghandle.h"
+#include "llfilepicker.h"
 #include "llfiltereditor.h"
 #include "llfloaterreg.h"
 #include "llfloatertexturepicker.h"
+#include "llgltfmateriallist.h"
+#include "lllocalgltfmaterials.h"
 #include "llinventoryfunctions.h"
 #include "llinventorypanel.h"
+#include "llmaterialeditor.h"
 #include "llselectmgr.h"
 #include "llscrolllistctrl.h"
 #include "lltabcontainer.h"
@@ -43,6 +47,7 @@
 #include "lltoolpipette.h"
 #include "lltrans.h"
 #include "llviewercontrol.h"
+#include "llviewermenufile.h"
 
 #include "llavatarappearancedefines.h"
 
diff --git a/indra/newview/llgltfmateriallist.cpp b/indra/newview/llgltfmateriallist.cpp
index 4051521ad4b..89af7b44834 100644
--- a/indra/newview/llgltfmateriallist.cpp
+++ b/indra/newview/llgltfmateriallist.cpp
@@ -47,9 +47,6 @@
 #include "tinygltf/tiny_gltf.h"
 #include <strstream>
 
-#include "json/reader.h"
-#include "json/value.h"
-
 #include <unordered_set>
 
 LLGLTFMaterialList gGLTFMaterialList;
diff --git a/indra/newview/lllocalgltfmaterials.cpp b/indra/newview/lllocalgltfmaterials.cpp
index a9099b1ce92..76f68457d76 100644
--- a/indra/newview/lllocalgltfmaterials.cpp
+++ b/indra/newview/lllocalgltfmaterials.cpp
@@ -133,7 +133,7 @@ bool LLLocalGLTFMaterial::updateSelf()
 #ifndef LL_WINDOWS
             const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(mFilename));
 #else
-            const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(utf8str_to_utf16str(mFilename)));
+            const std::time_t temp_time = boost::filesystem::last_write_time(boost::filesystem::path(ll_convert_string_to_wide(mFilename)));
 #endif
             LLSD new_last_modified = asctime(localtime(&temp_time));
 
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 98160ce2a21..dd7691fb3e0 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -2827,7 +2827,7 @@ void LLPanelFace::updateShinyControls(bool is_setting_texture, bool mess_with_sh
 	U32 material_type = radio_mat_type->getSelectedIndex();
 	bool show_material = (materials_media == MATMEDIA_MATERIAL);
 	bool show_shininess = show_material && (material_type == MATTYPE_SPECULAR) && mComboMatMedia->getEnabled();
-	U32 shiny_value = comboShiny->getCurrentIndex();
+	U32 shiny_value = mComboShininess->getCurrentIndex();
 	bool show_shinyctrls = (shiny_value == SHINY_TEXTURE) && show_shininess; // Use texture
 	getChildView("label glossiness")->setVisible(show_shinyctrls);
     mSpinGlossiness->setVisible(show_shinyctrls);
diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp
index 6f78f3c8c03..bbed3a2cd8a 100644
--- a/indra/newview/llpresetsmanager.cpp
+++ b/indra/newview/llpresetsmanager.cpp
@@ -324,7 +324,6 @@ void LLPresetsManager::getGraphicsControlNames(std::vector<std::string>& names)
 		"RenderToneMapType",
 		"RenderTransparentWater",
 		"RenderTreeLODFactor",
-		"RenderVBOEnable",
 		"RenderVolumeLODFactor",
 		"RenderWaterRefResolution",
 		"TextureMemory",
diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp
index 61d87564901..117dbd59e00 100644
--- a/indra/newview/llreflectionmapmanager.cpp
+++ b/indra/newview/llreflectionmapmanager.cpp
@@ -800,8 +800,7 @@ void LLReflectionMapManager::updateUniforms()
     ReflectionProbeData rpd;
 
     // load modelview matrix into matrix 4a
-    LLMatrix4a modelview;
-    modelview.loadu(gGLModelView);
+    LLMatrix4a modelview = gGLModelView;
     LLVector4a oa; // scratch space for transformed origin
 
     S32 count = 0;
diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp
index 6cdf8cc914c..492464e9aa5 100644
--- a/indra/newview/llsnapshotlivepreview.cpp
+++ b/indra/newview/llsnapshotlivepreview.cpp
@@ -774,7 +774,6 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
 			previewp->mPreviewImageEncoded = last_preview_encoded;
 			previewp->generateThumbnailImage(FALSE);
             previewp->getWindow()->decBusyCount();
-			gPipeline.doResetVertexBuffers(true);
 		}
     }
     // Tell the floater container that the snapshot is updated now
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index a8054648dd8..54594c54f03 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -711,6 +711,7 @@ BOOL LLSpatialGroup::changeLOD()
 #endif
        
 			return TRUE;
+		}
 	}
 	
 	if (needsUpdate())
diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h
index 37a788c27aa..c5eb93979fd 100644
--- a/indra/newview/lltexturectrl.h
+++ b/indra/newview/lltexturectrl.h
@@ -64,6 +64,7 @@ bool get_can_copy_texture(LLUUID image_id);
 //////////////////////////////////////////////////////////////////////////////////////////
 // LLTextureCtrl
 
+
 class LLTextureCtrl
 : public LLUICtrl
 {
@@ -259,6 +260,7 @@ class LLTextureCtrl
 	std::string				 	mLoadingPlaceholderString;
 	S32						 	mLabelWidth;
 	bool						mOpenTexPreview;
+	bool						mBakeTextureEnabled;
     LLTextureCtrl::EPickInventoryType mInventoryPickType;
 };
 
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 7f88598cc2a..2a346f9cd8f 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -676,9 +676,9 @@ void settings_setup_listeners()
 	setting_setup_signal_listener(gSavedSettings, "RenderMaxPartCount", handleMaxPartCountChanged);
 	setting_setup_signal_listener(gSavedSettings, "RenderDynamicLOD", handleRenderDynamicLODChanged);
 	setting_setup_signal_listener(gSavedSettings, "RenderLocalLights", handleRenderLocalLightsChanged);
-	setting_setup_signal_listener(gSavedSettings, "RenderAutoMaskAlphaUseRMSE", handleResetVertexBuffersChanged);
-	setting_setup_signal_listener(gSavedSettings, "RenderAutoMaskAlphaMaxRMSE", handleResetVertexBuffersChanged);
-	setting_setup_signal_listener(gSavedSettings, "RenderAutoMaskAlphaMaxMid", handleResetVertexBuffersChanged);
+	setting_setup_signal_listener(gSavedSettings, "RenderAutoMaskAlphaUseRMSE", handleSetShaderChanged);
+	setting_setup_signal_listener(gSavedSettings, "RenderAutoMaskAlphaMaxRMSE", handleSetShaderChanged);
+	setting_setup_signal_listener(gSavedSettings, "RenderAutoMaskAlphaMaxMid", handleSetShaderChanged);
 	setting_setup_signal_listener(gSavedSettings, "RenderVSyncEnable", handleVSyncChanged);
 	setting_setup_signal_listener(gSavedSettings, "RenderDeferredNoise", handleReleaseGLBufferChanged);
 	setting_setup_signal_listener(gSavedSettings, "RenderDebugPipeline", handleRenderDebugPipelineChanged);
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 9d9af510dec..aa7d128b129 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -848,8 +848,6 @@ pProgFloater->setProgressCancelButtonVisible(FALSE, LLTrans::getString("Cancel")
 			glClear(GL_COLOR_BUFFER_BIT);
 		}
 
-		LLVBOPool::deleteReleasedBuffers();
-
 		LLAppViewer::instance()->pingMainloopTimeout(STR_DISPLAY_RENDER_START);
 		
 		//// render frontmost floater opaque for occlusion culling purposes
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index 88eab349d57..8d117f9f262 100644
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -389,7 +389,9 @@ void update_statistics()
 
 	LLTrace::Recording& last_frame_recording = LLTrace::get_frame_recording().getLastRecording();
 
-	sample(LLStatViewer::ENABLE_VBO,      (F64)LLVertexBuffer::sEnableVBOs);
+	record(LLStatViewer::TRIANGLES_DRAWN_PER_FRAME, last_frame_recording.getSum(LLStatViewer::TRIANGLES_DRAWN));
+
+	sample(LLStatViewer::ENABLE_VBO,      (F64)TRUE);
 	sample(LLStatViewer::LIGHTING_DETAIL, (F64)gPipeline.getLightingDetail());
 	sample(LLStatViewer::DRAW_DISTANCE,   (F64)LLPipeline::RenderFarClip);
 
diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp
index b5474970e85..a58a63ac328 100644
--- a/indra/newview/llviewertexlayer.cpp
+++ b/indra/newview/llviewertexlayer.cpp
@@ -389,7 +389,7 @@ class ALTexLayerUploader final : public LLBufferedAssetUploadInfo
 };
 
 ALTexLayerUploader::ALTexLayerUploader(LLUUID assetId, std::string texture, LLBakedUploadData* baked_upload_data) :
-	LLBufferedAssetUploadInfo(LLUUID::null, LLAssetType::AT_TEXTURE, texture, NULL),
+	LLBufferedAssetUploadInfo(LLUUID::null, LLAssetType::AT_TEXTURE, texture, NULL, nullptr),
 	mBakedUploadData(baked_upload_data)
 {
 	setAssetId(assetId);
diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp
index 63380aa6c1c..089977280ad 100644
--- a/indra/newview/llvopartgroup.cpp
+++ b/indra/newview/llvopartgroup.cpp
@@ -862,7 +862,6 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group)
     S32 indices_idx = 0;
 
 	LLSpatialGroup::drawmap_elem_t& draw_vec = group->mDrawMap[mRenderPass];	
- w	
 	for (LLFace* facep : mFaceList)
 	{
 		LLAlphaObject* object = (LLAlphaObject*) facep->getViewerObject();
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index f2a76c0f2fb..63cf8d5178f 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1205,7 +1205,10 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &params_in, const S32 detail, bo
 				{
 					sculpt();
 				}
-        return TRUE;
+			}
+		}
+
+		return TRUE;
 	}
 	else if (NO_LOD == lod) 
 	{
@@ -2469,7 +2472,7 @@ S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID)
 S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams)
 {
 	S32 res = LLViewerObject::setTEMaterialParams(te, pMaterialParams);
-
+#ifdef SHOW_DEBUG
 	LL_DEBUGS("MaterialTEs") << "te " << (S32)te << " material " << ((pMaterialParams) ? pMaterialParams->asLLSD() : LLSD("null")) << " res " << res
 							 << ( LLSelectMgr::getInstance()->getSelection()->contains(const_cast<LLVOVolume*>(this), te) ? " selected" : " not selected" )
 							 << LL_ENDL;
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 7e5f2d61f8a..876bc9bd296 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -714,6 +714,10 @@ class LLPipeline
 	U32					mNoiseMap;
 	U32					mTrueNoiseMap;
 	U32					mLightFunc;
+    U32					mAreaMap;
+    U32					mSearchMap;
+    U32					mSampleMap;
+    U32                 mStencilMap;
 
 	LLColor4			mSunDiffuse;
     LLColor4			mMoonDiffuse;
-- 
GitLab