From 15b3c9f1643368fe0c5356ea11288525bbe9fbb3 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 13 Jun 2024 02:22:03 +0200 Subject: Fix a few merge issues --- indra/llrender/llglslshader.cpp | 2 +- indra/newview/llface.cpp | 8 ++++---- indra/newview/llpanelface.cpp | 1 - indra/newview/lltexturectrl.cpp | 7 +++++-- indra/newview/lltinygltfhelper.cpp | 4 ++-- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index e47c842228..45abb695cb 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -279,7 +279,7 @@ bool LLGLSLShader::readProfileQuery(bool for_runtime, bool force_read) GLuint64 samples_passed = 0; glGetQueryObjectui64v(mSamplesQuery, GL_QUERY_RESULT, &samples_passed); - U64 primitives_generated = 0; + GLuint64 primitives_generated = 0; glGetQueryObjectui64v(mPrimitivesQuery, GL_QUERY_RESULT, &primitives_generated); sTotalTimeElapsed += time_elapsed; diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 52062a3ad2..0e8e64af69 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1253,10 +1253,10 @@ bool LLFace::getGeometryVolume(const LLVolume& volume, { color = tep->getColor(); - if (tep->getGLTFRenderMaterial()) - { - color = tep->getGLTFRenderMaterial()->mBaseColor; - } + if (tep->getGLTFRenderMaterial()) + { + color = tep->getGLTFRenderMaterial()->mBaseColor; + } } if (rebuild_color) diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 226c32c396..89af765bb7 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1805,7 +1805,6 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) getChild("shinyOffsetV")->setValue(offset_y); getChild("glossiness")->setValue(material->getSpecularLightExponent()); getChild("environment")->setValue(material->getEnvironmentIntensity()); - getChild("mirror")->setValue(material->getEnvironmentIntensity()); updateShinyControls(!material->getSpecularID().isNull(), true); } diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 284fff4d8c..81a70a81cf 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -2243,8 +2243,11 @@ void LLTextureCtrl::draw() } else { - preview = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); - preview->setBoostLevel(LLGLTexture::BOOST_PREVIEW); + mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + mTexturep->setBoostLevel(LLGLTexture::BOOST_PREVIEW); + mTexturep->forceToSaveRawImage(0); + + preview = mTexturep; } } } diff --git a/indra/newview/lltinygltfhelper.cpp b/indra/newview/lltinygltfhelper.cpp index 7508956fd5..168708ca37 100644 --- a/indra/newview/lltinygltfhelper.cpp +++ b/indra/newview/lltinygltfhelper.cpp @@ -91,14 +91,14 @@ void LLTinyGLTFHelper::initFetchedTextures(tinygltf::Material& material, { if (material.pbrMetallicRoughness.metallicRoughnessTexture.index != material.occlusionTexture.index) { - LLImageDataLock lockIn(occlusion_img); - LLImageDataLock lockOut(mr_img); // occlusion is a distinct texture from pbrMetallicRoughness // pack into mr red channel int occlusion_idx = material.occlusionTexture.index; int mr_idx = material.pbrMetallicRoughness.metallicRoughnessTexture.index; if (occlusion_idx != mr_idx) { + LLImageDataLock lockIn(occlusion_img); + LLImageDataLock lockOut(mr_img); //scale occlusion image to match resolution of mr image occlusion_img->scale(mr_img->getWidth(), mr_img->getHeight()); -- cgit v1.2.3 From bb55d25d47849b82de7877ca68d7451d69428c3a Mon Sep 17 00:00:00 2001 From: mobserveur Date: Mon, 27 May 2024 05:08:01 +0200 Subject: fixed tracker beacon performance issue on apple silicon macs tracking beacon was causing extreme lag on apple silicon macs --- indra/newview/lltracker.cpp | 106 ++++++++++++++++++++++++++------------------ 1 file changed, 64 insertions(+), 42 deletions(-) diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index 56263f1afe..d794d7d690 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -489,11 +489,22 @@ void draw_shockwave(F32 center_z, F32 t, S32 steps, LLColor4 color) gGL.end(); } + void LLTracker::drawBeacon(LLVector3 pos_agent, std::string direction, LLColor4 fogged_color, F32 dist) { +#if LL_DARWIN + const U32 BEACON_VERTS = 16; +#else const U32 BEACON_VERTS = 256; +#endif + F32 step; + LLColor4 c_col = LLColor4(1, 1, 1, 1); + LLColor4 col_next = LLColor4(1, 1, 1, 1); + LLColor4 col_edge = LLColor4(1, 1, 1, 0); + LLColor4 col_edge_next = LLColor4(1, 1, 1, 0); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); @@ -509,51 +520,62 @@ void LLTracker::drawBeacon(LLVector3 pos_agent, std::string direction, LLColor4 step = pos_agent.mV[2] / BEACON_VERTS; } - gGL.color4fv(fogged_color.mV); + gGL.color4fv(fogged_color.mV); - LLVector3 x_axis = LLViewerCamera::getInstance()->getLeftAxis(); - F32 t = gRenderStartTime.getElapsedTimeF32(); + LLVector3 x_axis = LLViewerCamera::getInstance()->getLeftAxis(); + F32 t = gRenderStartTime.getElapsedTimeF32(); - for (U32 i = 0; i < BEACON_VERTS; i++) - { - F32 x = x_axis.mV[0]; - F32 y = x_axis.mV[1]; - - F32 z = i * step; - F32 z_next = (i+1)*step; - - bool tracking_avatar = getTrackingStatus() == TRACKING_AVATAR; - F32 a = pulse_func(t, z, tracking_avatar, direction); - F32 an = pulse_func(t, z_next, tracking_avatar, direction); - - LLColor4 c_col = fogged_color + LLColor4(a,a,a,a); - LLColor4 col_next = fogged_color + LLColor4(an,an,an,an); - LLColor4 col_edge = fogged_color * LLColor4(a,a,a,0.0f); - LLColor4 col_edge_next = fogged_color * LLColor4(an,an,an,0.0f); - - a *= 2.f; - a += 1.0f; - - an *= 2.f; - an += 1.0f; - - gGL.begin(LLRender::TRIANGLE_STRIP); - gGL.color4fv(col_edge.mV); - gGL.vertex3f(-x*a, -y*a, z); - gGL.color4fv(col_edge_next.mV); - gGL.vertex3f(-x*an, -y*an, z_next); - - gGL.color4fv(c_col.mV); - gGL.vertex3f(0, 0, z); - gGL.color4fv(col_next.mV); - gGL.vertex3f(0, 0, z_next); - - gGL.color4fv(col_edge.mV); - gGL.vertex3f(x*a,y*a,z); - gGL.color4fv(col_edge_next.mV); - gGL.vertex3f(x*an,y*an,z_next); - gGL.end(); + F32 x = x_axis.mV[0]; + F32 y = x_axis.mV[1]; + F32 z = 0.0f; + F32 z_next; + + F32 a,an; + F32 xa,ya; + F32 xan,yan; + + bool tracking_avatar = getTrackingStatus() == TRACKING_AVATAR; + + gGL.begin(LLRender::TRIANGLE_STRIP); + + for (U32 i = 0; i < BEACON_VERTS; i++) + { + z = i * step; + z_next = z + step; + + a = pulse_func(t, z, tracking_avatar, direction); + an = pulse_func(t, z_next, tracking_avatar, direction); + + c_col = fogged_color + LLColor4(a, a, a, a); + col_next = fogged_color + LLColor4(an, an, an, an); + col_edge = fogged_color * LLColor4(a, a, a, 0.0f); + col_edge_next = fogged_color * LLColor4(an, an, an, 0.0f); + + a = a + a + 1.f; + an = an + an + 1.0f; + + xa = x*a; + ya = y*a; + xan = x*an; + yan = y*an; + + gGL.color4fv(col_edge.mV); + gGL.vertex3f(-xa, -ya, z); + gGL.color4fv(col_edge_next.mV); + gGL.vertex3f(-xan, -yan, z_next); + + gGL.color4fv(c_col.mV); + gGL.vertex3f(0, 0, z); + gGL.color4fv(col_next.mV); + gGL.vertex3f(0, 0, z_next); + + gGL.color4fv(col_edge.mV); + gGL.vertex3f(xa, ya, z); + gGL.color4fv(col_edge_next.mV); + gGL.vertex3f(xan, yan, z_next); } + + gGL.end(); gGL.popMatrix(); } -- cgit v1.2.3 From 219448127a3a6fd3bbe9b665e1ad46c5d35bcfa1 Mon Sep 17 00:00:00 2001 From: mobserveur Date: Mon, 10 Jun 2024 14:57:39 +0200 Subject: lltracker::drawbeacon() rewritted for better performance this is a better implementation of the drawBeacon() function compared to the previous patch --- indra/newview/lltracker.cpp | 65 +++++++++++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 20 deletions(-) diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index d794d7d690..a28bbb3bf1 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -492,18 +492,14 @@ void draw_shockwave(F32 center_z, F32 t, S32 steps, LLColor4 color) void LLTracker::drawBeacon(LLVector3 pos_agent, std::string direction, LLColor4 fogged_color, F32 dist) { -#if LL_DARWIN - const U32 BEACON_VERTS = 16; -#else - const U32 BEACON_VERTS = 256; -#endif + const F32 MAX_HEIGHT = 5020.f; + const U32 BEACON_ROWS = 256; - F32 step; + U32 nRows; + F32 height; + F32 rowHeight; - LLColor4 c_col = LLColor4(1, 1, 1, 1); - LLColor4 col_next = LLColor4(1, 1, 1, 1); - LLColor4 col_edge = LLColor4(1, 1, 1, 0); - LLColor4 col_edge_next = LLColor4(1, 1, 1, 0); + LLColor4 c_col, col_next, col_edge, col_edge_next; gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); @@ -512,14 +508,18 @@ void LLTracker::drawBeacon(LLVector3 pos_agent, std::string direction, LLColor4 { gGL.translatef(pos_agent.mV[0], pos_agent.mV[1], pos_agent.mV[2]); draw_shockwave(1024.f, gRenderStartTime.getElapsedTimeF32(), 32, fogged_color); - step = (5020.0f - pos_agent.mV[2]) / BEACON_VERTS; + height = MAX_HEIGHT - pos_agent.mV[2]; } else { gGL.translatef(pos_agent.mV[0], pos_agent.mV[1], 0); - step = pos_agent.mV[2] / BEACON_VERTS; + height = pos_agent.mV[2]; } + nRows = ceil((BEACON_ROWS * height) / MAX_HEIGHT); + if(nRows<2) nRows=2; + rowHeight = height / nRows; + gGL.color4fv(fogged_color.mV); LLVector3 x_axis = LLViewerCamera::getInstance()->getLeftAxis(); @@ -527,21 +527,20 @@ void LLTracker::drawBeacon(LLVector3 pos_agent, std::string direction, LLColor4 F32 x = x_axis.mV[0]; F32 y = x_axis.mV[1]; - F32 z = 0.0f; + F32 z = 0.f; F32 z_next; F32 a,an; - F32 xa,ya; - F32 xan,yan; + F32 xa,xan; + F32 ya,yan; bool tracking_avatar = getTrackingStatus() == TRACKING_AVATAR; - gGL.begin(LLRender::TRIANGLE_STRIP); + gGL.begin(LLRender::TRIANGLES); - for (U32 i = 0; i < BEACON_VERTS; i++) + for (U32 i = 0; i < nRows; i++) { - z = i * step; - z_next = z + step; + z_next = z + rowHeight; a = pulse_func(t, z, tracking_avatar, direction); an = pulse_func(t, z_next, tracking_avatar, direction); @@ -552,7 +551,7 @@ void LLTracker::drawBeacon(LLVector3 pos_agent, std::string direction, LLColor4 col_edge_next = fogged_color * LLColor4(an, an, an, 0.0f); a = a + a + 1.f; - an = an + an + 1.0f; + an = an + an + 1.f; xa = x*a; ya = y*a; @@ -561,18 +560,44 @@ void LLTracker::drawBeacon(LLVector3 pos_agent, std::string direction, LLColor4 gGL.color4fv(col_edge.mV); gGL.vertex3f(-xa, -ya, z); + + gGL.color4fv(col_next.mV); + gGL.vertex3f(0, 0, z_next); + gGL.color4fv(col_edge_next.mV); gGL.vertex3f(-xan, -yan, z_next); + + gGL.color4fv(col_edge.mV); + gGL.vertex3f(-xa, -ya, z); + gGL.color4fv(c_col.mV); gGL.vertex3f(0, 0, z); + gGL.color4fv(col_next.mV); gGL.vertex3f(0, 0, z_next); + + gGL.color4fv(c_col.mV); + gGL.vertex3f(0, 0, z); + + gGL.color4fv(col_edge_next.mV); + gGL.vertex3f(xan, yan, z_next); + + gGL.color4fv(col_next.mV); + gGL.vertex3f(0, 0, z_next); + + + gGL.color4fv(c_col.mV); + gGL.vertex3f(0, 0, z); + gGL.color4fv(col_edge.mV); gGL.vertex3f(xa, ya, z); + gGL.color4fv(col_edge_next.mV); gGL.vertex3f(xan, yan, z_next); + + z += rowHeight; } gGL.end(); -- cgit v1.2.3 From 8861264d8d3f4c9e8fa5f62ec57f73b0b2fd2ff0 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Wed, 12 Jun 2024 15:33:45 -0700 Subject: secondlife/viewer#1475: Fix Terrain tab controls no longer disabled when insufficient permissions --- indra/llui/llview.cpp | 10 +++++++++- indra/llui/llview.h | 2 +- indra/newview/llfloaterregioninfo.cpp | 8 ++++---- indra/newview/llviewerregion.cpp | 4 ++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 28283964e2..441b7d6a6c 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -591,12 +591,20 @@ void LLView::deleteAllChildren() updateBoundingRect(); } -void LLView::setAllChildrenEnabled(bool b) +void LLView::setAllChildrenEnabled(bool b, bool recursive /*= false*/) { for (LLView* viewp : mChildList) { viewp->setEnabled(b); } + + if (recursive) + { + for (LLView* viewp : mChildList) + { + viewp->setAllChildrenEnabled(b, recursive); + } + } } // virtual diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 3af748dda6..3ce7243370 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -287,7 +287,7 @@ public: // children, etc. virtual void deleteAllChildren(); - void setAllChildrenEnabled(bool b); + void setAllChildrenEnabled(bool b, bool recursive = false); virtual void setVisible(bool visible); void setVisibleDirect(bool visible) { mVisible = visible; } diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 073cef3d73..931b2bd695 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -356,7 +356,7 @@ void LLFloaterRegionInfo::requestRegionInfo() { tab->getChild("General")->setCtrlsEnabled(false); tab->getChild("Debug")->setCtrlsEnabled(false); - tab->getChild("Terrain")->setCtrlsEnabled(false); + tab->getChild("Terrain")->setAllChildrenEnabled(false, true); tab->getChild("Estate")->setCtrlsEnabled(false); tab->getChild("Access")->setCtrlsEnabled(false); } @@ -553,7 +553,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) panel->getChild("terrain_raise_spin")->setValue(region_info.mTerrainRaiseLimit); panel->getChild("terrain_lower_spin")->setValue(region_info.mTerrainLowerLimit); - panel->setCtrlsEnabled(allow_modify); + panel->setAllChildrenEnabled(allow_modify, true); if (floater->getVisible()) { @@ -668,7 +668,7 @@ void LLFloaterRegionInfo::disableTabCtrls() tab->getChild("General")->setCtrlsEnabled(false); tab->getChild("Debug")->setCtrlsEnabled(false); - tab->getChild("Terrain")->setCtrlsEnabled(false); + tab->getChild("Terrain")->setAllChildrenEnabled(false, true); tab->getChild("panel_env_info")->setCtrlsEnabled(false); tab->getChild("Estate")->setCtrlsEnabled(false); tab->getChild("Access")->setCtrlsEnabled(false); @@ -1657,7 +1657,7 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region) || (region && (region->getOwner() == gAgent.getID())); bool owner_or_god_or_manager = owner_or_god || (region && region->isEstateManager()); - setCtrlsEnabled(owner_or_god_or_manager); + setAllChildrenEnabled(owner_or_god_or_manager, true); getChildView("apply_btn")->setEnabled(false); diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index c75d590df8..e8a9f41855 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -2495,11 +2495,11 @@ void LLViewerRegion::setSimulatorFeatures(const LLSD& sim_features) if (features.has("PBRTerrainTransformsEnabled")) { bool enabled = features["PBRTerrainTransformsEnabled"]; - gSavedSettings.setBOOL("RenderTerrainTransformsPBREnabled", enabled); + gSavedSettings.setBOOL("RenderTerrainPBRTransformsEnabled", enabled); } else { - gSavedSettings.setBOOL("RenderTerrainTransformsPBREnabled", false); + gSavedSettings.setBOOL("RenderTerrainPBRTransformsEnabled", false); } }; -- cgit v1.2.3 From fa4e463ba87a483a62528cf67bcb93b14add4911 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Wed, 12 Jun 2024 15:57:20 -0700 Subject: secondlife/viewer#1744: Fix missing LSL constant INVENTORY_SETTING in keywords_lsl_default.xml --- doc/contributions.txt | 1 + indra/newview/app_settings/keywords_lsl_default.xml | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/doc/contributions.txt b/doc/contributions.txt index 024ca90d2f..5a4d276a20 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -606,6 +606,7 @@ Henri Beauchamp SL-19110 SL-19159 [NO JIRA] (fullbright HUD alpha fix) + secondlife/viewer#1744 herina Bode Hikkoshi Sakai VWR-429 diff --git a/indra/newview/app_settings/keywords_lsl_default.xml b/indra/newview/app_settings/keywords_lsl_default.xml index 893b017367..f99b86bd39 100644 --- a/indra/newview/app_settings/keywords_lsl_default.xml +++ b/indra/newview/app_settings/keywords_lsl_default.xml @@ -1945,6 +1945,15 @@ tooltip + INVENTORY_SETTING + + type + integer + value + 56 + tooltip + + INVENTORY_SOUND type -- cgit v1.2.3 From fcf9af42fa51567957a924fbfda8c3be948d3a25 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Wed, 12 Jun 2024 16:21:58 -0700 Subject: secondlife/viewer#907: Review feedback --- indra/llmath/llmath.h | 2 +- .../shaders/class1/deferred/textureUtilV.glsl | 3 +- indra/newview/lldrawpoolterrain.cpp | 2 +- indra/newview/llfloaterregioninfo.cpp | 4 +-- indra/newview/llvlcomposition.cpp | 32 +++++++++++----------- indra/newview/llvlcomposition.h | 10 +++---- 6 files changed, 26 insertions(+), 27 deletions(-) diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index 4e8fc56de0..fa315291a3 100644 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -517,7 +517,7 @@ inline void ll_remove_outliers(std::vector& data, F32 k) i++; } - S32 j = data.size()-1; + size_t j = data.size()-1; while (j > 0 && data[j] > max) { j--; diff --git a/indra/newview/app_settings/shaders/class1/deferred/textureUtilV.glsl b/indra/newview/app_settings/shaders/class1/deferred/textureUtilV.glsl index a70180c1b5..767416d564 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/textureUtilV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/textureUtilV.glsl @@ -135,8 +135,7 @@ vec3 tangent_space_transform(vec4 vertex_tangent, vec3 vertex_normal, vec4[2] kh return (weights.x * vertex_binormal.xyz) + (weights.y * vertex_tangent.xyz); } -// Similar to tangent_space_transform but no offset during coordinate system -// conversion, and no texture animation support. +// Similar to tangent_space_transform but no texture animation support. vec3 terrain_tangent_space_transform(vec4 vertex_tangent, vec3 vertex_normal, vec4[2] khr_gltf_transform) { // Immediately convert to left-handed coordinate system ((0,1) -> (0, -1)) diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index 2897f3d749..afc5cc9d4e 100644 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -202,7 +202,7 @@ void LLDrawPoolTerrain::drawLoop() void LLDrawPoolTerrain::renderFullShader() { - const bool use_local_materials = gLocalTerrainMaterials.materialsReady(true, false); + const bool use_local_materials = gLocalTerrainMaterials.makeMaterialsReady(true, false); // Hack! Get the region that this draw pool is rendering from! LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion(); LLVLComposition *compp = regionp->getComposition(); diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 931b2bd695..c019bd047d 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -1669,8 +1669,8 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region) static LLCachedControl feature_pbr_terrain_enabled(gSavedSettings, "RenderTerrainPBREnabled", false); - const bool textures_ready = compp->texturesReady(false, false); - const bool materials_ready = feature_pbr_terrain_enabled && compp->materialsReady(false, false); + const bool textures_ready = compp->makeTexturesReady(false, false); + const bool materials_ready = feature_pbr_terrain_enabled && compp->makeMaterialsReady(false, false); bool set_texture_swatches; bool set_material_swatches; diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp index 703f33771c..ba255f2b24 100644 --- a/indra/newview/llvlcomposition.cpp +++ b/indra/newview/llvlcomposition.cpp @@ -127,12 +127,12 @@ void LLTerrainMaterials::apply(const LLModifyRegion& other) bool LLTerrainMaterials::generateMaterials() { - if (texturesReady(true, true)) + if (makeTexturesReady(true, true)) { return true; } - if (materialsReady(true, true)) + if (makeMaterialsReady(true, true)) { return true; } @@ -220,17 +220,17 @@ LLTerrainMaterials::Type LLTerrainMaterials::getMaterialType() { LL_PROFILE_ZONE_SCOPED; - const bool use_textures = texturesReady(false, false) || !materialsReady(false, false); + const bool use_textures = makeTexturesReady(false, false) || !makeMaterialsReady(false, false); return use_textures ? Type::TEXTURE : Type::PBR; } -bool LLTerrainMaterials::texturesReady(bool boost, bool strict) +bool LLTerrainMaterials::makeTexturesReady(bool boost, bool strict) { bool ready[ASSET_COUNT]; - // *NOTE: Calls to textureReady may boost textures. Do not early-return. + // *NOTE: Calls to makeTextureReady may boost textures. Do not early-return. for (S32 i = 0; i < ASSET_COUNT; i++) { - ready[i] = mDetailTextures[i].notNull() && textureReady(mDetailTextures[i], boost); + ready[i] = mDetailTextures[i].notNull() && makeTextureReady(mDetailTextures[i], boost); } bool one_ready = false; @@ -251,7 +251,7 @@ namespace bool material_asset_ready(LLFetchedGLTFMaterial* mat) { return mat && mat->isLoaded(); } }; -bool LLTerrainMaterials::materialsReady(bool boost, bool strict) +bool LLTerrainMaterials::makeMaterialsReady(bool boost, bool strict) { bool ready[ASSET_COUNT]; // *NOTE: This section may boost materials/textures. Do not early-return if ready[i] is false. @@ -315,7 +315,7 @@ bool LLTerrainMaterials::materialsReady(bool boost, bool strict) // Boost the texture loading priority // Return true when ready to use (i.e. texture is sufficiently loaded) // static -bool LLTerrainMaterials::textureReady(LLPointer& tex, bool boost) +bool LLTerrainMaterials::makeTextureReady(LLPointer& tex, bool boost) { llassert(tex); if (!tex) { return false; } @@ -377,17 +377,17 @@ bool LLTerrainMaterials::materialTexturesReady(LLPointer& mat->mEmissiveTexture = fetch_terrain_texture(mat->mTextureId[LLGLTFMaterial::GLTF_TEXTURE_INFO_EMISSIVE]); } - // *NOTE: Calls to textureReady may boost textures. Do not early-return. + // *NOTE: Calls to makeTextureReady may boost textures. Do not early-return. bool ready[LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT]; ready[LLGLTFMaterial::GLTF_TEXTURE_INFO_BASE_COLOR] = - mat->mTextureId[LLGLTFMaterial::GLTF_TEXTURE_INFO_BASE_COLOR].isNull() || textureReady(mat->mBaseColorTexture, boost); + mat->mTextureId[LLGLTFMaterial::GLTF_TEXTURE_INFO_BASE_COLOR].isNull() || makeTextureReady(mat->mBaseColorTexture, boost); ready[LLGLTFMaterial::GLTF_TEXTURE_INFO_NORMAL] = - mat->mTextureId[LLGLTFMaterial::GLTF_TEXTURE_INFO_NORMAL].isNull() || textureReady(mat->mNormalTexture, boost); + mat->mTextureId[LLGLTFMaterial::GLTF_TEXTURE_INFO_NORMAL].isNull() || makeTextureReady(mat->mNormalTexture, boost); ready[LLGLTFMaterial::GLTF_TEXTURE_INFO_METALLIC_ROUGHNESS] = mat->mTextureId[LLGLTFMaterial::GLTF_TEXTURE_INFO_METALLIC_ROUGHNESS].isNull() || - textureReady(mat->mMetallicRoughnessTexture, boost); + makeTextureReady(mat->mMetallicRoughnessTexture, boost); ready[LLGLTFMaterial::GLTF_TEXTURE_INFO_EMISSIVE] = - mat->mTextureId[LLGLTFMaterial::GLTF_TEXTURE_INFO_EMISSIVE].isNull() || textureReady(mat->mEmissiveTexture, boost); + mat->mTextureId[LLGLTFMaterial::GLTF_TEXTURE_INFO_EMISSIVE].isNull() || makeTextureReady(mat->mEmissiveTexture, boost); if (strict) { @@ -406,7 +406,7 @@ bool LLTerrainMaterials::materialTexturesReady(LLPointer& // Boost the loading priority of every known texture in the material // Return true when ready to use // static -bool LLTerrainMaterials::materialReady(LLPointer &mat, bool &textures_set, bool boost, bool strict) +bool LLTerrainMaterials::makeMaterialReady(LLPointer &mat, bool &textures_set, bool boost, bool strict) { if (!material_asset_ready(mat)) { return false; } @@ -694,11 +694,11 @@ bool LLVLComposition::generateMinimapTileLand(const F32 x, const F32 y, const bool use_textures = getMaterialType() != LLTerrainMaterials::Type::PBR; if (use_textures) { - if (!texturesReady(true, true)) { return false; } + if (!makeTexturesReady(true, true)) { return false; } } else { - if (!materialsReady(true, true)) { return false; } + if (!makeMaterialsReady(true, true)) { return false; } } for (S32 i = 0; i < ASSET_COUNT; i++) diff --git a/indra/newview/llvlcomposition.h b/indra/newview/llvlcomposition.h index 763ff69442..61c35ade28 100644 --- a/indra/newview/llvlcomposition.h +++ b/indra/newview/llvlcomposition.h @@ -74,18 +74,18 @@ public: const LLGLTFMaterial* getMaterialOverride(S32 asset) const override; virtual void setMaterialOverride(S32 asset, LLGLTFMaterial* mat_override); Type getMaterialType(); - bool texturesReady(bool boost, bool strict); + bool makeTexturesReady(bool boost, bool strict); // strict = true -> all materials must be sufficiently loaded // strict = false -> at least one material must be loaded - bool materialsReady(bool boost, bool strict); + bool makeMaterialsReady(bool boost, bool strict); protected: void unboost(); - static bool textureReady(LLPointer& tex, bool boost); + static bool makeTextureReady(LLPointer& tex, bool boost); // strict = true -> all materials must be sufficiently loaded // strict = false -> at least one material must be loaded - static bool materialReady(LLPointer& mat, bool& textures_set, bool boost, bool strict); - // *NOTE: Prefer calling materialReady if mat is known to be LLFetchedGLTFMaterial + static bool makeMaterialReady(LLPointer& mat, bool& textures_set, bool boost, bool strict); + // *NOTE: Prefer calling makeMaterialReady if mat is known to be LLFetchedGLTFMaterial static bool materialTexturesReady(LLPointer& mat, bool& textures_set, bool boost, bool strict); LLPointer mDetailTextures[ASSET_COUNT]; -- cgit v1.2.3 From 74765c15731e6b6859b627b898472299ed351e0d Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Wed, 12 Jun 2024 16:28:12 -0700 Subject: secondlife/viewer#907: Remove unused setting --- indra/newview/app_settings/settings.xml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index ecfef112a4..5f44d24a63 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9253,17 +9253,6 @@ Value 0 - RenderTerrainPBRForce - - Comment - Force-load PBR terrain if enabled - Persist - 0 - Type - Boolean - Value - 0 - RenderTerrainPBRDetail Comment -- cgit v1.2.3 From f4eae44067cfe63fbe5ddd219b1b2463e9de89ef Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 14 Jun 2024 13:47:19 -0500 Subject: Fix for warnings/errors after Visual Studio update (#1775) --- indra/cmake/00-Common.cmake | 3 +++ indra/llcommon/llmemory.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 4471380c6b..dbbf12bd3d 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -108,6 +108,9 @@ if (WINDOWS) # https://github.com/actions/runner-images/issues/10004#issuecomment-2153445161 # can be removed after the above issue is resolved and deployed across GHA add_compile_definitions(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR) + + # Allow use of sprintf etc + add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif (WINDOWS) diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index 2c3f66fab8..80cfe554c4 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -134,7 +134,7 @@ public: \ void ll_aligned_free_fallback( void* ptr ); //------------------------------------------------------------------------------------------------ #else - inline void* ll_aligned_malloc_fallback( size_t size, int align ) + inline void* ll_aligned_malloc_fallback( size_t size, size_t align ) { LL_PROFILE_ZONE_SCOPED_CATEGORY_MEMORY; #if defined(LL_WINDOWS) -- cgit v1.2.3 From 375555012f92c1b836f2d122754f9facd050be62 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 14 Jun 2024 17:06:07 -0500 Subject: 1736 audit texture image unit usage on os x (#1739) * #1736 Remove some unused samplers from glsl files and refactor shader manager to assume 16 texture image units and 4 indexed texture units all the time. --- indra/llrender/llglslshader.cpp | 47 ++++++++++++++++------ indra/llrender/llglslshader.h | 1 - indra/llrender/llshadermgr.cpp | 2 +- indra/newview/app_settings/logcontrol.xml | 2 +- .../shaders/class1/deferred/aoUtil.glsl | 3 +- .../shaders/class1/deferred/avatarShadowF.glsl | 2 - .../shaders/class1/deferred/blurLightF.glsl | 1 - .../shaders/class1/deferred/deferredUtil.glsl | 1 - .../shaders/class1/deferred/shadowAlphaMaskF.glsl | 2 - .../shaders/class1/deferred/shadowUtil.glsl | 1 - .../shaders/class1/interface/copyF.glsl | 3 ++ .../shaders/class3/deferred/hazeF.glsl | 2 - .../shaders/class3/deferred/multiPointLightF.glsl | 1 - .../shaders/class3/deferred/pointLightF.glsl | 2 - .../shaders/class3/deferred/softenLightF.glsl | 2 - .../shaders/class3/deferred/spotLightF.glsl | 3 -- .../shaders/class3/deferred/waterHazeF.glsl | 2 - .../shaders/class3/environment/underWaterF.glsl | 1 - indra/newview/llviewershadermgr.cpp | 18 +-------- 19 files changed, 43 insertions(+), 53 deletions(-) diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 45abb695cb..79979657f1 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -476,6 +476,7 @@ bool LLGLSLShader::createShader() } else if (mFeatures.mIndexedTextureChannels > 0) { //override texture channels for indexed texture rendering + llassert(mFeatures.mIndexedTextureChannels == LLGLSLShader::sIndexedTextureChannels); // these numbers must always match bind(); S32 channel_count = mFeatures.mIndexedTextureChannels; @@ -485,19 +486,41 @@ bool LLGLSLShader::createShader() uniform1i(uniName, i); } - S32 cur_tex = channel_count; //adjust any texture channels that might have been overwritten + //adjust any texture channels that might have been overwritten for (U32 i = 0; i < mTexture.size(); i++) { - if (mTexture[i] > -1 && mTexture[i] < channel_count) + if (mTexture[i] > -1) { - llassert(cur_tex < gGLManager.mNumTextureImageUnits); - uniform1i(i, cur_tex); - mTexture[i] = cur_tex++; + S32 new_tex = mTexture[i] + channel_count; + uniform1i(i, new_tex); + mTexture[i] = new_tex; } } + + // get the true number of active texture channels + mActiveTextureChannels = channel_count; + for (auto& tex : mTexture) + { + mActiveTextureChannels = llmax(mActiveTextureChannels, tex + 1); + } + + // when indexed texture channels are used, enforce an upper limit of 16 + // this should act as a canary in the coal mine for adding textures + // and breaking machines that are limited to 16 texture channels + llassert(mActiveTextureChannels <= 16); unbind(); } + LL_DEBUGS("GLSLTextureChannels") << mName << " has " << mActiveTextureChannels << " active texture channels" << LL_ENDL; + + for (U32 i = 0; i < mTexture.size(); i++) + { + if (mTexture[i] > -1) + { + LL_DEBUGS("GLSLTextureChannels") << "Texture " << LLShaderMgr::instance()->mReservedUniforms[i] << " assigned to channel " << mTexture[i] << LL_ENDL; + } + } + #ifdef LL_PROFILER_ENABLE_RENDER_DOC setLabel(mName.c_str()); #endif @@ -736,6 +759,10 @@ void LLGLSLShader::mapUniform(GLint index) //found it mUniform[i] = location; mTexture[i] = mapUniformTextureChannel(location, type, size); + if (mTexture[i] != -1) + { + LL_DEBUGS("GLSLTextureChannels") << name << " assigned to texture channel " << mTexture[i] << LL_ENDL; + } return; } } @@ -774,25 +801,21 @@ GLint LLGLSLShader::mapUniformTextureChannel(GLint location, GLenum type, GLint if (size == 1) { glUniform1i(location, mActiveTextureChannels); - LL_DEBUGS("ShaderUniform") << "Assigned to texture channel " << mActiveTextureChannels << LL_ENDL; mActiveTextureChannels++; } else { //is array of textures, make sequential after this texture - GLint channel[32]; // <=== only support up to 32 texture channels - llassert(size <= 32); - size = llmin(size, 32); + GLint channel[16]; // <=== only support up to 16 texture channels + llassert(size <= 16); + size = llmin(size, 16); for (int i = 0; i < size; ++i) { channel[i] = mActiveTextureChannels++; } glUniform1iv(location, size, channel); - LL_DEBUGS("ShaderUniform") << "Assigned to texture channel " << - (mActiveTextureChannels - size) << " through " << (mActiveTextureChannels - 1) << LL_ENDL; } - llassert(mActiveTextureChannels <= 32); // too many textures (probably) return ret; } return -1; diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index 9339e7998d..cc2ba0fcff 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -52,7 +52,6 @@ public: bool hasSrgb = false; bool isDeferred = false; bool hasScreenSpaceReflections = false; - bool disableTextureIndex = false; bool hasAlphaMask = false; bool hasReflectionProbes = false; bool attachNothing = false; diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 634be615e6..574cf55a0e 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -295,7 +295,7 @@ bool LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) if (features->hasLighting) { - if (features->disableTextureIndex) + if (features->mIndexedTextureChannels <= 1) { if (features->hasAlphaMask) { diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index 482012cdd6..51b5c66384 100644 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -71,7 +71,7 @@ Inventory SceneLoadTiming Avatar - Voice + Voice --> diff --git a/indra/newview/app_settings/shaders/class1/deferred/aoUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/aoUtil.glsl index 49470f0e39..ce018623a8 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/aoUtil.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/aoUtil.glsl @@ -23,8 +23,7 @@ * $/LicenseInfo$ */ -uniform sampler2D noiseMap; -uniform sampler2D normalMap; +uniform sampler2D noiseMap; uniform sampler2D depthMap; uniform float ssao_radius; diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl index 438e1d1b33..37dcbbd328 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl @@ -27,8 +27,6 @@ out vec4 frag_color; -uniform sampler2D diffuseMap; - void main() { frag_color = vec4(1,1,1,1); diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl index d7d98477c0..23a3ca4911 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl @@ -27,7 +27,6 @@ out vec4 frag_color; -uniform sampler2D normalMap; uniform sampler2D lightMap; uniform float dist_factor; diff --git a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl index 3ea2248bec..ab0e4fd4d8 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl @@ -50,7 +50,6 @@ SOFTWARE. uniform sampler2D normalMap; uniform sampler2D depthMap; -uniform sampler2D emissiveRect; uniform sampler2D projectionMap; // rgba uniform sampler2D brdfLut; diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl index 9db8f461dd..f208ac746b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl @@ -27,8 +27,6 @@ out vec4 frag_color; -uniform sampler2D diffuseMap; - in vec4 post_pos; in float target_pos_x; in vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl index 16cc7cfbbc..6f7bd2bf3c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowUtil.glsl @@ -24,7 +24,6 @@ */ uniform sampler2D normalMap; -uniform sampler2D depthMap; #if defined(SUN_SHADOW) uniform sampler2DShadow shadowMap0; diff --git a/indra/newview/app_settings/shaders/class1/interface/copyF.glsl b/indra/newview/app_settings/shaders/class1/interface/copyF.glsl index edaa2488f0..094d147e86 100644 --- a/indra/newview/app_settings/shaders/class1/interface/copyF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/copyF.glsl @@ -25,7 +25,10 @@ in vec2 tc; +#if defined(COPY_DEPTH) uniform sampler2D depthMap; +#endif + uniform sampler2D diffuseMap; out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class3/deferred/hazeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/hazeF.glsl index 87977eb28c..7b82aa1a0d 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/hazeF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/hazeF.glsl @@ -25,8 +25,6 @@ out vec4 frag_color; -uniform sampler2D normalMap; - // Inputs uniform vec3 sun_dir; uniform vec3 moon_dir; diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl index ac3fec23f6..4ed778371f 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl @@ -27,7 +27,6 @@ out vec4 frag_color; -uniform sampler2D depthMap; uniform sampler2D diffuseRect; uniform sampler2D specularRect; uniform sampler2D emissiveRect; // PBR linear packed Occlusion, Roughness, Metal. See: pbropaqueF.glsl diff --git a/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl index e419525bd5..6c13757149 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl @@ -29,10 +29,8 @@ out vec4 frag_color; uniform sampler2D diffuseRect; uniform sampler2D specularRect; -uniform sampler2D normalMap; uniform sampler2D emissiveRect; // PBR linear packed Occlusion, Roughness, Metal. See: pbropaqueF.glsl uniform sampler2D lightFunc; -uniform sampler2D depthMap; uniform vec3 env_mat[3]; uniform float sun_wash; diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 529d1cba6b..ca88fe7482 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -29,7 +29,6 @@ out vec4 frag_color; uniform sampler2D diffuseRect; uniform sampler2D specularRect; -uniform sampler2D normalMap; uniform sampler2D emissiveRect; // PBR linear packed Occlusion, Roughness, Metal. See: pbropaqueF.glsl const float M_PI = 3.14159265; @@ -38,7 +37,6 @@ const float M_PI = 3.14159265; uniform sampler2D lightMap; #endif -uniform sampler2D depthMap; uniform sampler2D lightFunc; uniform float blur_size; diff --git a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl index 092b0c3c08..bc4d36d10d 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl @@ -29,12 +29,9 @@ out vec4 frag_color; uniform sampler2D diffuseRect; uniform sampler2D specularRect; -uniform sampler2D depthMap; -uniform sampler2D normalMap; uniform sampler2D emissiveRect; // PBR linear packed Occlusion, Roughness, Metal. See: pbropaqueF.glsl uniform samplerCube environmentMap; uniform sampler2D lightMap; -uniform sampler2D projectionMap; // rgba uniform sampler2D lightFunc; uniform mat4 proj_mat; //screen space to light space diff --git a/indra/newview/app_settings/shaders/class3/deferred/waterHazeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/waterHazeF.glsl index a5a37d80dd..2bf785e773 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/waterHazeF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/waterHazeF.glsl @@ -28,8 +28,6 @@ out vec4 frag_color; // Inputs in vec4 vary_fragcoord; -uniform sampler2D normalMap; - vec4 getPositionWithDepth(vec2 pos_screen, float depth); float getDepth(vec2 pos_screen); diff --git a/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl index 728d70ebb2..1c02dc764d 100644 --- a/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl @@ -25,7 +25,6 @@ out vec4 frag_color; -uniform sampler2D diffuseMap; uniform sampler2D bumpMap; #ifdef TRANSPARENT_WATER diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 5913e7ba6f..37fbfccbbb 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -515,8 +515,8 @@ void LLViewerShaderMgr::setShaders() // when using indexed texture rendering, leave some texture units available for shadow and reflection maps static LLCachedControl reserved_texture_units(gSavedSettings, "RenderReservedTextureIndices", 14); - LLGLSLShader::sIndexedTextureChannels = - llclamp(max_texture_index, 1, gGLManager.mNumTextureImageUnits-reserved_texture_units); + LLGLSLShader::sIndexedTextureChannels = 4; + //llclamp(max_texture_index, 1, gGLManager.mNumTextureImageUnits-reserved_texture_units); reentrance = true; @@ -1432,7 +1432,6 @@ bool LLViewerShaderMgr::loadShadersDeferred() (mapping == 1 ? "flat" : "triplanar")); gDeferredPBRTerrainProgram.mFeatures.hasSrgb = true; gDeferredPBRTerrainProgram.mFeatures.isAlphaLighting = true; - gDeferredPBRTerrainProgram.mFeatures.disableTextureIndex = true; //hack to disable auto-setup of texture channels gDeferredPBRTerrainProgram.mFeatures.calculatesAtmospherics = true; gDeferredPBRTerrainProgram.mFeatures.hasAtmospherics = true; gDeferredPBRTerrainProgram.mFeatures.hasGamma = true; @@ -1646,7 +1645,6 @@ bool LLViewerShaderMgr::loadShadersDeferred() shader->mFeatures.calculatesLighting = false; shader->mFeatures.hasLighting = false; shader->mFeatures.isAlphaLighting = true; - shader->mFeatures.disableTextureIndex = true; //hack to disable auto-setup of texture channels shader->mFeatures.hasSrgb = true; shader->mFeatures.calculatesAtmospherics = true; shader->mFeatures.hasAtmospherics = true; @@ -1754,7 +1752,6 @@ bool LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarEyesProgram.mFeatures.calculatesAtmospherics = true; gDeferredAvatarEyesProgram.mFeatures.hasGamma = true; gDeferredAvatarEyesProgram.mFeatures.hasAtmospherics = true; - gDeferredAvatarEyesProgram.mFeatures.disableTextureIndex = true; gDeferredAvatarEyesProgram.mFeatures.hasSrgb = true; gDeferredAvatarEyesProgram.mFeatures.hasShadows = true; @@ -2155,7 +2152,6 @@ bool LLViewerShaderMgr::loadShadersDeferred() gDeferredTerrainProgram.mName = "Deferred Terrain Shader"; gDeferredTerrainProgram.mFeatures.hasSrgb = true; gDeferredTerrainProgram.mFeatures.isAlphaLighting = true; - gDeferredTerrainProgram.mFeatures.disableTextureIndex = true; //hack to disable auto-setup of texture channels gDeferredTerrainProgram.mFeatures.calculatesAtmospherics = true; gDeferredTerrainProgram.mFeatures.hasAtmospherics = true; gDeferredTerrainProgram.mFeatures.hasGamma = true; @@ -2187,7 +2183,6 @@ bool LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarAlphaProgram.mFeatures.calculatesLighting = false; gDeferredAvatarAlphaProgram.mFeatures.hasLighting = false; gDeferredAvatarAlphaProgram.mFeatures.isAlphaLighting = true; - gDeferredAvatarAlphaProgram.mFeatures.disableTextureIndex = true; gDeferredAvatarAlphaProgram.mFeatures.hasSrgb = true; gDeferredAvatarAlphaProgram.mFeatures.calculatesAtmospherics = true; gDeferredAvatarAlphaProgram.mFeatures.hasAtmospherics = true; @@ -2426,7 +2421,6 @@ bool LLViewerShaderMgr::loadShadersDeferred() gDeferredWLSunProgram.mFeatures.hasAtmospherics = true; gDeferredWLSunProgram.mFeatures.hasGamma = true; gDeferredWLSunProgram.mFeatures.hasAtmospherics = true; - gDeferredWLSunProgram.mFeatures.disableTextureIndex = true; gDeferredWLSunProgram.mFeatures.hasSrgb = true; gDeferredWLSunProgram.mShaderFiles.clear(); gDeferredWLSunProgram.mShaderFiles.push_back(make_pair("deferred/sunDiscV.glsl", GL_VERTEX_SHADER)); @@ -2445,7 +2439,6 @@ bool LLViewerShaderMgr::loadShadersDeferred() gDeferredWLMoonProgram.mFeatures.hasGamma = true; gDeferredWLMoonProgram.mFeatures.hasAtmospherics = true; gDeferredWLMoonProgram.mFeatures.hasSrgb = true; - gDeferredWLMoonProgram.mFeatures.disableTextureIndex = true; gDeferredWLMoonProgram.mShaderFiles.clear(); gDeferredWLMoonProgram.mShaderFiles.push_back(make_pair("deferred/moonV.glsl", GL_VERTEX_SHADER)); @@ -2549,7 +2542,6 @@ bool LLViewerShaderMgr::loadShadersObject() gObjectAlphaMaskNoColorProgram.mFeatures.hasGamma = true; gObjectAlphaMaskNoColorProgram.mFeatures.hasAtmospherics = true; gObjectAlphaMaskNoColorProgram.mFeatures.hasLighting = true; - gObjectAlphaMaskNoColorProgram.mFeatures.disableTextureIndex = true; gObjectAlphaMaskNoColorProgram.mFeatures.hasAlphaMask = true; gObjectAlphaMaskNoColorProgram.mShaderFiles.clear(); gObjectAlphaMaskNoColorProgram.mShaderFiles.push_back(make_pair("objects/simpleNoColorV.glsl", GL_VERTEX_SHADER)); @@ -2561,7 +2553,6 @@ bool LLViewerShaderMgr::loadShadersObject() if (success) { gImpostorProgram.mName = "Impostor Shader"; - gImpostorProgram.mFeatures.disableTextureIndex = true; gImpostorProgram.mFeatures.hasSrgb = true; gImpostorProgram.mShaderFiles.clear(); gImpostorProgram.mShaderFiles.push_back(make_pair("objects/impostorV.glsl", GL_VERTEX_SHADER)); @@ -2573,7 +2564,6 @@ bool LLViewerShaderMgr::loadShadersObject() if (success) { gObjectPreviewProgram.mName = "Object Preview Shader"; - gObjectPreviewProgram.mFeatures.disableTextureIndex = true; gObjectPreviewProgram.mShaderFiles.clear(); gObjectPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewV.glsl", GL_VERTEX_SHADER)); gObjectPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewF.glsl", GL_FRAGMENT_SHADER)); @@ -2592,8 +2582,6 @@ bool LLViewerShaderMgr::loadShadersObject() gPhysicsPreviewProgram.mFeatures.hasGamma = false; gPhysicsPreviewProgram.mFeatures.hasAtmospherics = false; gPhysicsPreviewProgram.mFeatures.hasLighting = false; - gPhysicsPreviewProgram.mFeatures.mIndexedTextureChannels = 0; - gPhysicsPreviewProgram.mFeatures.disableTextureIndex = true; gPhysicsPreviewProgram.mShaderFiles.clear(); gPhysicsPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewPhysicsV.glsl", GL_VERTEX_SHADER)); gPhysicsPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewPhysicsF.glsl", GL_FRAGMENT_SHADER)); @@ -2634,7 +2622,6 @@ bool LLViewerShaderMgr::loadShadersAvatar() gAvatarProgram.mFeatures.hasAtmospherics = true; gAvatarProgram.mFeatures.hasLighting = true; gAvatarProgram.mFeatures.hasAlphaMask = true; - gAvatarProgram.mFeatures.disableTextureIndex = true; gAvatarProgram.mShaderFiles.clear(); gAvatarProgram.mShaderFiles.push_back(make_pair("avatar/avatarV.glsl", GL_VERTEX_SHADER)); gAvatarProgram.mShaderFiles.push_back(make_pair("avatar/avatarF.glsl", GL_FRAGMENT_SHADER)); @@ -2658,7 +2645,6 @@ bool LLViewerShaderMgr::loadShadersAvatar() gAvatarEyeballProgram.mFeatures.hasAtmospherics = true; gAvatarEyeballProgram.mFeatures.hasLighting = true; gAvatarEyeballProgram.mFeatures.hasAlphaMask = true; - gAvatarEyeballProgram.mFeatures.disableTextureIndex = true; gAvatarEyeballProgram.mShaderFiles.clear(); gAvatarEyeballProgram.mShaderFiles.push_back(make_pair("avatar/eyeballV.glsl", GL_VERTEX_SHADER)); gAvatarEyeballProgram.mShaderFiles.push_back(make_pair("avatar/eyeballF.glsl", GL_FRAGMENT_SHADER)); -- cgit v1.2.3