diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp
index 566548bb35f8aa55e743a7c4c092585f80440766..b83baee33ccb4cf905a52d2f619e62958a76c342 100644
--- a/indra/llcommon/llmemory.cpp
+++ b/indra/llcommon/llmemory.cpp
@@ -121,7 +121,7 @@ void LLMemory::updateMemoryInfo()
 	{
 		sAvailPhysicalMemInKB = U32Kilobytes(0);
 	}
-
+#endif
 #elif defined(LL_DARWIN)
     task_vm_info info;
     mach_msg_type_number_t  infoCount = TASK_VM_INFO_COUNT;
diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp
index 8b72b57dda4dea64c5cd3568a408bb25fa88c370..309bd2761f139beedc6ac717305e0aaa440a001e 100644
--- a/indra/llcommon/llqueuedthread.cpp
+++ b/indra/llcommon/llqueuedthread.cpp
@@ -242,7 +242,6 @@ bool LLQueuedThread::addRequest(QueuedRequest* req)
 #if _DEBUG
 // 	LL_INFOS() << llformat("LLQueuedThread::Added req [%08d]",handle) << LL_ENDL;
 #endif
-	mRequestQueueSize = mRequestQueue.size();
 	unlockData();
 
     llassert(!mDataLock->isSelfLocked());
diff --git a/indra/llcommon/threadpool.h b/indra/llcommon/threadpool.h
index eb23dd3ece020137d3382a218003306a40b744c1..60f4a0ce1bc4c0d99da918320288518e313880bf 100644
--- a/indra/llcommon/threadpool.h
+++ b/indra/llcommon/threadpool.h
@@ -94,7 +94,6 @@ namespace LL
         std::string mName;
         size_t mThreadCount;
         std::vector<std::pair<std::string, std::thread>> mThreads;
-        EThreadPrio mThreadPriority;
     };
 
     /**
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index 58e76c4710d757577a58ec293936988bb47fec51..e6c649076f46720a31e73aebbdf9670590e74a11 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -630,7 +630,7 @@ const LLSettingsSky::validation_list_t& LLSettingsSky::validationList()
             boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(1.0f)))));
 
         validation.push_back(Validator(SETTING_REFLECTION_PROBE_AMBIANCE, false, LLSD::TypeReal,
-            boost::bind(&Validator::verifyFloatRange, _1, _2, LLSD(LLSDArray(0.0f)(1.0f)))));
+            boost::bind(&Validator::verifyFloatRange, boost::placeholders::_1, boost::placeholders::_2, LLSD(LLSDArray(0.0f)(1.0f)))));
 
         validation.push_back(Validator(SETTING_RAYLEIGH_CONFIG, true, LLSD::TypeArray, &validateRayleighLayers));
         validation.push_back(Validator(SETTING_ABSORPTION_CONFIG, true, LLSD::TypeArray, &validateAbsorptionLayers));
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 611238da77ed7890e23a9185d7a97545394bed79..7b2c500ecd739ca5d514dde944daa1957925a43a 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -58,8 +58,6 @@
 #include "mikktspace/mikktspace.h"
 #include "mikktspace/mikktspace.c" // insert mikktspace implementation into llvolume object file
 
-#include "meshoptimizer/meshoptimizer.h"
-
 #define DEBUG_SILHOUETTE_BINORMALS 0
 #define DEBUG_SILHOUETTE_NORMALS 0 // TomY: Use this to display normals using the silhouette
 #define DEBUG_SILHOUETTE_EDGE_MAP 0 // DaveP: Use this to display edge map using the silhouette
@@ -4802,7 +4800,7 @@ LLVolumeFace::LLVolumeFace(const LLVolumeFace& src)
 	mIndices(NULL),
 	mWeights(NULL),
     mWeightsScrubbed(FALSE),
-	mOctree(NULL),
+    mOctree(NULL),
     mOctreeTriangles(NULL),
 	mOptimized(FALSE)
 {
@@ -4846,7 +4844,7 @@ LLVolumeFace& LLVolumeFace::operator=(const LLVolumeFace& src)
 
 		if (src.mNormals)
 		{
-			LLVector4a::memcpyNonAliased16((F32*) mNormals, (F32*) src.mNormals, vert_size);
+		LLVector4a::memcpyNonAliased16((F32*) mNormals, (F32*) src.mNormals, vert_size);
 		}
 
 		if(src.mTexCoords)
@@ -4936,10 +4934,26 @@ LLVolumeFace::~LLVolumeFace()
 
 void LLVolumeFace::freeData()
 {
-	allocateVertices(0);
-	allocateTangents(0);
-	allocateWeights(0);
-	allocateIndices(0);
+	ll_aligned_free<64>(mPositions);
+	mPositions = NULL;
+
+	//normals and texture coordinates are part of the same buffer as mPositions, do not free them separately
+	mNormals = NULL;
+	mTexCoords = NULL;
+
+	ll_aligned_free_16(mIndices);
+	mIndices = NULL;
+	ll_aligned_free_16(mTangents);
+	mTangents = NULL;
+	ll_aligned_free_16(mWeights);
+	mWeights = NULL;
+
+#if USE_SEPARATE_JOINT_INDICES_AND_WEIGHTS
+    ll_aligned_free_16(mJointIndices);
+	mJointIndices = NULL;
+    ll_aligned_free_16(mJustWeights);
+	mJustWeights = NULL;
+#endif
 
     destroyOctree();
 }
diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h
index e1bcc276856cfea4eeac346d2e290fea53bacc15..115c0aff23a9bebe4a35ca2c0731d53b1b264943 100644
--- a/indra/llmath/llvolume.h
+++ b/indra/llmath/llvolume.h
@@ -874,12 +874,11 @@ class LLVolumeFace
 	BOOL create(LLVolume* volume, BOOL partial_build = FALSE);
 	void createTangents();
 	
-	bool resizeVertices(S32 num_verts);
-	bool allocateTangents(S32 num_verts);
-	bool allocateWeights(S32 num_verts);
-	bool allocateVertices(S32 num_verts, bool copy = false);
-	bool allocateIndices(S32 num_indices, bool copy = false);
-	bool resizeIndices(S32 num_indices);
+	void resizeVertices(S32 num_verts);
+	void allocateTangents(S32 num_verts);
+	void allocateWeights(S32 num_verts);
+    void allocateJointIndices(S32 num_verts);
+	void resizeIndices(S32 num_indices);
 	void fillFromLegacyData(std::vector<LLVolumeFace::VertexData>& v, std::vector<U16>& idx);
 
 	void pushVertex(const VertexData& cv);
diff --git a/indra/llprimitive/llgltfmaterial.h b/indra/llprimitive/llgltfmaterial.h
index b453b91e6740ac07edd39c07eb88629c9986a70c..4338f138c59246b0f5203e9b29c31f03c4c6e34f 100644
--- a/indra/llprimitive/llgltfmaterial.h
+++ b/indra/llprimitive/llgltfmaterial.h
@@ -34,6 +34,7 @@
 #include "lluuid.h"
 #include "hbxxh.h"
 
+#include <array>
 #include <string>
 
 namespace tinygltf
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 2ebfd9112b0847957449ab973a027ff10a2799be..23bb70bb678ad66ea9edf093461c35a21c5c3760 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -1463,7 +1463,7 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt
             glTexImage2D(target, miplevel, intformat, width, height, 0, pixformat, pixtype, nullptr);
         }
 
-        U8* src = (U8*)(use_scratch ? scratch : pixels);
+        U8* src = (U8*)pixels;
         if (src)
         {
             LL_PROFILE_ZONE_NAMED("glTexImage2D copy");
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 4dd9d2098c852f6943297e0dc7ce3215f4fa3af2..1cff93ae4a4b38e8c546f7a4d4bea7145796cbd8 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1099,8 +1099,8 @@ void LLRender::syncMatrices()
 			// Anything beyond the standard proj and inv proj mats are special cases.  Please setup special uniforms accordingly in the future.
             if (shader->getUniformLocation(LLShaderMgr::INVERSE_PROJECTION_MATRIX))
             {
-	            LLMatrix4a inv_proj = mat
-	            mat.invert();
+	            LLMatrix4a inv_proj = mat;
+	            inv_proj.invert();
 	            shader->uniformMatrix4fv(LLShaderMgr::INVERSE_PROJECTION_MATRIX, 1, FALSE, inv_proj.getF32ptr());
             }
 
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 5d192b79a498c797fa179c077bb8459e75096522..6ac93a56b9b4dbbb2474cf9e4382f4a132690089 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -479,7 +479,7 @@ void LLShaderMgr::dumpObjectLog(GLuint ret, BOOL warns, const std::string& filen
 	}
  }
 
-GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, boost::unordered_map<std::string, std::string>* defines, S32 texture_index_channels)
+GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, std::unordered_map<std::string, std::string>* defines, S32 texture_index_channels)
 {
 
 // endsure work-around for missing GLSL funcs gets propogated to feature shader files (e.g. srgbF.glsl)
@@ -709,7 +709,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev
 
 	if (defines)
 	{
-		for (boost::unordered_map<std::string,std::string>::iterator iter = defines->begin(); iter != defines->end(); ++iter)
+		for (std::unordered_map<std::string,std::string>::iterator iter = defines->begin(); iter != defines->end(); ++iter)
 		{
 			std::string define = "#define " + iter->first + " " + iter->second + "\n";
 			extra_code_text[extra_code_count++] = (GLchar *) strdup(define.c_str());
diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h
index 7e5ecefb0e9df0577dfaf80503cf0ad56057f5a3..127290a973f845bfbc665abee3c4f8cbac581e75 100644
--- a/indra/llrender/llshadermgr.h
+++ b/indra/llrender/llshadermgr.h
@@ -304,7 +304,7 @@ class LLShaderMgr
     void dumpShaderSource(U32 shader_code_count, GLchar** shader_code_text);
 	BOOL	linkProgramObject(GLuint obj, BOOL suppress_errors = FALSE);
 	BOOL	validateProgramObject(GLuint obj);
-	GLuint loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, boost::unordered_map<std::string, std::string>* defines = NULL, S32 texture_index_channels = -1);
+	GLuint loadShaderFile(const std::string& filename, S32 & shader_level, GLenum type, std::unordered_map<std::string, std::string>* defines = NULL, S32 texture_index_channels = -1);
 
 	// Implemented in the application to actually point to the shader directory.
 	virtual std::string getShaderDirPrefix(void) = 0; // Pure Virtual
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 9fb5eef3a25be433c354e61d94ed5cf99898284e..e75a6424bd801df1578aaaf701f8fcd023a4d7de 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -582,7 +582,6 @@ const U32 LLVertexBuffer::sGLMode[LLRender::NUM_MODES] =
 	GL_POINTS,
 	GL_LINES,
 	GL_LINE_STRIP,
-	GL_QUADS,
 	GL_LINE_LOOP,
 };
 
diff --git a/indra/newview/alfloaterparticleeditor.cpp b/indra/newview/alfloaterparticleeditor.cpp
index ba1a018adeb7fc179feaa707088d9502b26a70c7..7e423e7984da392f7a986cb5c6394eeb87f0f8cd 100644
--- a/indra/newview/alfloaterparticleeditor.cpp
+++ b/indra/newview/alfloaterparticleeditor.cpp
@@ -605,7 +605,7 @@ void ALFloaterParticleEditor::callbackReturned(const LLUUID& inventoryItemID)
 	LLBufferedAssetUploadInfo::taskUploadFinish_f proc =
 		boost::bind(&ALFloaterParticleEditor::finishUpload, _1, _2, _3, _4, true, mObject->getID());
 	LLResourceUploadInfo::ptr_t uploadInfo(new LLScriptAssetUpload(mObject->getID(), inventoryItemID,
-		LLScriptAssetUpload::MONO, true, LLUUID::null, script, proc));
+		LLScriptAssetUpload::MONO, true, LLUUID::null, script, proc, [](LLUUID itemId, LLUUID taskId, LLSD response, std::string reason){ return true; }));
 	LLViewerAssetUpload::EnqueueInventoryUpload(url, uploadInfo);
 
     if (mCloseAfterSave) closeFloater();
diff --git a/indra/newview/alrenderutils.cpp b/indra/newview/alrenderutils.cpp
index d9a307da5778683de031e0dc1924842c201cb4a0..72be0abfa220271a56da80535bc73b4e9aa15790 100644
--- a/indra/newview/alrenderutils.cpp
+++ b/indra/newview/alrenderutils.cpp
@@ -262,8 +262,8 @@ ALRenderUtil::ALRenderUtil()
 
 void ALRenderUtil::restoreVertexBuffers()
 {
-	mRenderBuffer = new LLVertexBuffer(ALRENDER_BUFFER_MASK, 0);
-	mRenderBuffer->allocateBuffer(3, 0, true);
+	mRenderBuffer = new LLVertexBuffer(ALRENDER_BUFFER_MASK);
+	mRenderBuffer->allocateBuffer(3, 0);
 
 	LLStrider<LLVector3> vert;
 	LLStrider<LLVector2> tc0;
@@ -276,7 +276,7 @@ void ALRenderUtil::restoreVertexBuffers()
 	vert[1].set(3.f, -1.f, 0.f);
 	vert[2].set(-1.f, 3.f, 0.f);
 
-	mRenderBuffer->flush();
+	mRenderBuffer->unmapBuffer();
 }
 
 void ALRenderUtil::resetVertexBuffers()
@@ -585,7 +585,7 @@ void ALRenderUtil::renderTonemap(LLRenderTarget* src, LLRenderTarget* dst, LLRen
 		tone_shader->uniform4fv(LLShaderMgr::COLORGRADE_LUT_SIZE, 1, mCGLutSize.mV);
 	}
 
-	mRenderBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX);
+	mRenderBuffer->setBuffer();
 	mRenderBuffer->drawArrays(LLRender::TRIANGLES, 0, 3);
 	stop_glerror();
 
@@ -676,9 +676,9 @@ void ALRenderUtil::renderSharpen(LLRenderTarget* src, LLRenderTarget* dst)
 	sharpen_shader->bind();
 
 	// Draw
-	src->bindTexture(0, 0, LLTexUnit::TFO_POINT, LLTexUnit::TCS_LINEAR);
+	src->bindTexture(0, 0, LLTexUnit::TFO_POINT);
 
-	mRenderBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX);
+	mRenderBuffer->setBuffer();
 	mRenderBuffer->drawArrays(LLRender::TRIANGLES, 0, 3);
 
 	if (dst)
diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp
index 647e9055e7439c94960857f2786fa54b916e9211..0188040b83a28bdacd89ffee747af9b6c5b286c0 100644
--- a/indra/newview/llviewerassetupload.cpp
+++ b/indra/newview/llviewerassetupload.cpp
@@ -826,7 +826,7 @@ bool LLBufferedAssetUploadInfo::failedUpload(LLSD &result, std::string &reason)
 
 //=========================================================================
 
-LLScriptAssetUpload::LLScriptAssetUpload(LLUUID itemId, std::string buffer, invnUploadFinish_f finish, TargetType_t targetType, uploadFailed_f failed):
+LLScriptAssetUpload::LLScriptAssetUpload(LLUUID itemId, std::string buffer, invnUploadFinish_f finish, uploadFailed_f failed, TargetType_t targetType):
     LLBufferedAssetUploadInfo(itemId, LLAssetType::AT_LSL_TEXT, buffer, finish, failed),
     mExerienceId(),
     mTargetType(targetType),
diff --git a/indra/newview/llviewerassetupload.h b/indra/newview/llviewerassetupload.h
index e8017432f400b248a073f3b98cefdb338261d220..f2c6fb03b6963d39b5036ce602f5bfbc0e1a8094 100644
--- a/indra/newview/llviewerassetupload.h
+++ b/indra/newview/llviewerassetupload.h
@@ -264,7 +264,7 @@ class LLScriptAssetUpload : public LLBufferedAssetUploadInfo
         MONO
     };
 
-    LLScriptAssetUpload(LLUUID itemId, std::string buffer, invnUploadFinish_f finish, TargetType_t targetType = MONO, uploadFailed_f failed);
+    LLScriptAssetUpload(LLUUID itemId, std::string buffer, invnUploadFinish_f finish, uploadFailed_f failed, TargetType_t targetType = MONO);
     LLScriptAssetUpload(LLUUID taskId, LLUUID itemId, TargetType_t targetType, 
             bool isRunning, LLUUID exerienceId, std::string buffer, taskUploadFinish_f finish, uploadFailed_f failed);
 
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 18c15d5a57fb8e52eebd8025ddb3d28c505b8a00..a17ed7bd49e06171db905bb33dd67eb41445cfec 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -5493,8 +5493,8 @@ BOOL LLViewerWindow::cubeSnapshot(const LLVector3& origin, LLCubeMapArray* cubea
     LLViewerCamera* camera = LLViewerCamera::getInstance();
     
     LLViewerCamera saved_camera = LLViewerCamera::instance();
-    glh::matrix4f saved_proj = get_current_projection();
-    glh::matrix4f saved_mod = get_current_modelview();
+    LLMatrix4a saved_proj = get_current_projection();
+    LLMatrix4a saved_mod = get_current_modelview();
 
     // camera constants for the square, cube map capture image
     camera->setAspect(1.0); // must set aspect ratio first to avoid undesirable clamping of vertical FoV
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index a38e3facc9f48a83322a808cec3ab24809b6d7fd..7e5f2d61f8aadc0be50ae34343552f51751bf5ae 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -289,7 +289,7 @@ class LLPipeline
 
 	void renderHighlight(const LLViewerObject* obj, F32 fade);
 	
-	void renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera& camera, LLCullResult& result, bool depth_clamp);
+	void renderShadow(LLMatrix4a& view, LLMatrix4a& proj, LLCamera& camera, LLCullResult& result, bool depth_clamp);
 	void renderHighlights();
 	void renderDebug();
 	void renderPhysicsDisplay();
@@ -689,10 +689,10 @@ class LLPipeline
 	LLCamera				mShadowCamera[8];
 	LLVector3				mShadowExtents[4][2];
     // TODO : separate Sun Shadow and Spot Shadow matrices
-	glh::matrix4f			mSunShadowMatrix[6];
-	glh::matrix4f			mShadowModelview[6];
-	glh::matrix4f			mShadowProjection[6];
-    glh::matrix4f           mReflectionModelView;
+	LLMatrix4a				mSunShadowMatrix[6];
+	LLMatrix4a				mShadowModelview[6];
+	LLMatrix4a				mShadowProjection[6];
+    LLMatrix4a			    mReflectionModelView;
 
 	LLPointer<LLDrawable>	mShadowSpotLight[2];
 	F32						mSpotLightFade[2];