From 8ff215590fb1345a68205d27f55c51d69216b06e Mon Sep 17 00:00:00 2001 From: LanceCorrimal Date: Thu, 12 Jan 2012 09:20:43 +0100 Subject: VWR-28087: image preview floter 20 pixels too short --- indra/newview/skins/default/xui/en/floater_image_preview.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_image_preview.xml b/indra/newview/skins/default/xui/en/floater_image_preview.xml index 86232de1a4..44d2c14cc8 100644 --- a/indra/newview/skins/default/xui/en/floater_image_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_image_preview.xml @@ -2,7 +2,7 @@ + -- cgit v1.2.3 From d10bcca167e2d4332dced910660aa1a6a85bc175 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 8 Feb 2012 15:14:03 -0600 Subject: SH-2592 Fix for some shader uniforms using the wrong vector size. --- indra/newview/app_settings/shaders/class1/deferred/skyV.glsl | 2 -- indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl | 4 ++-- indra/newview/app_settings/shaders/class2/windlight/skyV.glsl | 2 -- indra/newview/llwaterparammanager.cpp | 2 +- indra/newview/llwlparamset.cpp | 4 ++-- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl index 2c8808bdce..cb7603f4fd 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl @@ -55,8 +55,6 @@ uniform vec4 glow; uniform vec4 cloud_color; -uniform vec4 cloud_scale; - void main() { diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl index 2406359721..c1dd45cd67 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl @@ -60,7 +60,7 @@ uniform vec4 glow; uniform vec4 cloud_color; -uniform vec4 cloud_scale; +uniform float cloud_scale; void main() { @@ -169,7 +169,7 @@ void main() // Texture coords vary_texcoord0 = texcoord0; vary_texcoord0.xy -= 0.5; - vary_texcoord0.xy /= cloud_scale.x; + vary_texcoord0.xy /= cloud_scale; vary_texcoord0.xy += 0.5; vary_texcoord1 = vary_texcoord0; diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl index 6a87caa8cf..3788ddaf2d 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl @@ -53,8 +53,6 @@ uniform vec4 glow; uniform vec4 cloud_color; -uniform vec4 cloud_scale; - void main() { diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp index 20b34637b8..e386112334 100644 --- a/indra/newview/llwaterparammanager.cpp +++ b/indra/newview/llwaterparammanager.cpp @@ -194,7 +194,7 @@ void LLWaterParamManager::updateShaderUniforms(LLGLSLShader * shader) shader->uniform4fv("waterPlane", 1, mWaterPlane.mV); shader->uniform1f("waterFogDensity", getFogDensity()); shader->uniform1f("waterFogKS", mWaterFogKS); - shader->uniform4f("distance_multiplier", 0, 0, 0, 0); + shader->uniform1f("distance_multiplier", 0); } } diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp index 1e95b3ea4a..b04d30db55 100644 --- a/indra/newview/llwlparamset.cpp +++ b/indra/newview/llwlparamset.cpp @@ -75,9 +75,9 @@ void LLWLParamSet::update(LLGLSLShader * shader) const stop_glerror(); } else if (param == "cloud_scale" || param == "cloud_shadow" || - param == "density_multiplier" || + param == "density_multiplier" || param == "distance_multiplier" || param == "haze_density" || param == "haze_horizon" || - param == "max_y") + param == "max_y" ) { F32 val = (F32) i->second[0].asReal(); -- cgit v1.2.3 From bb1a1f9d01fdbc377ca61f52041f66a86b974086 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 10 Feb 2012 14:28:16 -0600 Subject: SH-2963 Fix for highlight transparent not highlighting 100% transparent objects. --- indra/newview/lldrawpool.h | 1 + indra/newview/lldrawpoolalpha.cpp | 1 + indra/newview/llvovolume.cpp | 10 +++++++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h index 5a2981e749..64774d06df 100644 --- a/indra/newview/lldrawpool.h +++ b/indra/newview/lldrawpool.h @@ -133,6 +133,7 @@ public: PASS_ALPHA, PASS_ALPHA_MASK, PASS_FULLBRIGHT_ALPHA_MASK, + PASS_ALPHA_INVISIBLE, NUM_RENDER_TYPES, }; diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index ddb7d3ceeb..5b62dbc560 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -337,6 +337,7 @@ void LLDrawPoolAlpha::render(S32 pass) pushBatches(LLRenderPass::PASS_ALPHA_MASK, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE); pushBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE); + pushBatches(LLRenderPass::PASS_ALPHA_INVISIBLE, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE); if(shaders) { diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 6354230796..438d578ac5 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4433,10 +4433,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) else { if (te->getColor().mV[3] > 0.f) - { + { //only treat as alpha in the pipeline if < 100% transparent drawablep->setState(LLDrawable::HAS_ALPHA); - alpha_faces.push_back(facep); } + alpha_faces.push_back(facep); } } else @@ -4952,7 +4952,11 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: if (is_alpha) { // can we safely treat this as an alpha mask? - if (facep->canRenderAsMask()) + if (facep->getFaceColor().mV[3] <= 0.f) + { //100% transparent, don't render unless we're highlighting transparent + registerFace(group, facep, LLRenderPass::PASS_ALPHA_INVISIBLE); + } + else if (facep->canRenderAsMask()) { if (te->getFullbright() || LLPipeline::sNoAlpha) { -- cgit v1.2.3 From c6acd4723526ed82e79dccef18aaf4821e53dfeb Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 8 Feb 2012 15:14:03 -0600 Subject: SH-2592 Fix for some shader uniforms using the wrong vector size. --- indra/newview/app_settings/shaders/class1/deferred/skyV.glsl | 2 -- indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl | 4 ++-- indra/newview/app_settings/shaders/class2/windlight/skyV.glsl | 2 -- indra/newview/llwaterparammanager.cpp | 2 +- indra/newview/llwlparamset.cpp | 4 ++-- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl index 2c8808bdce..cb7603f4fd 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl @@ -55,8 +55,6 @@ uniform vec4 glow; uniform vec4 cloud_color; -uniform vec4 cloud_scale; - void main() { diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl index 2406359721..c1dd45cd67 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl @@ -60,7 +60,7 @@ uniform vec4 glow; uniform vec4 cloud_color; -uniform vec4 cloud_scale; +uniform float cloud_scale; void main() { @@ -169,7 +169,7 @@ void main() // Texture coords vary_texcoord0 = texcoord0; vary_texcoord0.xy -= 0.5; - vary_texcoord0.xy /= cloud_scale.x; + vary_texcoord0.xy /= cloud_scale; vary_texcoord0.xy += 0.5; vary_texcoord1 = vary_texcoord0; diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl index 6a87caa8cf..3788ddaf2d 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl @@ -53,8 +53,6 @@ uniform vec4 glow; uniform vec4 cloud_color; -uniform vec4 cloud_scale; - void main() { diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp index 20b34637b8..e386112334 100644 --- a/indra/newview/llwaterparammanager.cpp +++ b/indra/newview/llwaterparammanager.cpp @@ -194,7 +194,7 @@ void LLWaterParamManager::updateShaderUniforms(LLGLSLShader * shader) shader->uniform4fv("waterPlane", 1, mWaterPlane.mV); shader->uniform1f("waterFogDensity", getFogDensity()); shader->uniform1f("waterFogKS", mWaterFogKS); - shader->uniform4f("distance_multiplier", 0, 0, 0, 0); + shader->uniform1f("distance_multiplier", 0); } } diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp index 1e95b3ea4a..b04d30db55 100644 --- a/indra/newview/llwlparamset.cpp +++ b/indra/newview/llwlparamset.cpp @@ -75,9 +75,9 @@ void LLWLParamSet::update(LLGLSLShader * shader) const stop_glerror(); } else if (param == "cloud_scale" || param == "cloud_shadow" || - param == "density_multiplier" || + param == "density_multiplier" || param == "distance_multiplier" || param == "haze_density" || param == "haze_horizon" || - param == "max_y") + param == "max_y" ) { F32 val = (F32) i->second[0].asReal(); -- cgit v1.2.3 From 1f5c2c056ff2b660b053cf3a7344fdf1c5c15b0e Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 8 Feb 2012 18:25:35 -0500 Subject: STORM-1808 Indicate ability to build --- doc/contributions.txt | 1 + indra/newview/app_settings/commands.xml | 2 ++ indra/newview/llagent.cpp | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index c5db396c97..bbaee68d02 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -610,6 +610,7 @@ Jonathan Yap STORM-1788 STORM-1799 STORM-1796 + STORM-1808 Kadah Coba STORM-1060 Jondan Lundquist diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 1d1d39c786..16a7e0b314 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -37,6 +37,8 @@ tooltip_ref="Command_Build_Tooltip" execute_function="Build.Toggle" execute_parameters="build" + is_enabled_function="Agent.IsActionAllowed" + is_enabled_parameters="build" is_running_function="Floater.IsOpen" is_running_parameters="build" /> diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index ab9b5ff436..f0add8ddc4 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -171,7 +171,7 @@ bool LLAgent::isActionAllowed(const LLSD& sdname) if (param == "build") { - retval = gAgent.canEditParcel(); + retval = LLViewerParcelMgr::getInstance()->allowAgentBuild(); } else if (param == "speak") { -- cgit v1.2.3 From 91f77318db63d4b2560390551306056c4a6cc2d5 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 8 Feb 2012 15:44:02 -0800 Subject: EXP-1873 : Implement the hiding of cut items on the clipboard --- indra/llui/llclipboard.cpp | 6 +++++- indra/llui/llclipboard.h | 14 +++++++++----- indra/newview/llfolderviewitem.cpp | 6 ------ indra/newview/llinventoryfilter.cpp | 19 ++++++++++++++++++- indra/newview/llinventoryfilter.h | 4 +++- indra/newview/llinventorypanel.cpp | 13 +++++++++++++ indra/newview/llinventorypanel.h | 1 + 7 files changed, 49 insertions(+), 14 deletions(-) diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp index 7794a0537f..ee1f1aa816 100644 --- a/indra/llui/llclipboard.cpp +++ b/indra/llui/llclipboard.cpp @@ -34,7 +34,8 @@ #include "llview.h" #include "llwindow.h" -LLClipboard::LLClipboard() +LLClipboard::LLClipboard() : + mState(0) { reset(); } @@ -46,6 +47,7 @@ LLClipboard::~LLClipboard() void LLClipboard::reset() { + mState++; mObjects.reset(); mCutMode = false; mString = LLWString(); @@ -74,6 +76,7 @@ bool LLClipboard::addToClipboard(const LLUUID& src, const LLAssetType::EType typ if (res) { mObjects.put(src); + mState++; } } return res; @@ -126,6 +129,7 @@ bool LLClipboard::addToClipboard(const LLWString &src, S32 pos, S32 len, bool us { mString = mString + sep + src.substr(pos, len); } + mState++; return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString)); } diff --git a/indra/llui/llclipboard.h b/indra/llui/llclipboard.h index 608ea246a7..0231169748 100644 --- a/indra/llui/llclipboard.h +++ b/indra/llui/llclipboard.h @@ -47,6 +47,11 @@ class LLClipboard : public LLSingleton public: LLClipboard(); ~LLClipboard(); + + // Clears the clipboard + void reset(); + // Returns the state of the clipboard so client can know if it has been modified (comparing with tracked state) + int getState() const { return mState; } // Text strings management: // ------------------------ @@ -61,8 +66,6 @@ public: // Object list management: // ----------------------- - // Clears the clipboard - void reset(); // Clears and adds one single object to the clipboard bool copyToClipboard(const LLUUID& src, const LLAssetType::EType type = LLAssetType::AT_NONE); // Adds one object to the current list of objects on the clipboard @@ -74,12 +77,13 @@ public: bool isOnClipboard(const LLUUID& object) const; // True if the input object uuid is on the clipboard bool isCutMode() const { return mCutMode; } - void setCutMode(bool mode) { mCutMode = mode; } + void setCutMode(bool mode) { mCutMode = mode; mState++; } private: - LLDynamicArray mObjects; - LLWString mString; + LLDynamicArray mObjects; // Objects on the clipboard. Can be empty while mString contains something licit (e.g. text from chat) + LLWString mString; // The text string. If mObjects is not empty, this string is reflecting them (UUIDs for the moment). bool mCutMode; // This is a convenience flag for the viewer. It has no influence on the cliboard management. + int mState; // Incremented when the clipboard change so that interested parties can check its state. }; #endif // LL_LLCLIPBOARD_H diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 37ef27a5d7..884cddfe7f 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1004,12 +1004,6 @@ void LLFolderViewItem::draw() if (highlight_link) color = sLinkColor; if (in_library) color = sLibraryColor; - // Cut state rendering tweak (experimental) - if (LLClipboard::getInstance()->isCutMode() && LLClipboard::getInstance()->isOnClipboard(getListener()->getUUID())) - { - color.setAlpha(0.5); - } - F32 right_x = 0; F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD - (F32)TOP_PAD; F32 text_left = (F32)(ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + mIndentation); diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 796251cae5..9d12478019 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -39,6 +39,7 @@ #include "llviewerfoldertype.h" // linden library includes +#include "llclipboard.h" #include "lltrans.h" LLInventoryFilter::FilterOps::FilterOps() : @@ -236,7 +237,18 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con } } } - + + //////////////////////////////////////////////////////////////////////////////// + // FILTERTYPE_CLIPBOARD + // Pass if this item is not on the clipboard + if (filterTypes & FILTERTYPE_CLIPBOARD) + { + if (LLClipboard::getInstance()->isCutMode() && LLClipboard::getInstance()->isOnClipboard(object_id)) + { + return FALSE; + } + } + return TRUE; } @@ -450,6 +462,11 @@ void LLInventoryFilter::setFilterEmptySystemFolders() mFilterOps.mFilterTypes |= FILTERTYPE_EMPTYFOLDERS; } +void LLInventoryFilter::setFilterClipboard() +{ + mFilterOps.mFilterTypes |= FILTERTYPE_CLIPBOARD; +} + void LLInventoryFilter::setFilterUUID(const LLUUID& object_id) { if (mFilterOps.mFilterUUID == LLUUID::null) diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index 343306ae8e..fb4f84b139 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -59,7 +59,8 @@ public: FILTERTYPE_UUID = 0x1 << 2, // find the object with UUID and any links to it FILTERTYPE_DATE = 0x1 << 3, // search by date range FILTERTYPE_WEARABLE = 0x1 << 4, // search by wearable type - FILTERTYPE_EMPTYFOLDERS = 0x1 << 5 // pass if folder is not a system folder to be hidden if empty + FILTERTYPE_EMPTYFOLDERS = 0x1 << 5, // pass if folder is not a system folder to be hidden if empty + FILTERTYPE_CLIPBOARD = 0x1 << 6 // pass if item is not on the clipboard }; enum EFilterLink @@ -91,6 +92,7 @@ public: void setFilterUUID(const LLUUID &object_id); void setFilterWearableTypes(U64 types); void setFilterEmptySystemFolders(); + void setFilterClipboard(); void updateFilterTypes(U64 types, U64& current_types); void setFilterSubString(const std::string& string); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 382569fa3a..27f97ad26f 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -33,6 +33,7 @@ #include "llagentwearables.h" #include "llappearancemgr.h" #include "llavataractions.h" +#include "llclipboard.h" #include "llfloaterinventory.h" #include "llfloaterreg.h" #include "llfloatersidepanelcontainer.h" @@ -247,6 +248,10 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) getFilter()->setFilterEmptySystemFolders(); } + // hide items that are on the clipboard + getFilter()->setFilterClipboard(); + mClipboardState = LLClipboard::getInstance()->getState(); + // Initialize base class params. LLPanel::initFromParams(params); } @@ -277,6 +282,14 @@ void LLInventoryPanel::draw() { // Select the desired item (in case it wasn't loaded when the selection was requested) mFolderRoot->updateSelection(); + + // Nudge the filter if the clipboard state changed + if (mClipboardState != LLClipboard::getInstance()->getState()) + { + mClipboardState = LLClipboard::getInstance()->getState(); + getFilter()->setModified(LLInventoryFilter::FILTER_RESTART); + } + LLPanel::draw(); } diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 7d805f6862..6db59afb9b 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -222,6 +222,7 @@ public: private: std::string mSortOrderSetting; + int mClipboardState; //-------------------------------------------------------------------- // Hidden folders -- cgit v1.2.3 From e482e677b2dece8cc46008f4fb05e4927ec70b4e Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 8 Feb 2012 16:51:19 -0800 Subject: EXP-1767 WIP Received Items panel state does not persist between sessions fixed layout stack so programmatic size updates will work correctly --- indra/llui/lllayoutstack.cpp | 68 ++++++++++++++-------- indra/llui/lllayoutstack.h | 1 + .../skins/default/xui/en/floater_test_toolbar.xml | 8 +-- 3 files changed, 50 insertions(+), 27 deletions(-) diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 31e0434753..ae262f794e 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -252,7 +252,7 @@ void LLLayoutStack::removeChild(LLView* view) { mPanels.erase(std::find(mPanels.begin(), mPanels.end(), embedded_panelp)); delete embedded_panelp; - normalizeFractionalSizes(); + updateFractionalSizes(); mNeedsLayout = true; } @@ -277,7 +277,7 @@ bool LLLayoutStack::addChild(LLView* child, S32 tab_group) } BOOL result = LLView::addChild(child, tab_group); - normalizeFractionalSizes(); + updateFractionalSizes(); return result; } @@ -491,35 +491,48 @@ void LLLayoutStack::updateClass() } } -void LLLayoutStack::normalizeFractionalSizes() +void LLLayoutStack::updateFractionalSizes() { - F32 total_resizable_dim = 0; - S32 num_auto_resize_panels = 0; + F32 total_resizable_dim = 0.f; BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) { if (panelp->mAutoResize) { total_resizable_dim += llmax(0, panelp->getLayoutDim() - panelp->getRelevantMinDim()); - num_auto_resize_panels++; } } - F32 total_fractional_size = 0.f; - BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) { if (panelp->mAutoResize) { F32 panel_resizable_dim = llmax(MIN_FRACTIONAL_SIZE, (F32)(panelp->getLayoutDim() - panelp->getRelevantMinDim())); panelp->mFractionalSize = panel_resizable_dim > 0.f - ? llclamp(panel_resizable_dim / total_resizable_dim, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE) - : MIN_FRACTIONAL_SIZE; - total_fractional_size += panelp->mFractionalSize; + ? llclamp(panel_resizable_dim / total_resizable_dim, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE) + : MIN_FRACTIONAL_SIZE; llassert(!llisnan(panelp->mFractionalSize)); } } + normalizeFractionalSizes(); +} + + +void LLLayoutStack::normalizeFractionalSizes() +{ + S32 num_auto_resize_panels = 0; + F32 total_fractional_size = 0.f; + + BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) + { + if (panelp->mAutoResize) + { + total_fractional_size += panelp->mFractionalSize; + num_auto_resize_panels++; + } + } + if (total_fractional_size == 0.f) { // equal distribution BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) @@ -631,7 +644,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect& F32 total_visible_fraction = 0.f; F32 delta_auto_resize_headroom = 0.f; - F32 total_auto_resize_headroom = 0.f; + F32 original_auto_resize_headroom = 0.f; LLLayoutPanel* other_resize_panel = NULL; LLLayoutPanel* following_panel = NULL; @@ -640,8 +653,11 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect& { if (panelp->mAutoResize) { - total_auto_resize_headroom += (F32)(panelp->mTargetDim - panelp->getRelevantMinDim()); - total_visible_fraction += panelp->mFractionalSize * panelp->getAutoResizeFactor(); + original_auto_resize_headroom += (F32)(panelp->mTargetDim - panelp->getRelevantMinDim()); + if (panelp->getVisible() && !panelp->mCollapsed) + { + total_visible_fraction += panelp->mFractionalSize; + } } if (panelp == resized_panel) @@ -655,18 +671,25 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect& } } - if (resized_panel->mAutoResize == FALSE) + + if (resized_panel->mAutoResize) { - delta_auto_resize_headroom += -delta_dim; + if (!other_resize_panel || !other_resize_panel->mAutoResize) + { + delta_auto_resize_headroom += delta_dim; + } } - if (other_resize_panel && other_resize_panel->mAutoResize == FALSE) + else { - delta_auto_resize_headroom += delta_dim; + if (!other_resize_panel || other_resize_panel->mAutoResize) + { + delta_auto_resize_headroom -= delta_dim; + } } F32 fraction_given_up = 0.f; F32 fraction_remaining = 1.f; - F32 updated_auto_resize_headroom = total_auto_resize_headroom + delta_auto_resize_headroom; + F32 updated_auto_resize_headroom = original_auto_resize_headroom + delta_auto_resize_headroom; enum { @@ -692,14 +715,13 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect& { // freeze current size as fraction of overall auto_resize space F32 fractional_adjustment_factor = updated_auto_resize_headroom == 0.f ? 1.f - : total_auto_resize_headroom / updated_auto_resize_headroom; + : original_auto_resize_headroom / updated_auto_resize_headroom; F32 new_fractional_size = llclamp(panelp->mFractionalSize * fractional_adjustment_factor, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE); - F32 fraction_delta = (new_fractional_size - panelp->mFractionalSize); - fraction_given_up -= fraction_delta; + fraction_given_up -= new_fractional_size - panelp->mFractionalSize; fraction_remaining -= panelp->mFractionalSize; - panelp->mFractionalSize += fraction_delta; + panelp->mFractionalSize = new_fractional_size; llassert(!llisnan(panelp->mFractionalSize)); } else diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 4a8702e318..d32caec5f9 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -111,6 +111,7 @@ private: LLLayoutPanel* findEmbeddedPanel(LLPanel* panelp) const; LLLayoutPanel* findEmbeddedPanelByName(const std::string& name) const; + void updateFractionalSizes(); void normalizeFractionalSizes(); void updatePanelRect( LLLayoutPanel* param1, const LLRect& new_rect ); diff --git a/indra/newview/skins/default/xui/en/floater_test_toolbar.xml b/indra/newview/skins/default/xui/en/floater_test_toolbar.xml index 0c41c3ba2f..067c1fed82 100644 --- a/indra/newview/skins/default/xui/en/floater_test_toolbar.xml +++ b/indra/newview/skins/default/xui/en/floater_test_toolbar.xml @@ -7,7 +7,7 @@ name="floater_test_toolbar" translate="false" width="500"> - + - + -- cgit v1.2.3 From e0582d4bc71e2f367b4cf4a6f0b808451620b52f Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 8 Feb 2012 19:01:08 -0600 Subject: Fix for Debug GL generating errors when changing graphics preferences (reloading shaders). --- indra/llrender/llglslshader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 3773568ad8..7eba62e59e 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -109,7 +109,10 @@ void LLGLSLShader::unload() glGetAttachedObjectsARB(mProgramObject, 1024, &count, obj); for (GLsizei i = 0; i < count; i++) { - glDeleteObjectARB(obj[i]); + if (glIsProgramARB(obj[i])) + { + glDeleteObjectARB(obj[i]); + } } glDeleteObjectARB(mProgramObject); -- cgit v1.2.3 From 10dadc6b0dd646faa251c0935e75d07c97b3052d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 8 Feb 2012 17:22:04 -0800 Subject: EXP-1873 : Move cut items to trash in cut/copy over cut situations. --- indra/newview/llfolderview.cpp | 25 ++++++++++++++++++++++++- indra/newview/llfolderview.h | 1 + indra/newview/llinventoryfunctions.cpp | 25 +++++++++++++++++++++++++ indra/newview/llinventoryfunctions.h | 2 ++ 4 files changed, 52 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 1d318ca221..51a5839b75 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -1014,6 +1014,24 @@ bool isDescendantOfASelectedItem(LLFolderViewItem* item, const std::vector exit + if (!LLClipboard::getInstance()->isCutMode()) + return; + + // Get the list of clipboard item uuids and iterate through them + LLDynamicArray objects; + LLClipboard::getInstance()->pasteFromClipboard(objects); + for (LLDynamicArray::const_iterator iter = objects.begin(); + iter != objects.end(); + ++iter) + { + const LLUUID& item_id = (*iter); + remove_item(&gInventory, item_id); + } +} + void LLFolderView::onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -2109,7 +2127,12 @@ bool LLFolderView::doToSelected(LLInventoryModel* model, const LLSD& userdata) return true; } if (("copy" == action) || ("cut" == action)) - { + { + // If there are things on the clipboard that have not been pasted but + // already disappeared from view, we need to move them to the trash + removeCutItems(); + + // Clear the clipboard before we start adding things on it LLClipboard::getInstance()->reset(); } diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 1d018b5e6a..2f148d4e25 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -159,6 +159,7 @@ public: // deletion functionality void removeSelectedItems(); + void removeCutItems(); // open the selected item. void openSelectedItems( void ); diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index ea00474b2a..8313b23f44 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -160,6 +160,31 @@ void change_category_parent(LLInventoryModel* model, model->notifyObservers(); } +// Move the item to the trash. Works for folders and objects. +// Caution: This method assumes that the item is removable! +void remove_item(LLInventoryModel* model, const LLUUID& id) +{ + LLViewerInventoryItem* item = model->getItem(id); + if (!item) + return; + + if (item->getType() == LLAssetType::AT_CATEGORY) + { + // Call the general helper function to delete a folder + remove_category(model, id); + } + else + { + // Get the trash UUID + LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH, false); + if (trash_id.notNull()) + { + // Finally, move the item to the trash + change_item_parent(model, item, trash_id, true); + } + } +} + void remove_category(LLInventoryModel* model, const LLUUID& cat_id) { if (!model || !get_is_category_removable(model, cat_id)) diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index ce2b89b22e..f8ecca22b6 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -62,6 +62,8 @@ void change_item_parent(LLInventoryModel* model, const LLUUID& new_parent_id, BOOL restamp); +void remove_item(LLInventoryModel* model, const LLUUID& id); + void change_category_parent(LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& new_parent_id, -- cgit v1.2.3 From 94b8cd3fa602025e59f4395dc971c8ffa1ac86c5 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 9 Feb 2012 09:27:18 -0800 Subject: Enabled the 'Merchant Outbox' menu item and context menu --- indra/newview/llinventorybridge.cpp | 2 +- indra/newview/skins/default/xui/en/menu_viewer.xml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index cebe93f042..c0065a94e6 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -73,7 +73,7 @@ #include "llwearablelist.h" // Marketplace outbox current disabled -#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU 0 +#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU 1 #define ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU 0 #define BLOCK_WORN_ITEMS_IN_OUTBOX 1 diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index cd8550b00d..1d11abcf73 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -152,6 +152,13 @@ + + + -- cgit v1.2.3 From 41bc3eded93b1af306d492d40646c5cff34afd1c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 9 Feb 2012 11:32:40 -0800 Subject: EXP-1880 WIP Update Media affects framerate even when Media is disabled. --- indra/newview/llviewermedia.cpp | 43 ++++++++++++++--------------------------- indra/newview/llviewermedia.h | 3 --- 2 files changed, 14 insertions(+), 32 deletions(-) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index d7e79351c2..efc725896f 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -387,7 +387,6 @@ class LLViewerMediaMuteListObserver : public LLMuteListObserver static LLViewerMediaMuteListObserver sViewerMediaMuteListObserver; static bool sViewerMediaMuteListObserverInitialized = false; -static bool sInWorldMediaDisabled = false; ////////////////////////////////////////////////////////////////////////////////////////// @@ -652,20 +651,6 @@ void LLViewerMedia::muteListChanged() } } -////////////////////////////////////////////////////////////////////////////////////////// -// static -void LLViewerMedia::setInWorldMediaDisabled(bool disabled) -{ - sInWorldMediaDisabled = disabled; -} - -////////////////////////////////////////////////////////////////////////////////////////// -// static -bool LLViewerMedia::getInWorldMediaDisabled() -{ - return sInWorldMediaDisabled; -} - ////////////////////////////////////////////////////////////////////////////////////////// // static bool LLViewerMedia::isInterestingEnough(const LLVOVolume *object, const F64 &object_interest) @@ -1568,7 +1553,6 @@ LLPluginClassMedia* LLViewerMedia::getSpareBrowserMediaSource() bool LLViewerMedia::hasInWorldMedia() { - if (sInWorldMediaDisabled) return false; impl_list::iterator iter = sViewerMediaImplList.begin(); impl_list::iterator end = sViewerMediaImplList.end(); // This should be quick, because there should be very few non-in-world-media impls @@ -3107,15 +3091,6 @@ bool LLViewerMediaImpl::isForcedUnloaded() const return true; } - if(sInWorldMediaDisabled) - { - // When inworld media is disabled, all instances that aren't marked as "used in UI" will not be loaded. - if(!mUsedInUI) - { - return true; - } - } - // If this media's class is not supposed to be shown, unload if (!shouldShowBasedOnClass()) { @@ -3783,12 +3758,22 @@ bool LLViewerMediaImpl::shouldShowBasedOnClass() const // If it is attached to an avatar and the pref is off, we shouldn't show it if (attached_to_another_avatar) - return gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING); - + { + static LLCachedControl show_media_on_others(gSavedSettings, LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING); + return show_media_on_others; + } if (inside_parcel) - return gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING); + { + static LLCachedControl show_media_within_parcel(gSavedSettings, LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING); + + return show_media_within_parcel; + } else - return gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING); + { + static LLCachedControl show_media_outside_parcel(gSavedSettings, LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING); + + return show_media_outside_parcel; + } } ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 15dcda59cf..fff5b3fc08 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -112,9 +112,6 @@ public: static F32 getVolume(); static void muteListChanged(); - static void setInWorldMediaDisabled(bool disabled); - static bool getInWorldMediaDisabled(); - static bool isInterestingEnough(const LLVOVolume* object, const F64 &object_interest); // Returns the priority-sorted list of all media impls. -- cgit v1.2.3 From ed137f40d137dd78d0ec916ca91814cf5534a9f6 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 9 Feb 2012 11:40:55 -0800 Subject: fix for cached controls in media sorting --- indra/newview/llviewermedia.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index efc725896f..1eb4bedfaf 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -3759,18 +3759,18 @@ bool LLViewerMediaImpl::shouldShowBasedOnClass() const // If it is attached to an avatar and the pref is off, we shouldn't show it if (attached_to_another_avatar) { - static LLCachedControl show_media_on_others(gSavedSettings, LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING); + static LLCachedControl show_media_on_others(gSavedSettings, LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING); return show_media_on_others; } if (inside_parcel) { - static LLCachedControl show_media_within_parcel(gSavedSettings, LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING); + static LLCachedControl show_media_within_parcel(gSavedSettings, LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING); return show_media_within_parcel; } else { - static LLCachedControl show_media_outside_parcel(gSavedSettings, LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING); + static LLCachedControl show_media_outside_parcel(gSavedSettings, LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING); return show_media_outside_parcel; } -- cgit v1.2.3 From e5f81fdcc98ded831c48c4e31a4a215877e0a1e4 Mon Sep 17 00:00:00 2001 From: "Debi King (Dessie)" Date: Thu, 9 Feb 2012 15:17:34 -0500 Subject: Added tag DRTVWR-117_3.2.9-beta1, 3.2.9-beta1 for changeset e9c82fca5ae6 --- .hgtags | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.hgtags b/.hgtags index 57b89e78b3..d4bf3a81f8 100644 --- a/.hgtags +++ b/.hgtags @@ -264,3 +264,5 @@ c6175c955a19e9b9353d242889ec1779b5762522 3.2.5-release 987425b1acf4752379b2e1eb20944b4b35d67a85 DRTVWR-115_3.2.8-beta2 987425b1acf4752379b2e1eb20944b4b35d67a85 3.2.8-beta2 37dd400ad721e2a89ee820ffc1e7e433c68f3ca2 3.2.9-start +e9c82fca5ae6fb8a8af29012d78fb194a29323f3 DRTVWR-117_3.2.9-beta1 +e9c82fca5ae6fb8a8af29012d78fb194a29323f3 3.2.9-beta1 -- cgit v1.2.3 From 4523b3137850df8922b12cc966633a3d5bb84374 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 9 Feb 2012 12:58:43 -0800 Subject: EXP-1844 FIX Selecting a large number of inventory items can block the viewer for a long time. only show hourglass and fetching text when downloading folders, not item metadata --- indra/newview/llfolderview.cpp | 4 +- indra/newview/llfolderviewitem.cpp | 2 +- indra/newview/llinventorybridge.cpp | 1 + indra/newview/llinventoryfilter.cpp | 2 +- indra/newview/llinventorymodelbackgroundfetch.cpp | 170 +++++++++++++--------- indra/newview/llinventorymodelbackgroundfetch.h | 4 +- indra/newview/llinventorypanel.cpp | 2 +- indra/newview/llpanelmaininventory.cpp | 2 +- indra/newview/llviewerinventory.cpp | 5 - 9 files changed, 108 insertions(+), 84 deletions(-) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 2249f61435..86001e4146 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -912,7 +912,7 @@ void LLFolderView::draw() } else if (mShowEmptyMessage) { - if (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() || mCompletedFilterGeneration < mFilter->getMinRequiredGeneration()) + if (LLInventoryModelBackgroundFetch::instance().folderFetchActive() || mCompletedFilterGeneration < mFilter->getMinRequiredGeneration()) { mStatusText = LLTrans::getString("Searching"); } @@ -1966,7 +1966,7 @@ void LLFolderView::scrollToShowSelection() // However we allow scrolling for folder views with mAutoSelectOverride // (used in Places SP) as an exception because the selection in them // is not reset during items filtering. See STORM-133. - if ( (!LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() || mAutoSelectOverride) + if ( (!LLInventoryModelBackgroundFetch::instance().folderFetchActive() || mAutoSelectOverride) && mSelectedItems.size() ) { mNeedsScroll = TRUE; diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 734adbc648..afad27b4e0 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1045,7 +1045,7 @@ void LLFolderViewItem::draw() } if ((mIsLoading && mTimeSinceRequestStart.getElapsedTimeF32() >= gSavedSettings.getF32("FolderLoadingMessageWaitTime")) - || (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() + || (LLInventoryModelBackgroundFetch::instance().folderFetchActive() && root_is_loading && mShowLoadStatus)) { diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 257ceed912..daebfb5c86 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1324,6 +1324,7 @@ void LLItemBridge::selectItem() LLViewerInventoryItem* item = static_cast(getItem()); if(item && !item->isFinished()) { + //item->fetchFromServer(); LLInventoryModelBackgroundFetch::instance().start(item->getUUID(), false); } } diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 796251cae5..f818e33726 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -888,7 +888,7 @@ const std::string& LLInventoryFilter::getFilterText() filtered_by_all_types = FALSE; } - if (!LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() + if (!LLInventoryModelBackgroundFetch::instance().folderFetchActive() && filtered_by_type && !filtered_by_all_types) { diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index cb140cf15c..f4d0110b0f 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -43,6 +43,7 @@ const S32 MAX_FETCH_RETRIES = 10; LLInventoryModelBackgroundFetch::LLInventoryModelBackgroundFetch() : mBackgroundFetchActive(FALSE), + mFolderFetchActive(false), mAllFoldersFetched(FALSE), mRecursiveInventoryFetchStarted(FALSE), mRecursiveLibraryFetchStarted(FALSE), @@ -98,19 +99,20 @@ bool LLInventoryModelBackgroundFetch::isEverythingFetched() const return mAllFoldersFetched; } -BOOL LLInventoryModelBackgroundFetch::backgroundFetchActive() const +BOOL LLInventoryModelBackgroundFetch::folderFetchActive() const { - return mBackgroundFetchActive; + return mFolderFetchActive; } void LLInventoryModelBackgroundFetch::start(const LLUUID& id, BOOL recursive) { LLViewerInventoryCategory* cat = gInventory.getCategory(id); - if (cat || (id.isNull() && !mAllFoldersFetched)) + if (cat || (id.isNull() && !isEverythingFetched())) { // it's a folder, do a bulk fetch LL_DEBUGS("InventoryFetch") << "Start fetching category: " << id << ", recursive: " << recursive << LL_ENDL; mBackgroundFetchActive = TRUE; + mFolderFetchActive = true; if (id.isNull()) { if (!mRecursiveInventoryFetchStarted) @@ -159,21 +161,11 @@ void LLInventoryModelBackgroundFetch::start(const LLUUID& id, BOOL recursive) void LLInventoryModelBackgroundFetch::findLostItems() { mBackgroundFetchActive = TRUE; + mFolderFetchActive = true; mFetchQueue.push_back(FetchQueueInfo(LLUUID::null, TRUE)); gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); } -void LLInventoryModelBackgroundFetch::stopBackgroundFetch() -{ - if (mBackgroundFetchActive) - { - mBackgroundFetchActive = FALSE; - gIdleCallbacks.deleteFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); - mFetchCount=0; - mMinTimeBetweenFetches=0.0f; - } -} - void LLInventoryModelBackgroundFetch::setAllFoldersFetched() { if (mRecursiveInventoryFetchStarted && @@ -181,7 +173,7 @@ void LLInventoryModelBackgroundFetch::setAllFoldersFetched() { mAllFoldersFetched = TRUE; } - stopBackgroundFetch(); + mFolderFetchActive = false; } void LLInventoryModelBackgroundFetch::backgroundFetchCB(void *) @@ -211,6 +203,9 @@ void LLInventoryModelBackgroundFetch::backgroundFetch() llinfos << "Inventory fetch completed" << llendl; setAllFoldersFetched(); + mBackgroundFetchActive = false; + mFolderFetchActive = false; + return; } @@ -240,80 +235,114 @@ void LLInventoryModelBackgroundFetch::backgroundFetch() } const FetchQueueInfo info = mFetchQueue.front(); - LLViewerInventoryCategory* cat = gInventory.getCategory(info.mUUID); - // Category has been deleted, remove from queue. - if (!cat) + if (info.mIsCategory) { - mFetchQueue.pop_front(); - continue; - } + + LLViewerInventoryCategory* cat = gInventory.getCategory(info.mUUID); + + // Category has been deleted, remove from queue. + if (!cat) + { + mFetchQueue.pop_front(); + continue; + } - if (mFetchTimer.getElapsedTimeF32() > mMinTimeBetweenFetches && - LLViewerInventoryCategory::VERSION_UNKNOWN == cat->getVersion()) - { - // Category exists but has no children yet, fetch the descendants - // for now, just request every time and rely on retry timer to throttle. - if (cat->fetch()) + if (mFetchTimer.getElapsedTimeF32() > mMinTimeBetweenFetches && + LLViewerInventoryCategory::VERSION_UNKNOWN == cat->getVersion()) { - mFetchTimer.reset(); - mTimelyFetchPending = TRUE; + // Category exists but has no children yet, fetch the descendants + // for now, just request every time and rely on retry timer to throttle. + if (cat->fetch()) + { + mFetchTimer.reset(); + mTimelyFetchPending = TRUE; + } + else + { + // The catagory also tracks if it has expired and here it says it hasn't + // yet. Get out of here because nothing is going to happen until we + // update the timers. + break; + } } - else + // Do I have all my children? + else if (gInventory.isCategoryComplete(info.mUUID)) { - // The catagory also tracks if it has expired and here it says it hasn't - // yet. Get out of here because nothing is going to happen until we - // update the timers. + // Finished with this category, remove from queue. + mFetchQueue.pop_front(); + + // Add all children to queue. + LLInventoryModel::cat_array_t* categories; + LLInventoryModel::item_array_t* items; + gInventory.getDirectDescendentsOf(cat->getUUID(), categories, items); + for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); + it != categories->end(); + ++it) + { + mFetchQueue.push_back(FetchQueueInfo((*it)->getUUID(),info.mRecursive)); + } + + // We received a response in less than the fast time. + if (mTimelyFetchPending && mFetchTimer.getElapsedTimeF32() < fast_fetch_time) + { + // Shrink timeouts based on success. + mMinTimeBetweenFetches = llmax(mMinTimeBetweenFetches * 0.8f, 0.3f); + mMaxTimeBetweenFetches = llmax(mMaxTimeBetweenFetches * 0.8f, 10.f); + lldebugs << "Inventory fetch times shrunk to (" << mMinTimeBetweenFetches << ", " << mMaxTimeBetweenFetches << ")" << llendl; + } + + mTimelyFetchPending = FALSE; + continue; + } + else if (mFetchTimer.getElapsedTimeF32() > mMaxTimeBetweenFetches) + { + // Received first packet, but our num descendants does not match db's num descendants + // so try again later. + mFetchQueue.pop_front(); + + if (mNumFetchRetries++ < MAX_FETCH_RETRIES) + { + // push on back of queue + mFetchQueue.push_back(info); + } + mTimelyFetchPending = FALSE; + mFetchTimer.reset(); break; } + + // Not enough time has elapsed to do a new fetch + break; } - // Do I have all my children? - else if (gInventory.isCategoryComplete(info.mUUID)) + else { - // Finished with this category, remove from queue. - mFetchQueue.pop_front(); + LLViewerInventoryItem* itemp = gInventory.getItem(info.mUUID); - // Add all children to queue. - LLInventoryModel::cat_array_t* categories; - LLInventoryModel::item_array_t* items; - gInventory.getDirectDescendentsOf(cat->getUUID(), categories, items); - for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); - it != categories->end(); - ++it) + mFetchQueue.pop_front(); + if (!itemp) { - mFetchQueue.push_back(FetchQueueInfo((*it)->getUUID(),info.mRecursive)); + continue; } - // We received a response in less than the fast time. - if (mTimelyFetchPending && mFetchTimer.getElapsedTimeF32() < fast_fetch_time) + if (mFetchTimer.getElapsedTimeF32() > mMinTimeBetweenFetches) { - // Shrink timeouts based on success. - mMinTimeBetweenFetches = llmax(mMinTimeBetweenFetches * 0.8f, 0.3f); - mMaxTimeBetweenFetches = llmax(mMaxTimeBetweenFetches * 0.8f, 10.f); - lldebugs << "Inventory fetch times shrunk to (" << mMinTimeBetweenFetches << ", " << mMaxTimeBetweenFetches << ")" << llendl; + itemp->fetchFromServer(); + mFetchTimer.reset(); + mTimelyFetchPending = TRUE; } - - mTimelyFetchPending = FALSE; - continue; - } - else if (mFetchTimer.getElapsedTimeF32() > mMaxTimeBetweenFetches) - { - // Received first packet, but our num descendants does not match db's num descendants - // so try again later. - mFetchQueue.pop_front(); - - if (mNumFetchRetries++ < MAX_FETCH_RETRIES) + else if (itemp->mIsComplete) + { + mTimelyFetchPending = FALSE; + } + else if (mFetchTimer.getElapsedTimeF32() > mMaxTimeBetweenFetches) { - // push on back of queue mFetchQueue.push_back(info); + mFetchTimer.reset(); + mTimelyFetchPending = FALSE; } - mTimelyFetchPending = FALSE; - mFetchTimer.reset(); + // Not enough time has elapsed to do a new fetch break; } - - // Not enough time has elapsed to do a new fetch - break; } // @@ -543,7 +572,6 @@ void LLInventoryModelBackgroundFetch::bulkFetch() //Background fetch is called from gIdleCallbacks in a loop until background fetch is stopped. //If there are items in mFetchQueue, we want to check the time since the last bulkFetch was //sent. If it exceeds our retry time, go ahead and fire off another batch. - //Stopbackgroundfetch will be run from the Responder instead of here. LLViewerRegion* region = gAgent.getRegion(); if (!region) return; @@ -574,12 +602,12 @@ void LLInventoryModelBackgroundFetch::bulkFetch() LLSD item_request_body; LLSD item_request_body_lib; - while (!(mFetchQueue.empty()) && ((item_count + folder_count) < max_batch_size)) + while (!mFetchQueue.empty() + && (item_count + folder_count) < max_batch_size) { const FetchQueueInfo& fetch_info = mFetchQueue.front(); if (fetch_info.mIsCategory) { - const LLUUID &cat_id = fetch_info.mUUID; if (cat_id.isNull()) //DEV-17797 { diff --git a/indra/newview/llinventorymodelbackgroundfetch.h b/indra/newview/llinventorymodelbackgroundfetch.h index 0745407a8c..9dfedddd6d 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.h +++ b/indra/newview/llinventorymodelbackgroundfetch.h @@ -48,7 +48,7 @@ public: // This gets triggered when performing a filter-search. void start(const LLUUID& cat_id = LLUUID::null, BOOL recursive = TRUE); - BOOL backgroundFetchActive() const; + BOOL folderFetchActive() const; bool isEverythingFetched() const; // completing the fetch once per session should be sufficient bool libraryFetchStarted() const; @@ -67,7 +67,6 @@ protected: void backgroundFetch(); static void backgroundFetchCB(void*); // background fetch idle function - void stopBackgroundFetch(); // stop fetch process void setAllFoldersFetched(); bool fetchQueueContainsNoDescendentsOf(const LLUUID& cat_id) const; @@ -77,6 +76,7 @@ private: BOOL mAllFoldersFetched; BOOL mBackgroundFetchActive; + bool mFolderFetchActive; S16 mFetchCount; BOOL mTimelyFetchPending; S32 mNumFetchRetries; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 382569fa3a..01a8ecfb5d 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -817,7 +817,7 @@ BOOL LLInventoryPanel::handleHover(S32 x, S32 y, MASK mask) if(handled) { ECursorType cursor = getWindow()->getCursor(); - if (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() && cursor == UI_CURSOR_ARROW) + if (LLInventoryModelBackgroundFetch::instance().folderFetchActive() && cursor == UI_CURSOR_ARROW) { // replace arrow cursor with arrow and hourglass cursor getWindow()->setCursor(UI_CURSOR_WORKING); diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 374afb90be..c3c62920d3 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -567,7 +567,7 @@ void LLPanelMainInventory::updateItemcountText() std::string text = ""; - if (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive()) + if (LLInventoryModelBackgroundFetch::instance().folderFetchActive()) { text = getString("ItemcountFetching", string_args); } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index cf52b5165b..45ca23cdfe 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -436,11 +436,6 @@ void LLViewerInventoryItem::fetchFromServer(void) const gAgent.sendReliableMessage(); } } - else - { - // *FIX: this can be removed after a bit. - llwarns << "request to fetch complete item" << llendl; - } } // virtual -- cgit v1.2.3 From ca80e17e90ce5b70feca76ddf41d3c25d01ac830 Mon Sep 17 00:00:00 2001 From: paulgproductengine Date: Thu, 9 Feb 2012 23:34:12 +0200 Subject: EXP-1822 FIXED (After deleting an item from inventory and confirming "ok" to delete, focus leaves inventory) - Return focus to the previously focused root view --- indra/newview/lltoastalertpanel.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index ada7570776..9ba8431fde 100644 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -73,9 +73,14 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal // save currently focused view, so that return focus to it // on destroying this toast. LLView* current_selection = dynamic_cast(gFocusMgr.getKeyboardFocus()); - if (current_selection) + while(current_selection) { - mPreviouslyFocusedView = current_selection->getHandle(); + if (current_selection->isFocusRoot()) + { + mPreviouslyFocusedView = current_selection->getHandle(); + break; + } + current_selection = current_selection->getParent(); } const LLFontGL* font = LLFontGL::getFontSansSerif(); @@ -422,7 +427,7 @@ LLToastAlertPanel::~LLToastAlertPanel() // return focus to the previously focused view if (mPreviouslyFocusedView.get()) { - gFocusMgr.setKeyboardFocus(mPreviouslyFocusedView.get()); + mPreviouslyFocusedView.get()->setFocus(TRUE); } } -- cgit v1.2.3 From b3e56527a751aa2b87f50b33cf3439c07704c1d5 Mon Sep 17 00:00:00 2001 From: paulgproductengine Date: Thu, 9 Feb 2012 23:42:07 +0200 Subject: EXP-1546 FIXED (received items - purchasing some bodyparts and clothing from a prim marked for sale show wrong inventory icons) - In buy floater, for multiple WEARABLES inventory items show corresponding wearable icon --- indra/newview/llfloaterbuy.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloaterbuy.cpp b/indra/newview/llfloaterbuy.cpp index ee8487b160..087b0007e1 100644 --- a/indra/newview/llfloaterbuy.cpp +++ b/indra/newview/llfloaterbuy.cpp @@ -239,8 +239,9 @@ void LLFloaterBuy::inventoryChanged(LLViewerObject* obj, // Compute icon for this item BOOL item_is_multi = FALSE; - if ( inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_LANDMARK_VISITED + if (( inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_LANDMARK_VISITED || inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS) + && !(inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK)) { item_is_multi = TRUE; } -- cgit v1.2.3 From 21efa498a140bdc05c858cfa1be7e247d2b89278 Mon Sep 17 00:00:00 2001 From: paulgproductengine Date: Thu, 9 Feb 2012 23:47:00 +0200 Subject: EXP-1819 FIXED (Location & Favorites bar splitter should be draggable to 200 px on left and 150 px on right. ) - Allowed dragging to the left to shrink location to no less than 410 pixels, and to the right to shrink favorites to 185 pixels --- indra/newview/skins/default/xui/en/panel_navigation_bar.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml index 53a09ce041..3edeb9aa36 100644 --- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -70,7 +70,7 @@ layout="topleft" auto_resize="true" user_resize="true" - min_width="310" + min_width="410" name="navigation_layout_panel" width="480"> Date: Thu, 9 Feb 2012 23:54:22 +0200 Subject: EXP-1335 FIXED Disabled dragging the items from notecards and objects into Recent tab. Disabled DnD from Recent to Received Items. Fixed updating FILTERTYPE_DATE flag of LLInventoryFilter when time limits are applied. --- indra/newview/llinventoryfilter.cpp | 37 ++++++++++++---------- indra/newview/llinventoryfilter.h | 2 ++ .../skins/default/xui/en/panel_inbox_inventory.xml | 1 + 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 796251cae5..177ab28b36 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -282,19 +282,9 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLInventoryItem* item) cons // Pass if this item is within the date range. if (filterTypes & FILTERTYPE_DATE) { - const U16 HOURS_TO_SECONDS = 3600; - time_t earliest = time_corrected() - mFilterOps.mHoursAgo * HOURS_TO_SECONDS; - if (mFilterOps.mMinDate > time_min() && mFilterOps.mMinDate < earliest) - { - earliest = mFilterOps.mMinDate; - } - else if (!mFilterOps.mHoursAgo) - { - earliest = 0; - } - if (item->getCreationDate() < earliest || - item->getCreationDate() > mFilterOps.mMaxDate) - return false; + // We don't get the updated item creation date for the task inventory or + // a notecard embedded item. See LLTaskInvFVBridge::getCreationDate(). + return false; } return true; @@ -548,7 +538,9 @@ void LLInventoryFilter::setDateRange(time_t min_date, time_t max_date) mFilterOps.mMaxDate = llmax(mFilterOps.mMinDate, max_date); setModified(); } - mFilterOps.mFilterTypes |= FILTERTYPE_DATE; + + areDateLimitsSet() ? mFilterOps.mFilterTypes |= FILTERTYPE_DATE + : mFilterOps.mFilterTypes &= ~FILTERTYPE_DATE; } void LLInventoryFilter::setDateRangeLastLogoff(BOOL sl) @@ -560,10 +552,12 @@ void LLInventoryFilter::setDateRangeLastLogoff(BOOL sl) } if (!sl && isSinceLogoff()) { - setDateRange(0, time_max()); + setDateRange(time_min(), time_max()); setModified(); } - mFilterOps.mFilterTypes |= FILTERTYPE_DATE; + + areDateLimitsSet() ? mFilterOps.mFilterTypes |= FILTERTYPE_DATE + : mFilterOps.mFilterTypes &= ~FILTERTYPE_DATE; } BOOL LLInventoryFilter::isSinceLogoff() const @@ -608,7 +602,9 @@ void LLInventoryFilter::setHoursAgo(U32 hours) setModified(FILTER_RESTART); } } - mFilterOps.mFilterTypes |= FILTERTYPE_DATE; + + areDateLimitsSet() ? mFilterOps.mFilterTypes |= FILTERTYPE_DATE + : mFilterOps.mFilterTypes &= ~FILTERTYPE_DATE; } void LLInventoryFilter::setFilterLinks(U64 filter_links) @@ -1058,3 +1054,10 @@ const std::string& LLInventoryFilter::getEmptyLookupMessage() const return mEmptyLookupMessage; } + +bool LLInventoryFilter::areDateLimitsSet() +{ + return mFilterOps.mMinDate != time_min() + || mFilterOps.mMaxDate != time_max() + || mFilterOps.mHoursAgo != 0; +} diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index 343306ae8e..8635d5d5b3 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -179,6 +179,8 @@ public: void fromLLSD(LLSD& data); private: + bool areDateLimitsSet(); + struct FilterOps { FilterOps(); diff --git a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml index 383e637ace..413e22e444 100644 --- a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml @@ -1,5 +1,6 @@ Date: Fri, 10 Feb 2012 02:33:22 +0200 Subject: EXP-1876 FIXED Landmark notes editor height increased to accommodate 5 lines of new font height. --- indra/newview/skins/default/xui/en/panel_landmark_info.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_landmark_info.xml b/indra/newview/skins/default/xui/en/panel_landmark_info.xml index d2088594dd..fd6e96b9a7 100644 --- a/indra/newview/skins/default/xui/en/panel_landmark_info.xml +++ b/indra/newview/skins/default/xui/en/panel_landmark_info.xml @@ -271,7 +271,7 @@ Date: Thu, 9 Feb 2012 17:14:37 -0800 Subject: EXP-1874 FIX Unexpected scrollbar in text notification --- indra/llui/lltextbase.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index e2d9a6cb81..35abe48510 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2380,6 +2380,8 @@ S32 LLTextBase::getEditableIndex(S32 index, bool increasing_direction) void LLTextBase::updateRects() { + mVisibleTextRect = getLocalRect(); + if (mLineInfoList.empty()) { mTextBoundingRect = LLRect(0, mVPad, mHPad, 0); @@ -2604,8 +2606,7 @@ BOOL LLTextSegment::handleScrollWheel(S32 x, S32 y, S32 clicks) { return FALSE; BOOL LLTextSegment::handleToolTip(S32 x, S32 y, MASK mask) { return FALSE; } const std::string& LLTextSegment::getName() const { - static std::string empty_string(""); - return empty_string; + return LLStringUtil::null; } void LLTextSegment::onMouseCaptureLost() {} void LLTextSegment::screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const {} -- cgit v1.2.3 From e9ee15d9420d8987028ec0267ac5d1f46a918b6f Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 9 Feb 2012 17:45:30 -0800 Subject: EXP-1877 FIX Scroll list listings in group roles tab and other areas shows vertical scroll bar before needed --- indra/newview/skins/default/xui/en/floater_about_land.xml | 4 ++-- indra/newview/skins/default/xui/en/floater_choose_group.xml | 2 +- indra/newview/skins/default/xui/en/panel_group_roles.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 2781717f0b..a737c123c6 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -2085,7 +2085,7 @@ Only large parcels can be listed in search. column_padding="0" follows="top|bottom" heading_height="14" - height="120" + height="125" layout="topleft" left="0" multi_select="true" @@ -2134,7 +2134,7 @@ Only large parcels can be listed in search. column_padding="0" follows="top|bottom" heading_height="14" - height="120" + height="125" layout="topleft" left="0" multi_select="true" diff --git a/indra/newview/skins/default/xui/en/floater_choose_group.xml b/indra/newview/skins/default/xui/en/floater_choose_group.xml index dc1ee5f24e..2cf6e682fd 100644 --- a/indra/newview/skins/default/xui/en/floater_choose_group.xml +++ b/indra/newview/skins/default/xui/en/floater_choose_group.xml @@ -20,7 +20,7 @@ Choose a group: Date: Thu, 9 Feb 2012 17:50:09 -0800 Subject: EXP-1883 FIX Toolbar button tooltips display off screen for right hand tool bar, bottom tool bar, and tooltips on top bar items show off screen --- indra/llui/llmenugl.cpp | 2 +- indra/llui/llui.cpp | 2 +- indra/llui/llview.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 1284231e52..ff6928ffda 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3082,7 +3082,7 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) mouse_y + MOUSE_CURSOR_PADDING, CURSOR_WIDTH + MOUSE_CURSOR_PADDING * 2, CURSOR_HEIGHT + MOUSE_CURSOR_PADDING * 2); - menu->translateIntoRectWithExclusion( menu_region_rect, mouse_rect, FALSE ); + menu->translateIntoRectWithExclusion( menu_region_rect, mouse_rect ); menu->getParent()->sendChildToFront(menu); } diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 137716743f..31ccec0d2a 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -2049,7 +2049,7 @@ void LLUI::positionViewNearMouse(LLView* view, S32 spawn_x, S32 spawn_y) // Start at spawn position (using left/top) view->setOrigin( local_x, local_y - view->getRect().getHeight()); // Make sure we're on-screen and not overlapping the mouse - view->translateIntoRectWithExclusion( virtual_window_rect, mouse_rect, FALSE ); + view->translateIntoRectWithExclusion( virtual_window_rect, mouse_rect ); } LLView* LLUI::resolvePath(LLView* context, const std::string& path) diff --git a/indra/llui/llview.h b/indra/llui/llview.h index de2fab963b..fd19309a56 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -371,7 +371,7 @@ public: virtual void translate( S32 x, S32 y ); void setOrigin( S32 x, S32 y ) { mRect.translate( x - mRect.mLeft, y - mRect.mBottom ); } BOOL translateIntoRect( const LLRect& constraint, S32 min_overlap_pixels = S32_MAX); - BOOL translateIntoRectWithExclusion( const LLRect& inside, const LLRect& exclude, BOOL allow_partial_outside ); + BOOL translateIntoRectWithExclusion( const LLRect& inside, const LLRect& exclude, S32 min_overlap_pixels = S32_MAX); void centerWithin(const LLRect& bounds); void setShape(const LLRect& new_rect, bool by_user = false); -- cgit v1.2.3 From 2a4aa438f5798c34f1eef3ef75dc3289492138e1 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 9 Feb 2012 23:37:24 -0800 Subject: EXP-1863 : Implemented cut, copy, paste for folders. Issues with folder filtering though. --- indra/newview/llinventorybridge.cpp | 82 +++++++++++++++++++++------------- indra/newview/llinventoryfilter.cpp | 45 +++++++++++++++++-- indra/newview/llinventoryfunctions.cpp | 36 +++++++++++++++ indra/newview/llinventoryfunctions.h | 2 + 4 files changed, 131 insertions(+), 34 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 9775e54d6a..1fa6820d2d 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -210,21 +210,21 @@ BOOL LLInvFVBridge::isLink() const */ BOOL LLInvFVBridge::cutToClipboard() const { - LLViewerInventoryItem* inv_item = gInventory.getItem(mUUID); - if (inv_item && isItemMovable() && isItemRemovable()) + const LLInventoryObject* obj = gInventory.getObject(mUUID); + if (obj && isItemMovable() && isItemRemovable()) { LLClipboard::getInstance()->setCutMode(true); - return LLClipboard::getInstance()->addToClipboard(mUUID,inv_item->getType()); + return LLClipboard::getInstance()->addToClipboard(mUUID,obj->getType()); } return FALSE; } BOOL LLInvFVBridge::copyToClipboard() const { - LLViewerInventoryItem* inv_item = gInventory.getItem(mUUID); - if (inv_item && isItemCopyable()) + const LLInventoryObject* obj = gInventory.getObject(mUUID); + if (obj && isItemCopyable()) { - return LLClipboard::getInstance()->addToClipboard(mUUID,inv_item->getType()); + return LLClipboard::getInstance()->addToClipboard(mUUID,obj->getType()); } return FALSE; } @@ -423,9 +423,6 @@ BOOL LLInvFVBridge::isClipboardPasteable() const const LLUUID &agent_id = gAgent.getID(); - // Merov : This should be suppressed for 2 reasons: - // 1. folders should be pastable - // 2. when pasting, we should paste what is authorized and let the rest not pasted LLDynamicArray objects; LLClipboard::getInstance()->pasteFromClipboard(objects); S32 count = objects.count(); @@ -433,12 +430,9 @@ BOOL LLInvFVBridge::isClipboardPasteable() const { const LLUUID &item_id = objects.get(i); - // Can't paste folders + // Always paste folders const LLInventoryCategory *cat = model->getCategory(item_id); - if (cat) - { - return FALSE; - } + if (cat) continue; const LLInventoryItem *item = model->getItem(item_id); if (item) @@ -1313,7 +1307,6 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) } else if ("paste" == action) { - // Single item only LLInventoryItem* itemp = model->getItem(mUUID); if (!itemp) return; @@ -1785,8 +1778,9 @@ BOOL LLFolderBridge::isUpToDate() const BOOL LLFolderBridge::isItemCopyable() const { + return TRUE; // Can copy folders to paste-as-link, but not for straight paste. - return gSavedSettings.getBOOL("InventoryLinking"); + //return gSavedSettings.getBOOL("InventoryLinking"); } BOOL LLFolderBridge::isClipboardPasteable() const @@ -2829,7 +2823,7 @@ bool LLFolderBridge::removeItemResponse(const LLSD& notification, const LLSD& re void LLFolderBridge::pasteFromClipboard() { LLInventoryModel* model = getInventoryModel(); - if(model && isClipboardPasteable()) + if (model && isClipboardPasteable()) { const LLUUID ¤t_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false); const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); @@ -2845,7 +2839,8 @@ void LLFolderBridge::pasteFromClipboard() { const LLUUID& item_id = (*iter); LLInventoryItem *item = model->getItem(item_id); - if (item) + LLInventoryObject *obj = model->getObject(item_id); + if (obj) { if (move_is_into_current_outfit || move_is_into_outfit) { @@ -2856,24 +2851,49 @@ void LLFolderBridge::pasteFromClipboard() } else if (LLClipboard::getInstance()->isCutMode()) { - // move_inventory_item() is not enough, - //we have to update inventory locally too - LLViewerInventoryItem* viitem = dynamic_cast(item); - llassert(viitem); - if (viitem) + // Do a move to "paste" a "cut" + // move_inventory_item() is not enough, as we have to update inventory locally too + if (LLAssetType::AT_CATEGORY == obj->getType()) { - changeItemParent(model, viitem, parent_id, FALSE); + LLViewerInventoryCategory* vicat = (LLViewerInventoryCategory *) model->getCategory(item_id); + llassert(vicat); + if (vicat) + { + changeCategoryParent(model, vicat, parent_id, FALSE); + } + } + else + { + LLViewerInventoryItem* viitem = dynamic_cast(item); + llassert(viitem); + if (viitem) + { + changeItemParent(model, viitem, parent_id, FALSE); + } } } else { - copy_inventory_item( - gAgent.getID(), - item->getPermissions().getOwner(), - item->getUUID(), - parent_id, - std::string(), - LLPointer(NULL)); + // Do a "copy" to "paste" a regular copy clipboard + if (LLAssetType::AT_CATEGORY == obj->getType()) + { + LLViewerInventoryCategory* vicat = (LLViewerInventoryCategory *) model->getCategory(item_id); + llassert(vicat); + if (vicat) + { + copy_inventory_category(model, vicat, parent_id); + } + } + else + { + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + parent_id, + std::string(), + LLPointer(NULL)); + } } } } diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 9d12478019..808b7619eb 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -240,12 +240,26 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con //////////////////////////////////////////////////////////////////////////////// // FILTERTYPE_CLIPBOARD - // Pass if this item is not on the clipboard + // Pass if this item is not on the clipboard or is not a descendant of a folder + // which is on the clipboard if (filterTypes & FILTERTYPE_CLIPBOARD) { - if (LLClipboard::getInstance()->isCutMode() && LLClipboard::getInstance()->isOnClipboard(object_id)) + if (LLClipboard::getInstance()->isCutMode()) { - return FALSE; + LLUUID current_id = object_id; + LLInventoryObject *current_object = gInventory.getObject(object_id); + while (current_id.notNull()) + { + if (LLClipboard::getInstance()->isOnClipboard(current_id)) + { + return FALSE; + } + current_id = current_object->getParentUUID(); + if (current_id.notNull()) + { + current_object = gInventory.getObject(current_id); + } + } } } @@ -309,6 +323,31 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLInventoryItem* item) cons return false; } + //////////////////////////////////////////////////////////////////////////////// + // FILTERTYPE_CLIPBOARD + // Pass if this item is not on the clipboard or is not a descendant of a folder + // which is on the clipboard + if (filterTypes & FILTERTYPE_CLIPBOARD) + { + if (LLClipboard::getInstance()->isCutMode()) + { + LLUUID current_id = object_id; + LLInventoryObject *current_object = gInventory.getObject(object_id); + while (current_id.notNull()) + { + if (LLClipboard::getInstance()->isOnClipboard(current_id)) + { + return false; + } + current_id = current_object->getParentUUID(); + if (current_id.notNull()) + { + current_object = gInventory.getObject(current_id); + } + } + } + } + return true; } diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 8313b23f44..4fb06f82c1 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -238,6 +238,42 @@ void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::s model->notifyObservers(); } +void copy_inventory_category(LLInventoryModel* model, + LLViewerInventoryCategory* cat, + const LLUUID& parent_id) +{ + // Create the initial folder + LLUUID new_cat_uuid = gInventory.createNewCategory(parent_id, LLFolderType::FT_NONE, cat->getName()); + model->notifyObservers(); + + // Get the content of the folder + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(cat->getUUID(),cat_array,item_array); + + // Copy all the items + LLInventoryModel::item_array_t item_array_copy = *item_array; + for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++) + { + LLInventoryItem* item = *iter; + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + new_cat_uuid, + std::string(), + LLPointer(NULL)); + } + + // Copy all the folders + LLInventoryModel::cat_array_t cat_array_copy = *cat_array; + for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++) + { + LLViewerInventoryCategory* category = *iter; + copy_inventory_category(model, category, new_cat_uuid); + } +} + class LLInventoryCollectAllItems : public LLInventoryCollectFunctor { public: diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index f8ecca22b6..72c48c64f2 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -73,6 +73,8 @@ void remove_category(LLInventoryModel* model, const LLUUID& cat_id); void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name); +void copy_inventory_category(LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& parent_id); + // Generates a string containing the path to the item specified by item_id. void append_path(const LLUUID& id, std::string& path); -- cgit v1.2.3 From 5d276be881593b9e2c247edf8e6361447e964d52 Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Fri, 10 Feb 2012 20:36:53 +0200 Subject: EXP-1885 FIXED the crash when receiving multiple inventory offer notifications. Fixed erasing the iterator which was becoming invalid on recursive calls. --- indra/newview/llscreenchannel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 1045009a04..a0f146e506 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -327,8 +327,8 @@ void LLScreenChannel::onToastFade(LLToast* toast) bool delete_toast = !mCanStoreToasts || !toast->getCanBeStored(); if(delete_toast) { - deleteToast(toast); mToastList.erase(it); + deleteToast(toast); } else { -- cgit v1.2.3 From 788343db01ed4f6c0e786745d4f01bf6f5d2dba5 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 10 Feb 2012 10:56:55 -0800 Subject: * Added timers to track the http transactions, visible through the same "InventoryOutboxLogging" debug flag. --- indra/newview/llmarketplacefunctions.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index a3f0a6062c..93dd82957f 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -30,6 +30,7 @@ #include "llagent.h" #include "llhttpclient.h" +#include "lltimer.h" #include "lltrans.h" #include "llviewercontrol.h" #include "llviewermedia.h" @@ -115,6 +116,9 @@ namespace LLMarketplaceImport static U32 sImportResultStatus = 0; static LLSD sImportResults = LLSD::emptyMap(); + static LLTimer slmGetTimer; + static LLTimer slmPostTimer; + // Responders class LLImportPostResponder : public LLHTTPClient::Responder @@ -124,11 +128,15 @@ namespace LLMarketplaceImport void completed(U32 status, const std::string& reason, const LLSD& content) { + slmPostTimer.stop(); + if (gSavedSettings.getBOOL("InventoryOutboxLogging")) { llinfos << " SLM POST status: " << status << llendl; llinfos << " SLM POST reason: " << reason << llendl; llinfos << " SLM POST content: " << content.asString() << llendl; + + llinfos << " SLM POST timer: " << slmPostTimer.getElapsedTimeF32() << llendl; } if ((status == MarketplaceErrorCodes::IMPORT_REDIRECT) || @@ -167,11 +175,15 @@ namespace LLMarketplaceImport void completed(U32 status, const std::string& reason, const LLSD& content) { + slmGetTimer.stop(); + if (gSavedSettings.getBOOL("InventoryOutboxLogging")) { llinfos << " SLM GET status: " << status << llendl; llinfos << " SLM GET reason: " << reason << llendl; llinfos << " SLM GET content: " << content.asString() << llendl; + + llinfos << " SLM GET timer: " << slmGetTimer.getElapsedTimeF32() << llendl; } if ((status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR) || @@ -247,6 +259,7 @@ namespace LLMarketplaceImport llinfos << " SLM GET: " << url << llendl; } + slmGetTimer.start(); LLHTTPClient::get(url, new LLImportGetResponder(), LLViewerMedia::getHeaders()); return true; @@ -277,6 +290,7 @@ namespace LLMarketplaceImport llinfos << " SLM GET: " << url << llendl; } + slmGetTimer.start(); LLHTTPClient::get(url, new LLImportGetResponder(), headers); return true; @@ -310,6 +324,7 @@ namespace LLMarketplaceImport llinfos << " SLM POST: " << url << llendl; } + slmPostTimer.start(); LLHTTPClient::post(url, LLSD(), new LLImportPostResponder(), headers); return true; -- cgit v1.2.3 From 8d22adbbed589125c89ea8e28610816361615753 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 10 Feb 2012 14:28:16 -0600 Subject: SH-2963 Fix for highlight transparent not highlighting 100% transparent objects. --- indra/newview/lldrawpool.h | 1 + indra/newview/lldrawpoolalpha.cpp | 1 + indra/newview/llvovolume.cpp | 10 +++++++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h index 5a2981e749..64774d06df 100644 --- a/indra/newview/lldrawpool.h +++ b/indra/newview/lldrawpool.h @@ -133,6 +133,7 @@ public: PASS_ALPHA, PASS_ALPHA_MASK, PASS_FULLBRIGHT_ALPHA_MASK, + PASS_ALPHA_INVISIBLE, NUM_RENDER_TYPES, }; diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index ddb7d3ceeb..5b62dbc560 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -337,6 +337,7 @@ void LLDrawPoolAlpha::render(S32 pass) pushBatches(LLRenderPass::PASS_ALPHA_MASK, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE); pushBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE); + pushBatches(LLRenderPass::PASS_ALPHA_INVISIBLE, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE); if(shaders) { diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 6354230796..438d578ac5 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4433,10 +4433,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) else { if (te->getColor().mV[3] > 0.f) - { + { //only treat as alpha in the pipeline if < 100% transparent drawablep->setState(LLDrawable::HAS_ALPHA); - alpha_faces.push_back(facep); } + alpha_faces.push_back(facep); } } else @@ -4952,7 +4952,11 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: if (is_alpha) { // can we safely treat this as an alpha mask? - if (facep->canRenderAsMask()) + if (facep->getFaceColor().mV[3] <= 0.f) + { //100% transparent, don't render unless we're highlighting transparent + registerFace(group, facep, LLRenderPass::PASS_ALPHA_INVISIBLE); + } + else if (facep->canRenderAsMask()) { if (te->getFullbright() || LLPipeline::sNoAlpha) { -- cgit v1.2.3 From 077130eaee30883cb9e666584b3362e2481bd6dd Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 10 Feb 2012 14:28:16 -0600 Subject: SH-2963 Fix for highlight transparent not highlighting 100% transparent objects. --- indra/newview/lldrawpool.h | 1 + indra/newview/lldrawpoolalpha.cpp | 1 + indra/newview/llvovolume.cpp | 10 +++++++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h index 5a2981e749..64774d06df 100644 --- a/indra/newview/lldrawpool.h +++ b/indra/newview/lldrawpool.h @@ -133,6 +133,7 @@ public: PASS_ALPHA, PASS_ALPHA_MASK, PASS_FULLBRIGHT_ALPHA_MASK, + PASS_ALPHA_INVISIBLE, NUM_RENDER_TYPES, }; diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index ddb7d3ceeb..5b62dbc560 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -337,6 +337,7 @@ void LLDrawPoolAlpha::render(S32 pass) pushBatches(LLRenderPass::PASS_ALPHA_MASK, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE); pushBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE); + pushBatches(LLRenderPass::PASS_ALPHA_INVISIBLE, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, FALSE); if(shaders) { diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 7492a06784..03d4c51aff 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4433,10 +4433,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) else { if (te->getColor().mV[3] > 0.f) - { + { //only treat as alpha in the pipeline if < 100% transparent drawablep->setState(LLDrawable::HAS_ALPHA); - alpha_faces.push_back(facep); } + alpha_faces.push_back(facep); } } else @@ -4947,7 +4947,11 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: if (is_alpha) { // can we safely treat this as an alpha mask? - if (facep->canRenderAsMask()) + if (facep->getFaceColor().mV[3] <= 0.f) + { //100% transparent, don't render unless we're highlighting transparent + registerFace(group, facep, LLRenderPass::PASS_ALPHA_INVISIBLE); + } + else if (facep->canRenderAsMask()) { if (te->getFullbright() || LLPipeline::sNoAlpha) { -- cgit v1.2.3 From bb5797efd955cd6bd496a13104f6b84715afef06 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 10 Feb 2012 12:41:20 -0800 Subject: Resized the Merchant Outbox spinner to its native size --- indra/newview/skins/default/xui/en/floater_merchant_outbox.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml index 498a9b6ce0..6f387f4800 100644 --- a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml +++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml @@ -132,16 +132,16 @@ - - + + - + + width="24" /> -- cgit v1.2.3 From e0f86bfb2d85c8dd3c84b6a56fa42aae431f6fe3 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 10 Feb 2012 16:41:24 -0500 Subject: STORM-1793 Supply missing new artwork --- .../skins/default/textures/map_avatar_unknown_32.tga | Bin 0 -> 4140 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 indra/newview/skins/default/textures/map_avatar_unknown_32.tga diff --git a/indra/newview/skins/default/textures/map_avatar_unknown_32.tga b/indra/newview/skins/default/textures/map_avatar_unknown_32.tga new file mode 100644 index 0000000000..d1192478c6 Binary files /dev/null and b/indra/newview/skins/default/textures/map_avatar_unknown_32.tga differ -- cgit v1.2.3 From 6c3d44449032e386c2b4163c3635f1fe6934e5d7 Mon Sep 17 00:00:00 2001 From: callum Date: Fri, 10 Feb 2012 14:02:09 -0800 Subject: EXP-1889 FIX As a Second Life viewer developer, I would like a tool that helps me find memory leaks. --- indra/cmake/VisualLeakDetector.cmake | 15 +++++++ indra/newview/CMakeLists.txt | 1 + indra/newview/app_settings/settings.xml | 35 ++++++++++------ indra/newview/llappviewerwin32.cpp | 12 ++++++ indra/newview/llviewermenu.cpp | 47 +++++++++++++++++++++- indra/newview/skins/default/xui/en/menu_viewer.xml | 10 ++++- 6 files changed, 106 insertions(+), 14 deletions(-) create mode 100644 indra/cmake/VisualLeakDetector.cmake diff --git a/indra/cmake/VisualLeakDetector.cmake b/indra/cmake/VisualLeakDetector.cmake new file mode 100644 index 0000000000..d3ba554e46 --- /dev/null +++ b/indra/cmake/VisualLeakDetector.cmake @@ -0,0 +1,15 @@ +# -*- cmake -*- + +if (VIEWER) + + set(INCLUDE_VLD_CMAKE OFF CACHE BOOL "Build the Windows viewer with Visual Leak Detector turned on or off") + + if (INCLUDE_VLD_CMAKE) + + if (WINDOWS) + add_definitions(-DINCLUDE_VLD=1) + endif (WINDOWS) + + endif (INCLUDE_VLD_CMAKE) + +endif (VIEWER) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 69bf1f15a1..66361c8fbf 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -41,6 +41,7 @@ include(UnixInstall) include(LLKDU) include(ViewerMiscLibs) include(LLLogin) +include(VisualLeakDetector) include(GLOD) include(CMakeCopyIfDifferent) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index ee8c15752b..caeaf71484 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9619,18 +9619,29 @@ Value 1 - ShowConsoleWindow - - Comment - Show log in separate OS window - Persist - 1 - Type - Boolean - Value - 0 - - NavBarShowCoordinates + ShowConsoleWindow + + Comment + Show log in separate OS window + Persist + 1 + Type + Boolean + Value + 0 + + EnableVisualLeakDetector + + Comment + EnableVisualLeakDetector + Persist + 1 + Type + Boolean + Value + 0 + + NavBarShowCoordinates Comment Show coordinates in navigation bar diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 6931b55c4c..bad60a9757 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -26,6 +26,10 @@ #include "llviewerprecompiledheaders.h" +#ifdef INCLUDE_VLD +#include "vld.h" +#endif + #include "llappviewerwin32.h" #include "llmemtype.h" @@ -105,6 +109,14 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) { +#ifdef INCLUDE_VLD + // only works for debug builds (hard coded into vld.h) + #ifdef _DEBUG + // start with Visual Leak Detector turned off + VLDGlobalDisable(); + #endif // _DEBUG +#endif // INCLUDE_VLD + LLMemType mt1(LLMemType::MTYPE_STARTUP); const S32 MAX_HEAPS = 255; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 12aed8f448..37cf916423 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -25,6 +25,11 @@ */ #include "llviewerprecompiledheaders.h" + +#ifdef INCLUDE_VLD +#include "vld.h" +#endif + #include "llviewermenu.h" // linden library includes @@ -214,7 +219,7 @@ void near_sit_down_point(BOOL success, void *); void velocity_interpolate( void* ); - +void handle_visual_leak_detector_toggle(void*); void handle_rebake_textures(void*); BOOL check_admin_override(void*); void handle_admin_override_toggle(void*); @@ -2018,6 +2023,15 @@ class LLAdvancedToggleViewAdminOptions : public view_listener_t } }; +class LLAdvancedToggleVisualLeakDetector : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + handle_visual_leak_detector_toggle(NULL); + return true; + } +}; + class LLAdvancedCheckViewAdminOptions : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -3444,6 +3458,35 @@ void handle_admin_override_toggle(void*) show_debug_menus(); } +void handle_visual_leak_detector_toggle(void*) +{ + static bool vld_enabled = false; + + if ( vld_enabled ) + { +#ifdef INCLUDE_VLD + // only works for debug builds (hard coded into vld.h) +#ifdef _DEBUG + // start with Visual Leak Detector turned off + VLDDisable(); +#endif // _DEBUG +#endif // INCLUDE_VLD + vld_enabled = false; + } + else + { +#ifdef INCLUDE_VLD + // only works for debug builds (hard coded into vld.h) + #ifdef _DEBUG + // start with Visual Leak Detector turned off + VLDEnable(); + #endif // _DEBUG +#endif // INCLUDE_VLD + + vld_enabled = true; + }; +} + void handle_god_mode(void*) { gAgent.requestEnterGodMode(); @@ -8237,6 +8280,8 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedEnableViewAdminOptions(), "Advanced.EnableViewAdminOptions"); view_listener_t::addMenu(new LLAdvancedToggleViewAdminOptions(), "Advanced.ToggleViewAdminOptions"); view_listener_t::addMenu(new LLAdvancedCheckViewAdminOptions(), "Advanced.CheckViewAdminOptions"); + view_listener_t::addMenu(new LLAdvancedToggleVisualLeakDetector(), "Advanced.ToggleVisualLeakDetector"); + view_listener_t::addMenu(new LLAdvancedRequestAdminStatus(), "Advanced.RequestAdminStatus"); view_listener_t::addMenu(new LLAdvancedLeaveAdminStatus(), "Advanced.LeaveAdminStatus"); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index cd8550b00d..6443e432fe 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -3261,7 +3261,15 @@ - + + + + Date: Fri, 10 Feb 2012 16:35:22 -0800 Subject: EXP-1884 FIX Errors in navigating text when editing Landmarks and picks once a vertical scrollbar is shown --- indra/llui/lltextbase.cpp | 10 +++++----- indra/llui/llview.cpp | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 35abe48510..15c2d4946c 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1192,7 +1192,7 @@ void LLTextBase::reflow() // shrink document to minimum size (visible portion of text widget) // to force inlined widgets with follows set to shrink - mDocumentView->reshape(mVisibleTextRect.getWidth(), mDocumentView->getRect().getHeight()); + //mDocumentView->reshape(mVisibleTextRect.getWidth(), mDocumentView->getRect().getHeight()); S32 cur_top = 0; @@ -2380,7 +2380,8 @@ S32 LLTextBase::getEditableIndex(S32 index, bool increasing_direction) void LLTextBase::updateRects() { - mVisibleTextRect = getLocalRect(); + LLRect old_text_rect = mVisibleTextRect; + mVisibleTextRect = mScroller ? mScroller->getContentWindowRect() : getLocalRect(); if (mLineInfoList.empty()) { @@ -2403,10 +2404,10 @@ void LLTextBase::updateRects() switch(mVAlign) { case LLFontGL::TOP: - delta_pos = llmax(mVisibleTextRect.mTop - mTextBoundingRect.mTop, -mTextBoundingRect.mBottom); + delta_pos = llmax(mVisibleTextRect.getHeight() - mTextBoundingRect.mTop, -mTextBoundingRect.mBottom); break; case LLFontGL::VCENTER: - delta_pos = (llmax(mVisibleTextRect.mTop - mTextBoundingRect.mTop, -mTextBoundingRect.mBottom) + (mVisibleTextRect.mBottom - mTextBoundingRect.mBottom)) / 2; + delta_pos = (llmax(mVisibleTextRect.getHeight() - mTextBoundingRect.mTop, -mTextBoundingRect.mBottom) + (mVisibleTextRect.mBottom - mTextBoundingRect.mBottom)) / 2; break; case LLFontGL::BOTTOM: delta_pos = mVisibleTextRect.mBottom - mTextBoundingRect.mBottom; @@ -2459,7 +2460,6 @@ void LLTextBase::updateRects() //update mVisibleTextRect *after* mDocumentView has been resized // so that scrollbars are added if document needs to scroll // since mVisibleTextRect does not include scrollbars - LLRect old_text_rect = mVisibleTextRect; mVisibleTextRect = mScroller ? mScroller->getContentWindowRect() : getLocalRect(); //FIXME: replace border with image? if (mBorderVisible) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index d22e14745f..421166dcd4 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1300,7 +1300,10 @@ void LLView::reshape(S32 width, S32 height, BOOL called_from_parent) S32 delta_x = child_rect.mLeft - viewp->getRect().mLeft; S32 delta_y = child_rect.mBottom - viewp->getRect().mBottom; viewp->translate( delta_x, delta_y ); - viewp->reshape(child_rect.getWidth(), child_rect.getHeight()); + if (child_rect.getWidth() != viewp->getRect().getWidth() || child_rect.getHeight() != viewp->getRect().getHeight()) + { + viewp->reshape(child_rect.getWidth(), child_rect.getHeight()); + } } } -- cgit v1.2.3 From 3710c6110d65d3a604f7b419cd764cf5b9b98600 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 10 Feb 2012 20:04:19 -0600 Subject: SH-2908 Rework indexed texture rendering to use a uvec4 instead of a float for texture indices in the data stream. Also rework gl_FragColor overrides to not collide with some odd driver implementations. --- indra/llrender/llgl.cpp | 62 ++++++++++++++- indra/llrender/llgl.h | 2 + indra/llrender/llglheaders.h | 3 + indra/llrender/llglslshader.cpp | 5 +- indra/llrender/llshadermgr.cpp | 92 ++++++++++------------ indra/llrender/llvertexbuffer.cpp | 46 +++++++++-- .../shaders/class1/avatar/pickAvatarF.glsl | 6 +- .../shaders/class1/deferred/alphaF.glsl | 6 +- .../shaders/class1/deferred/alphaNonIndexedF.glsl | 10 ++- .../class1/deferred/alphaNonIndexedNoColorF.glsl | 6 +- .../shaders/class1/deferred/attachmentShadowF.glsl | 8 +- .../shaders/class1/deferred/avatarF.glsl | 10 ++- .../shaders/class1/deferred/avatarShadowF.glsl | 6 +- .../shaders/class1/deferred/blurLightF.glsl | 6 +- .../shaders/class1/deferred/bumpF.glsl | 12 +-- .../shaders/class1/deferred/cloudsF.glsl | 10 ++- .../app_settings/shaders/class1/deferred/cofF.glsl | 8 +- .../shaders/class1/deferred/diffuseAlphaMaskF.glsl | 10 ++- .../class1/deferred/diffuseAlphaMaskIndexedF.glsl | 10 ++- .../class1/deferred/diffuseAlphaMaskNoColorF.glsl | 10 ++- .../shaders/class1/deferred/diffuseF.glsl | 12 +-- .../shaders/class1/deferred/diffuseIndexedF.glsl | 12 +-- .../shaders/class1/deferred/dofCombineF.glsl | 6 +- .../shaders/class1/deferred/emissiveF.glsl | 6 +- .../shaders/class1/deferred/fullbrightF.glsl | 6 +- .../shaders/class1/deferred/fxaaF.glsl | 6 +- .../app_settings/shaders/class1/deferred/giF.glsl | 6 +- .../app_settings/shaders/class1/deferred/giV.glsl | 48 ----------- .../shaders/class1/deferred/impostorF.glsl | 10 ++- .../shaders/class1/deferred/luminanceF.glsl | 6 +- .../shaders/class1/deferred/multiPointLightF.glsl | 8 +- .../shaders/class1/deferred/multiSpotLightF.glsl | 8 +- .../shaders/class1/deferred/normgenF.glsl | 6 +- .../shaders/class1/deferred/pointLightF.glsl | 8 +- .../shaders/class1/deferred/postDeferredF.glsl | 6 +- .../class1/deferred/postDeferredNoDoFF.glsl | 6 +- .../shaders/class1/deferred/postgiF.glsl | 8 +- .../shaders/class1/deferred/postgiV.glsl | 40 ---------- .../shaders/class1/deferred/shadowAlphaMaskF.glsl | 6 +- .../shaders/class1/deferred/shadowF.glsl | 6 +- .../app_settings/shaders/class1/deferred/skyF.glsl | 10 ++- .../shaders/class1/deferred/softenLightF.glsl | 8 +- .../shaders/class1/deferred/spotLightF.glsl | 8 +- .../shaders/class1/deferred/starsF.glsl | 10 ++- .../shaders/class1/deferred/sunLightF.glsl | 6 +- .../shaders/class1/deferred/sunLightSSAOF.glsl | 12 +-- .../shaders/class1/deferred/terrainF.glsl | 10 ++- .../shaders/class1/deferred/treeF.glsl | 10 ++- .../shaders/class1/deferred/treeShadowF.glsl | 6 +- .../shaders/class1/deferred/waterF.glsl | 10 ++- .../shaders/class1/effects/glowExtractF.glsl | 8 +- .../app_settings/shaders/class1/effects/glowF.glsl | 6 +- .../shaders/class1/environment/terrainF.glsl | 6 +- .../shaders/class1/environment/terrainWaterF.glsl | 6 +- .../shaders/class1/environment/underWaterF.glsl | 6 +- .../shaders/class1/environment/waterF.glsl | 6 +- .../shaders/class1/interface/alphamaskF.glsl | 6 +- .../shaders/class1/interface/customalphaF.glsl | 6 +- .../shaders/class1/interface/debugF.glsl | 6 +- .../shaders/class1/interface/glowcombineF.glsl | 6 +- .../shaders/class1/interface/glowcombineFXAAF.glsl | 6 +- .../shaders/class1/interface/highlightF.glsl | 6 +- .../shaders/class1/interface/occlusionF.glsl | 6 +- .../class1/interface/onetexturenocolorF.glsl | 6 +- .../shaders/class1/interface/solidcolorF.glsl | 6 +- .../class1/interface/splattexturerectF.glsl | 6 +- .../shaders/class1/interface/twotextureaddF.glsl | 6 +- .../app_settings/shaders/class1/interface/uiF.glsl | 6 +- .../shaders/class1/lighting/lightAlphaMaskF.glsl | 6 +- .../class1/lighting/lightAlphaMaskNonIndexedF.glsl | 6 +- .../shaders/class1/lighting/lightF.glsl | 6 +- .../class1/lighting/lightFullbrightAlphaMaskF.glsl | 6 +- .../shaders/class1/lighting/lightFullbrightF.glsl | 6 +- .../lightFullbrightNonIndexedAlphaMaskF.glsl | 6 +- .../lighting/lightFullbrightNonIndexedF.glsl | 6 +- .../class1/lighting/lightFullbrightShinyF.glsl | 6 +- .../lighting/lightFullbrightShinyNonIndexedF.glsl | 6 +- .../lighting/lightFullbrightShinyWaterF.glsl | 6 +- .../lightFullbrightShinyWaterNonIndexedF.glsl | 6 +- .../lighting/lightFullbrightWaterAlphaMaskF.glsl | 6 +- .../class1/lighting/lightFullbrightWaterF.glsl | 6 +- .../lightFullbrightWaterNonIndexedAlphaMaskF.glsl | 6 +- .../lighting/lightFullbrightWaterNonIndexedF.glsl | 6 +- .../shaders/class1/lighting/lightNonIndexedF.glsl | 6 +- .../shaders/class1/lighting/lightShinyF.glsl | 6 +- .../class1/lighting/lightShinyNonIndexedF.glsl | 6 +- .../shaders/class1/lighting/lightShinyWaterF.glsl | 6 +- .../lighting/lightShinyWaterNonIndexedF.glsl | 6 +- .../class1/lighting/lightWaterAlphaMaskF.glsl | 6 +- .../lighting/lightWaterAlphaMaskNonIndexedF.glsl | 6 +- .../shaders/class1/lighting/lightWaterF.glsl | 8 +- .../class1/lighting/lightWaterNonIndexedF.glsl | 6 +- .../app_settings/shaders/class1/objects/bumpF.glsl | 6 +- .../shaders/class1/objects/impostorF.glsl | 6 +- .../shaders/class1/objects/indexedTextureV.glsl | 4 +- .../shaders/class2/deferred/alphaF.glsl | 6 +- .../shaders/class2/deferred/alphaNonIndexedF.glsl | 6 +- .../class2/deferred/alphaNonIndexedNoColorF.glsl | 6 +- .../shaders/class2/deferred/multiSpotLightF.glsl | 8 +- .../shaders/class2/deferred/softenLightF.glsl | 8 +- .../shaders/class2/deferred/spotLightF.glsl | 8 +- .../shaders/class2/deferred/sunLightF.glsl | 18 +++-- .../shaders/class2/deferred/sunLightSSAOF.glsl | 18 +++-- .../shaders/class2/windlight/cloudsF.glsl | 8 +- .../shaders/class2/windlight/skyF.glsl | 8 +- indra/newview/llface.cpp | 12 ++- indra/newview/llviewershadermgr.cpp | 14 ++-- indra/newview/llvovolume.cpp | 6 +- 108 files changed, 624 insertions(+), 412 deletions(-) delete mode 100644 indra/newview/app_settings/shaders/class1/deferred/giV.glsl delete mode 100644 indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 946e602fee..79d4415117 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -97,6 +97,8 @@ void APIENTRY gl_debug_callback(GLenum source, } #endif +void parse_glsl_version(S32& major, S32& minor); + void ll_init_fail_log(std::string filename) { gFailLog.open(filename.c_str()); @@ -295,6 +297,7 @@ PFNGLGETACTIVEUNIFORMARBPROC glGetActiveUniformARB = NULL; PFNGLGETUNIFORMFVARBPROC glGetUniformfvARB = NULL; PFNGLGETUNIFORMIVARBPROC glGetUniformivARB = NULL; PFNGLGETSHADERSOURCEARBPROC glGetShaderSourceARB = NULL; +PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer = NULL; #if LL_WINDOWS PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = NULL; @@ -341,6 +344,7 @@ PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB = NULL; PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB = NULL; PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB = NULL; PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB = NULL; +PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer = NULL; PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB = NULL; PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB = NULL; PFNGLPROGRAMSTRINGARBPROC glProgramStringARB = NULL; @@ -443,7 +447,8 @@ LLGLManager::LLGLManager() : mDriverVersionMinor(0), mDriverVersionRelease(0), mGLVersion(1.0f), - + mGLSLVersionMajor(0), + mGLSLVersionMinor(0), mVRAM(0), mGLMaxVertexRange(0), mGLMaxIndexRange(0) @@ -554,6 +559,11 @@ bool LLGLManager::initGL() mGLVersion = mDriverVersionMajor + mDriverVersionMinor * .1f; + if (mGLVersion >= 2.f) + { + parse_glsl_version(mGLSLVersionMajor, mGLSLVersionMinor); + } + // Trailing space necessary to keep "nVidia Corpor_ati_on" cards // from being recognized as ATI. if (mGLVendor.substr(0,4) == "ATI ") @@ -1300,6 +1310,7 @@ void LLGLManager::initExtensions() glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC) GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4uivARB"); glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC) GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib4usvARB"); glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC) GLH_EXT_GET_PROC_ADDRESS("glVertexAttribPointerARB"); + glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC) GLH_EXT_GET_PROC_ADDRESS("glVertexAttribIPointer"); glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC) GLH_EXT_GET_PROC_ADDRESS("glEnableVertexAttribArrayARB"); glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) GLH_EXT_GET_PROC_ADDRESS("glDisableVertexAttribArrayARB"); glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC) GLH_EXT_GET_PROC_ADDRESS("glProgramStringARB"); @@ -2098,6 +2109,55 @@ void parse_gl_version( S32* major, S32* minor, S32* release, std::string* vendor } } + +void parse_glsl_version(S32& major, S32& minor) +{ + // GL_SHADING_LANGUAGE_VERSION returns a null-terminated string with the format: + // .[.] [] + + const char* version = (const char*) glGetString(GL_SHADING_LANGUAGE_VERSION); + major = 0; + minor = 0; + + if( !version ) + { + return; + } + + std::string ver_copy( version ); + S32 len = (S32)strlen( version ); /* Flawfinder: ignore */ + S32 i = 0; + S32 start; + // Find the major version + start = i; + for( ; i < len; i++ ) + { + if( '.' == version[i] ) + { + break; + } + } + std::string major_str = ver_copy.substr(start,i-start); + LLStringUtil::convertToS32(major_str, major); + + if( '.' == version[i] ) + { + i++; + } + + // Find the minor version + start = i; + for( ; i < len; i++ ) + { + if( ('.' == version[i]) || isspace(version[i]) ) + { + break; + } + } + std::string minor_str = ver_copy.substr(start,i-start); + LLStringUtil::convertToS32(minor_str, minor); +} + LLGLUserClipPlane::LLGLUserClipPlane(const LLPlane& p, const glh::matrix4f& modelview, const glh::matrix4f& projection, bool apply) { mApply = apply; diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index 6a147b8e19..5a33c98708 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -138,6 +138,8 @@ public: S32 mDriverVersionMinor; S32 mDriverVersionRelease; F32 mGLVersion; // e.g = 1.4 + S32 mGLSLVersionMajor; + S32 mGLSLVersionMinor; std::string mDriverVersionVendorString; S32 mVRAM; // VRAM in MB diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index 10aad202e1..d61ec707f0 100644 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -199,6 +199,7 @@ extern PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB; extern PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB; extern PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB; extern PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB; +extern PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer; extern PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB; extern PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB; extern PFNGLPROGRAMSTRINGARBPROC glProgramStringARB; @@ -460,6 +461,7 @@ extern PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB; extern PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB; extern PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB; extern PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB; +extern PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer; extern PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB; extern PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB; extern PFNGLPROGRAMSTRINGARBPROC glProgramStringARB; @@ -693,6 +695,7 @@ extern PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB; extern PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB; extern PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB; extern PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB; +extern PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer; extern PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB; extern PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB; extern PFNGLPROGRAMSTRINGARBPROC glProgramStringARB; diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 7eba62e59e..a879a18895 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -164,8 +164,9 @@ BOOL LLGLSLShader::createShader(vector * attributes, return FALSE; } - if (gGLManager.mGLVersion < 3.1f) - { //attachShaderFeatures may have set the number of indexed texture channels, so set to 1 again + if (gGLManager.mGLSLVersionMajor < 2 && gGLManager.mGLSLVersionMinor < 3) + { //indexed texture rendering requires GLSL 1.3 or later + //attachShaderFeatures may have set the number of indexed texture channels, so set to 1 again mFeatures.mIndexedTextureChannels = llmin(mFeatures.mIndexedTextureChannels, 1); } diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index d03d349f0f..321b139181 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -575,31 +575,39 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade GLcharARB* text[4096]; GLuint count = 0; - F32 version = gGLManager.mGLVersion; - -//hack to never use GLSL > 1.20 on OSX -#if LL_DARWIN - version = llmin(version, 2.9f); -#endif - - if (version < 2.1f) - { - text[count++] = strdup("#version 110\n"); - text[count++] = strdup("#define ATTRIBUTE attribute\n"); - text[count++] = strdup("#define VARYING varying\n"); - } - else if (version < 3.3f) + S32 major_version = gGLManager.mGLSLVersionMajor; + S32 minor_version = gGLManager.mGLSLVersionMinor; + + if (major_version == 1 && minor_version < 30) { - //set version to 1.20 - text[count++] = strdup("#version 120\n"); - text[count++] = strdup("#define FXAA_GLSL_120 1\n"); - text[count++] = strdup("#define FXAA_FAST_PIXEL_OFFSET 0\n"); - text[count++] = strdup("#define ATTRIBUTE attribute\n"); - text[count++] = strdup("#define VARYING varying\n"); + if (minor_version < 10) + { + //should NEVER get here -- if major version is 1 and minor version is less than 10, + // viewer should never attempt to use shaders, continuing will result in undefined behavior + llerrs << "Unsupported GLSL Version." << llendl; + } + + if (minor_version <= 19) + { + text[count++] = strdup("#version 110\n"); + text[count++] = strdup("#define ATTRIBUTE attribute\n"); + text[count++] = strdup("#define VARYING varying\n"); + text[count++] = strdup("#define VARYING_FLAT varying\n"); + } + else if (minor_version <= 29) + { + //set version to 1.20 + text[count++] = strdup("#version 120\n"); + text[count++] = strdup("#define FXAA_GLSL_120 1\n"); + text[count++] = strdup("#define FXAA_FAST_PIXEL_OFFSET 0\n"); + text[count++] = strdup("#define ATTRIBUTE attribute\n"); + text[count++] = strdup("#define VARYING varying\n"); + text[count++] = strdup("#define VARYING_FLAT varying\n"); + } } else { - if (version < 4.f) + if (major_version < 4) { //set version to 1.30 text[count++] = strdup("#version 130\n"); @@ -618,13 +626,17 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade { //"varying" state is "out" in a vertex program, "in" in a fragment program // ("varying" is deprecated after version 1.20) text[count++] = strdup("#define VARYING out\n"); + text[count++] = strdup("#define VARYING_FLAT flat out\n"); } else { text[count++] = strdup("#define VARYING in\n"); + text[count++] = strdup("#define VARYING_FLAT flat in\n"); } //backwards compatibility with legacy texture lookup syntax + text[count++] = strdup("#define texture2D texture\n"); + text[count++] = strdup("#define texture2DRect texture\n"); text[count++] = strdup("#define textureCube texture\n"); text[count++] = strdup("#define texture2DLod textureLod\n"); text[count++] = strdup("#define shadow2D(a,b) vec2(texture(a,b))\n"); @@ -651,11 +663,11 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade . uniform sampler2D texN; - VARYING float vary_texture_index; + VARYING uvec4 vary_texture_index; vec4 diffuseLookup(vec2 texcoord) { - switch (int(vary_texture_index+0.25)) + switch (vary_texture_index.r)) { case 0: return texture2D(tex0, texcoord); case 1: return texture2D(tex1, texcoord); @@ -679,7 +691,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade if (texture_index_channels > 1) { - text[count++] = strdup("VARYING float vary_texture_index;\n"); + text[count++] = strdup("VARYING_FLAT uvec4 vary_texture_index;\n"); } text[count++] = strdup("vec4 diffuseLookup(vec2 texcoord)\n"); @@ -691,9 +703,9 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade text[count++] = strdup("return texture2D(tex0, texcoord);\n"); text[count++] = strdup("}\n"); } - else if (gGLManager.mGLVersion >= 3.f) - { - text[count++] = strdup("\tswitch (int(vary_texture_index+0.25))\n"); + else if (major_version > 1 || minor_version >= 30) + { //switches are supported in GLSL 1.30 and later + text[count++] = strdup("\tswitch (vary_texture_index.r)\n"); text[count++] = strdup("\t{\n"); //switch body @@ -708,28 +720,10 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade text[count++] = strdup("}\n"); } else - { - //switches aren't supported, make block that looks like: - /* - int ti = int(vary_texture_index+0.25); - if (ti == 0) return texture2D(tex0, texcoord); - if (ti == 1) return texture2D(tex1, texcoord); - . - . - . - if (ti == N) return texture2D(texN, texcoord); - */ - - text[count++] = strdup("int ti = int(vary_texture_index+0.25);\n"); - for (S32 i = 0; i < texture_index_channels; ++i) - { - std::string if_str = llformat("if (ti == %d) return texture2D(tex%d, texcoord);\n", i, i); - text[count++] = strdup(if_str.c_str()); - } - - text[count++] = strdup("\treturn vec4(1,0,1,1);\n"); - text[count++] = strdup("}\n"); - } + { //should never get here. Indexed texture rendering requires GLSL 1.30 or later + // (for passing integers between vertex and fragment shaders) + llerrs << "Indexed texture rendering requires GLSL 1.30 or later." << llendl; + } } //copy file into memory diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index e4a5cd0299..b2438ef824 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -284,6 +284,12 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask) { bool error = false; + if (gGLManager.mGLSLVersionMajor < 2 && gGLManager.mGLSLVersionMinor < 30) + { + //make sure texture index is disabled + data_mask = data_mask & ~MAP_TEXTURE_INDEX; + } + if (LLGLSLShader::sNoFixedFunction) { for (U32 i = 0; i < TYPE_MAX; ++i) @@ -1193,7 +1199,7 @@ void LLVertexBuffer::setupVertexArray() 1, //TYPE_WEIGHT, 4, //TYPE_WEIGHT4, 4, //TYPE_CLOTHWEIGHT, - 1, //TYPE_TEXTURE_INDEX + 4, //TYPE_TEXTURE_INDEX }; U32 attrib_type[] = @@ -1210,7 +1216,24 @@ void LLVertexBuffer::setupVertexArray() GL_FLOAT, //TYPE_WEIGHT, GL_FLOAT, //TYPE_WEIGHT4, GL_FLOAT, //TYPE_CLOTHWEIGHT, - GL_FLOAT, //TYPE_TEXTURE_INDEX + GL_UNSIGNED_BYTE, //TYPE_TEXTURE_INDEX + }; + + bool attrib_integer[] = + { + false, //TYPE_VERTEX, + false, //TYPE_NORMAL, + false, //TYPE_TEXCOORD0, + false, //TYPE_TEXCOORD1, + false, //TYPE_TEXCOORD2, + false, //TYPE_TEXCOORD3, + false, //TYPE_COLOR, + false, //TYPE_EMISSIVE, + false, //TYPE_BINORMAL, + false, //TYPE_WEIGHT, + false, //TYPE_WEIGHT4, + false, //TYPE_CLOTHWEIGHT, + true, //TYPE_TEXTURE_INDEX }; U32 attrib_normalized[] = @@ -1238,7 +1261,19 @@ void LLVertexBuffer::setupVertexArray() if (mTypeMask & (1 << i)) { glEnableVertexAttribArrayARB(i); - glVertexAttribPointerARB(i, attrib_size[i], attrib_type[i], attrib_normalized[i], sTypeSize[i], (void*) mOffsets[i]); + + if (attrib_integer) + { + //glVertexattribIPointer requires GLSL 1.30 or later + if (gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 30) + { + glVertexAttribIPointer(i, attrib_size[i], attrib_type[i], sTypeSize[i], (void*) mOffsets[i]); + } + } + else + { + glVertexAttribPointerARB(i, attrib_size[i], attrib_type[i], attrib_normalized[i], sTypeSize[i], (void*) mOffsets[i]); + } } else { @@ -2220,11 +2255,12 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) void* ptr = (void*)(base + mOffsets[TYPE_CLOTHWEIGHT]); glVertexAttribPointerARB(loc, 4, GL_FLOAT, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], ptr); } - if (data_mask & MAP_TEXTURE_INDEX) + if (data_mask & MAP_TEXTURE_INDEX && + (gGLManager.mGLSLVersionMajor >= 2 || gGLManager.mGLSLVersionMinor >= 30)) //indexed texture rendering requires GLSL 1.30 or later { S32 loc = TYPE_TEXTURE_INDEX; void *ptr = (void*) (base + mOffsets[TYPE_VERTEX] + 12); - glVertexAttribPointerARB(loc, 1, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], ptr); + glVertexAttribIPointer(loc, 4, GL_UNSIGNED_BYTE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], ptr); } if (data_mask & MAP_VERTEX) { diff --git a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl index 3e4d438ed3..54e2f04459 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -34,5 +36,5 @@ uniform sampler2D diffuseMap; void main() { - gl_FragColor = vec4(vertex_color.rgb, texture2D(diffuseMap, vary_texcoord0.xy).a); + frag_color = vec4(vertex_color.rgb, texture2D(diffuseMap, vary_texcoord0.xy).a); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index c012efa056..37fd63b7d5 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRect depthMap; @@ -69,6 +71,6 @@ void main() color.rgb += diff.rgb * vary_pointlight_col.rgb; - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl index 8641827777..14ac9f1f78 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRect depthMap; @@ -81,9 +83,9 @@ void main() color.rgb += diff.rgb * vary_pointlight_col.rgb; - gl_FragColor = color; - //gl_FragColor = vec4(1,0,1,1); - //gl_FragColor = vec4(1,0,1,1)*shadow; + frag_color = color; + //frag_color = vec4(1,0,1,1); + //frag_color = vec4(1,0,1,1)*shadow; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl index c13ea702db..654e272b06 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRect depthMap; @@ -79,6 +81,6 @@ void main() color.rgb += diff.rgb * vary_pointlight_col.rgb; - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl index 402f681631..b88041490a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl @@ -23,7 +23,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2D diffuseMap; @@ -33,7 +35,7 @@ VARYING vec2 vary_texcoord0; void main() { - //gl_FragColor = vec4(1,1,1,vertex_color.a * texture2D(diffuseMap, vary_texcoord0.xy).a); - gl_FragColor = vec4(1,1,1,1); + //frag_color = vec4(1,1,1,vertex_color.a * texture2D(diffuseMap, vary_texcoord0.xy).a); + frag_color = vec4(1,1,1,1); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl index 9a3b2e3e8a..4912c9a50c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragData[3]; +out vec4 frag_data[3]; +#else +#define frag_data gl_FragData; #endif uniform sampler2D diffuseMap; @@ -41,9 +43,9 @@ void main() discard; } - gl_FragData[0] = vec4(diff.rgb, 0.0); - gl_FragData[1] = vec4(0,0,0,0); + frag_data[0] = vec4(diff.rgb, 0.0); + frag_data[1] = vec4(0,0,0,0); vec3 nvn = normalize(vary_normal); - gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); + frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl index 558a88009a..594ed778e3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2D diffuseMap; @@ -33,7 +35,7 @@ VARYING vec4 post_pos; void main() { - gl_FragColor = vec4(1,1,1,1); + frag_color = vec4(1,1,1,1); gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl index 60d4dae99f..a08b018702 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRect depthMap; @@ -111,6 +113,6 @@ void main() col /= defined_weight.xyxx; col.y *= col.y; - gl_FragColor = col; + frag_color = col; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl index 6cc5f23aca..141738023d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragData[3]; +out vec4 frag_data[3]; +#else +#define frag_data gl_FragData; #endif uniform sampler2D diffuseMap; @@ -46,9 +48,9 @@ void main() dot(norm,vary_mat1), dot(norm,vary_mat2)); - gl_FragData[0] = vec4(col, 0.0); - gl_FragData[1] = vertex_color.aaaa; // spec - //gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested + frag_data[0] = vec4(col, 0.0); + frag_data[1] = vertex_color.aaaa; // spec + //frag_data[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested vec3 nvn = normalize(tnorm); - gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); + frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl index db272cf601..d2afc148b1 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl @@ -25,7 +25,9 @@ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragData[3]; +out vec4 frag_data[3]; +#else +#define frag_data gl_FragData; #endif ///////////////////////////////////////////////////////////////////////// @@ -98,8 +100,8 @@ void main() color *= 2.; /// Gamma correct for WL (soft clip effect). - gl_FragData[0] = vec4(scaleSoftClip(color.rgb), alpha1); - gl_FragData[1] = vec4(0.0,0.0,0.0,0.0); - gl_FragData[2] = vec4(0,0,1,0); + frag_data[0] = vec4(scaleSoftClip(color.rgb), alpha1); + frag_data[1] = vec4(0.0,0.0,0.0,0.0); + frag_data[2] = vec4(0,0,1,0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl index e612efba61..3fcfbf55c4 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRect diffuseRect; @@ -83,6 +85,6 @@ void main() sc = max(sc, -max_cof); vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res); - gl_FragColor.rgb = diff.rgb + bloom.rgb; - gl_FragColor.a = sc/max_cof*0.5+0.5; + frag_color.rgb = diff.rgb + bloom.rgb; + frag_color.a = sc/max_cof*0.5+0.5; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl index e9989a4e48..c8acaee134 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragData[3]; +out vec4 frag_data[3]; +#else +#define frag_data gl_FragData; #endif uniform float minimum_alpha; @@ -44,9 +46,9 @@ void main() discard; } - gl_FragData[0] = vec4(col.rgb, 0.0); - gl_FragData[1] = vec4(0,0,0,0); // spec + frag_data[0] = vec4(col.rgb, 0.0); + frag_data[1] = vec4(0,0,0,0); // spec vec3 nvn = normalize(vary_normal); - gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); + frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl index fdf8d72b38..d960cbc2fe 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragData[3]; +out vec4 frag_data[3]; +#else +#define frag_data gl_FragData; #endif VARYING vec3 vary_normal; @@ -43,8 +45,8 @@ void main() discard; } - gl_FragData[0] = vec4(col.rgb, 0.0); - gl_FragData[1] = vec4(0,0,0,0); + frag_data[0] = vec4(col.rgb, 0.0); + frag_data[1] = vec4(0,0,0,0); vec3 nvn = normalize(vary_normal); - gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); + frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl index bb20e2ca47..b1c9b52569 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl @@ -25,7 +25,9 @@ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragData[3]; +out vec4 frag_data[3]; +#else +#define frag_data gl_FragData; #endif uniform float minimum_alpha; @@ -44,9 +46,9 @@ void main() discard; } - gl_FragData[0] = vec4(col.rgb, 0.0); - gl_FragData[1] = vec4(0,0,0,0); // spec + frag_data[0] = vec4(col.rgb, 0.0); + frag_data[1] = vec4(0,0,0,0); // spec vec3 nvn = normalize(vary_normal); - gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); + frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl index 7bde49eb86..caefe84957 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragData[3]; +out vec4 frag_data[3]; +#else +#define frag_data gl_FragData; #endif uniform sampler2D diffuseMap; @@ -36,10 +38,10 @@ VARYING vec2 vary_texcoord0; void main() { vec3 col = vertex_color.rgb * texture2D(diffuseMap, vary_texcoord0.xy).rgb; - gl_FragData[0] = vec4(col, 0.0); - gl_FragData[1] = vertex_color.aaaa; // spec - //gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested + frag_data[0] = vec4(col, 0.0); + frag_data[1] = vertex_color.aaaa; // spec + //frag_data[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested vec3 nvn = normalize(vary_normal); - gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); + frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl index 75b45111e0..c89f389954 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragData[3]; +out vec4 frag_data[3]; +#else +#define frag_data gl_FragData; #endif VARYING vec3 vary_normal; @@ -35,9 +37,9 @@ void main() { vec3 col = vertex_color.rgb * diffuseLookup(vary_texcoord0.xy).rgb; - gl_FragData[0] = vec4(col, 0.0); - gl_FragData[1] = vertex_color.aaaa; // spec - //gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested + frag_data[0] = vec4(col, 0.0); + frag_data[1] = vertex_color.aaaa; // spec + //frag_data[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested vec3 nvn = normalize(vary_normal); - gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); + frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl index 0cf5afc568..f05ea557e3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRect diffuseRect; @@ -73,5 +75,5 @@ void main() diff = mix(diff, col*0.25, a); } - gl_FragColor = mix(diff, dof, a); + frag_color = mix(diff, dof, a); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl index 92f78125d8..ebe9a66bb4 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif vec3 fullbrightAtmosTransport(vec3 light); @@ -45,6 +47,6 @@ void main() color.rgb = fullbrightScaleSoftClip(color.rgb); - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl index 84ae2f9f10..616ffca2d1 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -46,6 +48,6 @@ void main() color.rgb = fullbrightScaleSoftClip(color.rgb); - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl index 5af9406452..76b1748813 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif #define FXAA_PC 1 @@ -2113,6 +2115,6 @@ void main() //diff = texture2D(diffuseMap, vary_tc); - gl_FragColor = diff; + frag_color = diff; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl index 29ca80ae92..28ed70d49d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/giF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/giF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRect depthMap; @@ -184,5 +186,5 @@ void main() vec3 norm = texture2DRect(normalMap, pos_screen).xyz; norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - gl_FragColor.xyz = giAmbient(pos, norm); + frag_color.xyz = giAmbient(pos, norm); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/giV.glsl b/indra/newview/app_settings/shaders/class1/deferred/giV.glsl deleted file mode 100644 index e5d3bb8ea6..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/giV.glsl +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @file giV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat4 modelview_projection_matrix; - -ATTRIBUTE vec3 position; -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec2 texcoord0; - -VARYING vec4 vertex_color; -VARYING vec2 vary_fragcoord; - -uniform vec2 screen_res; - -void main() -{ - //transform vertex - vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0); - gl_Position = pos; - - vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res; - vec4 tex = vec4(texcoord0,0,1); - tex.w = 1.0; - - vertex_color = diffuse_color; -} diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl index a44173a2a4..d7bc8d02d9 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragData[3]; +out vec4 frag_data[3]; +#else +#define frag_data gl_FragData; #endif uniform float minimum_alpha; @@ -45,7 +47,7 @@ void main() discard; } - gl_FragData[0] = vec4(col.rgb, col.a * 0.005); - gl_FragData[1] = texture2D(specularMap, vary_texcoord0.xy); - gl_FragData[2] = vec4(texture2D(normalMap, vary_texcoord0.xy).xyz, 0.0); + frag_data[0] = vec4(col.rgb, col.a * 0.005); + frag_data[1] = texture2D(specularMap, vary_texcoord0.xy); + frag_data[2] = vec4(texture2D(normalMap, vary_texcoord0.xy).xyz, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl index e014a14ad8..31da124cb1 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl @@ -26,12 +26,14 @@ uniform sampler2DRect diffuseMap; #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec2 vary_fragcoord; void main() { - gl_FragColor = texture2DRect(diffuseMap, vary_fragcoord.xy); + frag_color = texture2DRect(diffuseMap, vary_fragcoord.xy); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl index 179c721a2f..cd50e17d7e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRect depthMap; @@ -141,6 +143,6 @@ void main() discard; } - gl_FragColor.rgb = out_col; - gl_FragColor.a = 0.0; + frag_color.rgb = out_col; + frag_color.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 2196d14895..40dd363061 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif //class 1 -- no shadows @@ -242,6 +244,6 @@ void main() } } - gl_FragColor.rgb = col; - gl_FragColor.a = 0.0; + frag_color.rgb = col; + frag_color.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl b/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl index 879942d8fa..32881ef042 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2D alphaMap; @@ -52,5 +54,5 @@ void main() norm *= 0.5; norm += 0.5; - gl_FragColor = vec4(norm, alpha); + frag_color = vec4(norm, alpha); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl index b673d00d6e..619b7bcd03 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRect diffuseRect; @@ -118,6 +120,6 @@ void main() discard; } - gl_FragColor.rgb = col; - gl_FragColor.a = 0.0; + frag_color.rgb = col; + frag_color.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl index 18d451bf87..e7b2174280 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRect diffuseRect; @@ -122,5 +124,5 @@ void main() diff /= w; } - gl_FragColor = diff; + frag_color = diff; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl index c275434777..ed2352b51f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRect diffuseRect; @@ -40,6 +42,6 @@ void main() vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy); vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res); - gl_FragColor = diff + bloom; + frag_color = diff + bloom; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl index 84d65d5b3b..18550b2e12 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl @@ -24,8 +24,10 @@ */ #ifdef DEFINE_GL_FRAGCOLOR - out vec4 gl_FragColor; - #endif +out vec4 frag_color; +#else +#define frag_color gl_FragColor; +#endif uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; @@ -96,5 +98,5 @@ void main() col = col*col*blur_quad.x + col*blur_quad.y + blur_quad.z; - gl_FragColor.rgb = col; + frag_color.rgb = col; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl deleted file mode 100644 index 0d5c8e7287..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @file postgiV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat4 modelview_projection_matrix; - -ATTRIBUTE vec3 position; - - -VARYING vec2 vary_fragcoord; -uniform vec2 screen_res; - -void main() -{ - //transform vertex - vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0); - gl_Position = pos; - vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; -} diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl index c1fb7b55d4..7d75b50aa2 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform float minimum_alpha; @@ -44,7 +46,7 @@ void main() discard; } - gl_FragColor = vec4(1,1,1,1); + frag_color = vec4(1,1,1,1); gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl index bf75ca262e..3eb733aa51 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl @@ -24,14 +24,16 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 post_pos; void main() { - gl_FragColor = vec4(1,1,1,1); + frag_color = vec4(1,1,1,1); gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl index 96ad0aa93a..7d80f07da4 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragData[3]; +out vec4 frag_data[3]; +#else +#define frag_data gl_FragData; #endif ///////////////////////////////////////////////////////////////////////// @@ -57,8 +59,8 @@ void main() color *= 2.; /// Gamma correct for WL (soft clip effect). - gl_FragData[0] = vec4(scaleSoftClip(color.rgb), 1.0); - gl_FragData[1] = vec4(0.0,0.0,0.0,0.0); - gl_FragData[2] = vec4(0,0,1,0); + frag_data[0] = vec4(scaleSoftClip(color.rgb), 1.0); + frag_data[1] = vec4(0.0,0.0,0.0,0.0); + frag_data[2] = vec4(0,0,1,0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 0c53a4ffa5..70b0f6fbd0 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRect diffuseRect; @@ -322,7 +324,7 @@ void main() col = diffuse.rgb; } - gl_FragColor.rgb = col; + frag_color.rgb = col; - gl_FragColor.a = bloom; + frag_color.a = bloom; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index cc0f4e5b6b..d3d6a155f0 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -27,7 +27,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRect diffuseRect; @@ -184,6 +186,6 @@ void main() } } - gl_FragColor.rgb = col; - gl_FragColor.a = 0.0; + frag_color.rgb = col; + frag_color.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl index 03fccd2766..1cfcca4f5d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragData[3]; +out vec4 frag_data[3]; +#else +#define frag_data gl_FragData; #endif VARYING vec4 vertex_color; @@ -36,7 +38,7 @@ void main() { vec4 col = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy); - gl_FragData[0] = col; - gl_FragData[1] = vec4(0,0,0,0); - gl_FragData[2] = vec4(0,0,1,0); + frag_data[0] = col; + frag_data[1] = vec4(0,0,0,0); + frag_data[2] = vec4(0,0,1,0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl index adc7c5d005..aa29be09a1 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl @@ -28,10 +28,12 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif void main() { - gl_FragColor = vec4(0,0,0,0); + frag_color = vec4(0,0,0,0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl index fc5959a33c..9bee632472 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif //class 1 -- no shadow, SSAO only @@ -128,8 +130,8 @@ void main() vec3 norm = texture2DRect(normalMap, pos_screen).xyz; norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - gl_FragColor[0] = 1.0; - gl_FragColor[1] = calcAmbientOcclusion(pos, norm); - gl_FragColor[2] = 1.0; - gl_FragColor[3] = 1.0; + frag_color[0] = 1.0; + frag_color[1] = calcAmbientOcclusion(pos, norm); + frag_color[2] = 1.0; + frag_color[3] = 1.0; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl index 5522e6c41d..021c23f76c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragData[3]; +out vec4 frag_data[3]; +#else +#define frag_data gl_FragData; #endif uniform sampler2D detail_0; @@ -51,9 +53,9 @@ void main() float alphaFinal = texture2D(alpha_ramp, vary_texcoord1.zw).a; vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal ); - gl_FragData[0] = vec4(outColor.rgb, 0.0); - gl_FragData[1] = vec4(0,0,0,0); + frag_data[0] = vec4(outColor.rgb, 0.0); + frag_data[1] = vec4(0,0,0,0); vec3 nvn = normalize(vary_normal); - gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); + frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl index ea98d6884c..10d8a5c321 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragData[3]; +out vec4 frag_data[3]; +#else +#define frag_data gl_FragData; #endif uniform sampler2D diffuseMap; @@ -43,8 +45,8 @@ void main() discard; } - gl_FragData[0] = vec4(vertex_color.rgb*col.rgb, 0.0); - gl_FragData[1] = vec4(0,0,0,0); + frag_data[0] = vec4(vertex_color.rgb*col.rgb, 0.0); + frag_data[1] = vec4(0,0,0,0); vec3 nvn = normalize(vary_normal); - gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); + frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl index 20d0170535..6be66a402f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform float minimum_alpha; @@ -43,7 +45,7 @@ void main() discard; } - gl_FragColor = vec4(1,1,1,1); + frag_color = vec4(1,1,1,1); gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index 4c9ea24a24..e4c655ed7d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragData[3]; +out vec4 frag_data[3]; +#else +#define frag_data gl_FragData; #endif vec3 scaleSoftClip(vec3 inColor); @@ -157,7 +159,7 @@ void main() //wavef = normalize(wavef); vec3 screenspacewavef = (norm_mat*vec4(wavef, 1.0)).xyz; - gl_FragData[0] = vec4(color.rgb, 0.5); // diffuse - gl_FragData[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec - gl_FragData[2] = vec4(screenspacewavef.xy*0.5+0.5, screenspacewavef.z, screenspacewavef.z*0.5); // normalxyz, displace + frag_data[0] = vec4(color.rgb, 0.5); // diffuse + frag_data[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec + frag_data[2] = vec4(screenspacewavef.xy*0.5+0.5, screenspacewavef.z, screenspacewavef.z*0.5); // normalxyz, displace } diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl index 9a3d792224..952706841d 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRect diffuseMap; @@ -46,7 +48,7 @@ void main() float lum = smoothstep(minLuminance, minLuminance+1.0, dot(col.rgb, lumWeights ) ); float warmth = smoothstep(minLuminance, minLuminance+1.0, max(col.r * warmthWeights.r, max(col.g * warmthWeights.g, col.b * warmthWeights.b)) ); - gl_FragColor.rgb = col.rgb; - gl_FragColor.a = max(col.a, mix(lum, warmth, warmthAmount) * maxExtractAlpha); + frag_color.rgb = col.rgb; + frag_color.a = max(col.a, mix(lum, warmth, warmthAmount) * maxExtractAlpha); } diff --git a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl index 90bb84323c..289c5b367f 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2D diffuseMap; @@ -54,5 +56,5 @@ void main() col += kern[6] * texture2D(diffuseMap, vary_texcoord2.zw); col += kern[7] * texture2D(diffuseMap, vary_texcoord3.zw); - gl_FragColor = vec4(col.rgb * glowStrength, col.a); + frag_color = vec4(col.rgb * glowStrength, col.a); } diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl index 18f6d91804..51efdd4b39 100644 --- a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -59,6 +61,6 @@ void main() /// Add WL Components outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb); - gl_FragColor = vec4(scaleSoftClip(outColor.rgb), 1.0); + frag_color = vec4(scaleSoftClip(outColor.rgb), 1.0); } diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl index e5c7ced52c..d9b5c5f7f5 100644 --- a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -60,6 +62,6 @@ void main() outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb); outColor = applyWaterFog(outColor); - gl_FragColor = outColor; + frag_color = outColor; } diff --git a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl index 1fdb90f792..32459eff6a 100644 --- a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2D diffuseMap; @@ -106,5 +108,5 @@ void main() vec4 fb = texture2D(screenTex, distort); - gl_FragColor = applyWaterFog(fb,view.xyz); + frag_color = applyWaterFog(fb,view.xyz); } diff --git a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl index 444c896d38..0cde7d0133 100644 --- a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif vec3 scaleSoftClip(vec3 inColor); @@ -135,5 +137,5 @@ void main() color.rgb = scaleSoftClip(color.rgb); color.a = spec * sunAngle2; - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl index d2f5e1987a..e8b8513bd1 100644 --- a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2D diffuseMap; @@ -42,5 +44,5 @@ void main() discard; } - gl_FragColor = col; + frag_color = col; } diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl index 4b481ba834..b990ce9f03 100644 --- a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2D diffuseMap; @@ -38,5 +40,5 @@ void main() { vec4 color = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy); color.a *= custom_alpha; - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl index 6bcc97ba18..ad05f17a30 100644 --- a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl @@ -24,12 +24,14 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform vec4 color; void main() { - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl index f67703b839..7e4515db40 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif #extension GL_ARB_texture_rectangle : enable @@ -37,6 +39,6 @@ VARYING vec2 vary_texcoord1; void main() { - gl_FragColor = texture2D(glowMap, vary_texcoord0.xy) + + frag_color = texture2D(glowMap, vary_texcoord0.xy) + texture2DRect(screenMap, vary_texcoord1.xy); } diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl index c66a6e5b48..5a5894523d 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRect diffuseRect; @@ -38,5 +40,5 @@ void main() { vec3 col = texture2DRect(diffuseRect, vary_tc*screen_res).rgb; - gl_FragColor = vec4(col.rgb, dot(col.rgb, vec3(0.299, 0.587, 0.144))); + frag_color = vec4(col.rgb, dot(col.rgb, vec3(0.299, 0.587, 0.144))); } diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl index ecbc30f05f..d1d140d2a6 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform vec4 color; @@ -34,5 +36,5 @@ VARYING vec2 vary_texcoord0; void main() { - gl_FragColor = color*texture2D(diffuseMap, vary_texcoord0.xy); + frag_color = color*texture2D(diffuseMap, vary_texcoord0.xy); } diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl index 85f819f4c2..a18a3cdb50 100644 --- a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl @@ -24,10 +24,12 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif void main() { - gl_FragColor = vec4(1,1,1,1); + frag_color = vec4(1,1,1,1); } diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl index fafeb5a7b4..bfaa4774d9 100644 --- a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2D tex0; @@ -33,5 +35,5 @@ VARYING vec2 vary_texcoord0; void main() { - gl_FragColor = texture2D(tex0, vary_texcoord0.xy); + frag_color = texture2D(tex0, vary_texcoord0.xy); } diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl index f790122749..5d7edf33a9 100644 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2D tex0; @@ -36,5 +38,5 @@ void main() { float alpha = texture2D(tex0, vary_texcoord0.xy).a * vertex_color.a; - gl_FragColor = vec4(vertex_color.rgb, alpha); + frag_color = vec4(vertex_color.rgb, alpha); } diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl index a0bb255cfa..7a28ca847a 100644 --- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRect screenMap; @@ -36,5 +38,5 @@ VARYING vec2 vary_texcoord0; void main() { - gl_FragColor = texture2DRect(screenMap, vary_texcoord0.xy) * vertex_color; + frag_color = texture2DRect(screenMap, vary_texcoord0.xy) * vertex_color; } diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl index cdb48163dd..73a5839028 100644 --- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2D tex0; @@ -35,5 +37,5 @@ VARYING vec2 vary_texcoord1; void main() { - gl_FragColor = texture2D(tex0, vary_texcoord0.xy)+texture2D(tex1, vary_texcoord1.xy); + frag_color = texture2D(tex0, vary_texcoord0.xy)+texture2D(tex1, vary_texcoord1.xy); } diff --git a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl index 36d6e06fc5..8fac2862b1 100644 --- a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2D diffuseMap; @@ -34,5 +36,5 @@ VARYING vec4 vertex_color; void main() { - gl_FragColor = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy); + frag_color = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl index 10413bdeb0..aabff3196a 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform float minimum_alpha; @@ -48,6 +50,6 @@ void default_lighting() color.rgb = scaleSoftClip(color.rgb); - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl index 1164e5b0a6..6e6aec8532 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform float minimum_alpha; @@ -50,6 +52,6 @@ void default_lighting() color.rgb = scaleSoftClip(color.rgb); - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl index 735f5b3813..f9a3eb8d90 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -41,6 +43,6 @@ void default_lighting() color.rgb = scaleSoftClip(color.rgb); - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl index ba99c0ed71..a3eb133133 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform float minimum_alpha; @@ -48,6 +50,6 @@ void fullbright_lighting() color.rgb = fullbrightScaleSoftClip(color.rgb); - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl index c3edc0bd70..222c6bbf0e 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -41,6 +43,6 @@ void fullbright_lighting() color.rgb = fullbrightScaleSoftClip(color.rgb); - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl index 276fad4f44..441fcd0d7a 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform float minimum_alpha; @@ -50,6 +52,6 @@ void fullbright_lighting() color.rgb = fullbrightScaleSoftClip(color.rgb); - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl index 4e1e664e6b..7020fbc72b 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -43,6 +45,6 @@ void fullbright_lighting() color.rgb = fullbrightScaleSoftClip(color.rgb); - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl index c981e9eba2..889a3e48ba 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -50,6 +52,6 @@ void fullbright_shiny_lighting() color.a = max(color.a, vertex_color.a); - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl index a4893f0359..f0727c377b 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -51,6 +53,6 @@ void fullbright_shiny_lighting() color.a = max(color.a, vertex_color.a); - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl index c10cde98e0..aac13462b3 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl @@ -23,7 +23,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -48,6 +50,6 @@ void fullbright_shiny_lighting_water() color.rgb = fullbrightScaleSoftClip(color.rgb); color.a = max(color.a, vertex_color.a); - gl_FragColor = applyWaterFog(color); + frag_color = applyWaterFog(color); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl index e9b26087f4..4f57b7a9f5 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl @@ -23,7 +23,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -49,6 +51,6 @@ void fullbright_shiny_lighting_water() color.rgb = fullbrightScaleSoftClip(color.rgb); color.a = max(color.a, vertex_color.a); - gl_FragColor = applyWaterFog(color); + frag_color = applyWaterFog(color); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl index 754b2922d9..6c277cddc1 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform float minimum_alpha; @@ -48,6 +50,6 @@ void fullbright_lighting_water() color.rgb = fullbrightAtmosTransport(color.rgb); - gl_FragColor = applyWaterFog(color); + frag_color = applyWaterFog(color); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl index 2547f9e750..5c4bedefcc 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -41,6 +43,6 @@ void fullbright_lighting_water() color.rgb = fullbrightAtmosTransport(color.rgb); - gl_FragColor = applyWaterFog(color); + frag_color = applyWaterFog(color); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl index f69b907dc7..df07071236 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform float minimum_alpha; @@ -48,6 +50,6 @@ void fullbright_lighting_water() color.rgb = fullbrightAtmosTransport(color.rgb); - gl_FragColor = applyWaterFog(color); + frag_color = applyWaterFog(color); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl index aa3ef8cdd9..91208bc56a 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -41,6 +43,6 @@ void fullbright_lighting_water() color.rgb = fullbrightAtmosTransport(color.rgb); - gl_FragColor = applyWaterFog(color); + frag_color = applyWaterFog(color); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl index 9f1a358b53..1a0473b9e2 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -43,6 +45,6 @@ void default_lighting() color.rgb = scaleSoftClip(color.rgb); - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl index e9c27dbefd..a24d8d4ecd 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -49,6 +51,6 @@ void shiny_lighting() color.rgb = scaleSoftClip(color.rgb); color.a = max(color.a, vertex_color.a); - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl index 595ad74365..16f64633ac 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -50,6 +52,6 @@ void shiny_lighting() color.rgb = scaleSoftClip(color.rgb); color.a = max(color.a, vertex_color.a); - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl index 68c727d62c..cf78149733 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -46,6 +48,6 @@ void shiny_lighting_water() color.rgb = atmosLighting(color.rgb); color.a = max(color.a, vertex_color.a); - gl_FragColor = applyWaterFog(color); + frag_color = applyWaterFog(color); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl index f32b9e1958..97531fd937 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -47,6 +49,6 @@ void shiny_lighting_water() color.rgb = atmosLighting(color.rgb); color.a = max(color.a, vertex_color.a); - gl_FragColor = applyWaterFog(color); + frag_color = applyWaterFog(color); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl index 103dd633c9..4fcdad09fc 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform float minimum_alpha; @@ -46,6 +48,6 @@ void default_lighting_water() color.rgb = atmosLighting(color.rgb); - gl_FragColor = applyWaterFog(color); + frag_color = applyWaterFog(color); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl index bef72752da..d235ed2491 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform float minimum_alpha; @@ -50,6 +52,6 @@ void default_lighting_water() color = applyWaterFog(color); - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl index e9537d1e9d..c295579028 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl @@ -24,8 +24,10 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif +out vec4 frag_color; +#else +#define frag_color gl_FragColor; +#endif VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; @@ -39,6 +41,6 @@ void default_lighting_water() color.rgb = atmosLighting(color.rgb); - gl_FragColor = applyWaterFog(color); + frag_color = applyWaterFog(color); } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl index 8b0c25b705..5a5cc2c821 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -41,6 +43,6 @@ void default_lighting_water() color.rgb = atmosLighting(color.rgb); - gl_FragColor = applyWaterFog(color); + frag_color = applyWaterFog(color); } diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl index 4b85d61aca..df6130cc58 100644 --- a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2D texture0; @@ -38,5 +40,5 @@ void main() float tex0 = texture2D(texture0, vary_texcoord0.xy).a; float tex1 = texture2D(texture1, vary_texcoord1.xy).a; - gl_FragColor = vec4(tex0+(1.0-tex1)-0.5); + frag_color = vec4(tex0+(1.0-tex1)-0.5); } diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl index 3c6e22b295..6358fdfeae 100644 --- a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform float minimum_alpha; @@ -42,5 +44,5 @@ void main() discard; } - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl b/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl index a95c9e0ab9..a0f513d73d 100644 --- a/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl @@ -23,9 +23,9 @@ * $/LicenseInfo$ */ -ATTRIBUTE float texture_index; +ATTRIBUTE uvec4 texture_index; -VARYING float vary_texture_index; +VARYING_FLAT uvec4 vary_texture_index; void passTextureIndex() { diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index 1179b212ae..373a6c157b 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -125,6 +127,6 @@ void main() color.rgb += diff.rgb * vary_pointlight_col.rgb; - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl index 0df557f2aa..04460ea7c0 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRectShadow shadowMap0; @@ -138,6 +140,6 @@ void main() color.rgb += diff.rgb * vary_pointlight_col.rgb; - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl index 331dbc7079..c50145f753 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRectShadow shadowMap0; @@ -137,6 +139,6 @@ void main() color.rgb += diff.rgb * vary_pointlight_col.rgb; - gl_FragColor = color; + frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 14a683971a..7d78a888a5 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRect diffuseRect; @@ -253,6 +255,6 @@ void main() } } - gl_FragColor.rgb = col; - gl_FragColor.a = 0.0; + frag_color.rgb = col; + frag_color.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 27ea77b5a2..f73163898e 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2DRect diffuseRect; @@ -330,6 +332,6 @@ void main() col = diffuse.rgb; } - gl_FragColor.rgb = col; - gl_FragColor.a = bloom; + frag_color.rgb = col; + frag_color.a = bloom; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 31bd0c79da..7cc621b1f6 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -201,6 +203,6 @@ void main() } } - gl_FragColor.rgb = col; - gl_FragColor.a = 0.0; + frag_color.rgb = col; + frag_color.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index 229c2f4b67..a92a9fc8e8 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif //class 2, shadows, no SSAO @@ -129,7 +131,7 @@ void main() /*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL { - gl_FragColor = vec4(0.0); // doesn't matter + frag_color = vec4(0.0); // doesn't matter return; }*/ @@ -198,19 +200,19 @@ void main() shadow = 1.0; } - gl_FragColor[0] = shadow; - gl_FragColor[1] = 1.0; + frag_color[0] = shadow; + frag_color[1] = 1.0; spos = vec4(shadow_pos+norm*spot_shadow_offset, 1.0); //spotlight shadow 1 vec4 lpos = shadow_matrix[4]*spos; - gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.8); + frag_color[2] = pcfShadow(shadowMap4, lpos, 0.8); //spotlight shadow 2 lpos = shadow_matrix[5]*spos; - gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.8); + frag_color[3] = pcfShadow(shadowMap5, lpos, 0.8); - //gl_FragColor.rgb = pos.xyz; - //gl_FragColor.b = shadow; + //frag_color.rgb = pos.xyz; + //frag_color.b = shadow; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl index 6b420833b9..45b8db5adc 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -25,7 +25,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif //class 2 -- shadows and SSAO @@ -190,7 +192,7 @@ void main() /*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL { - gl_FragColor = vec4(0.0); // doesn't matter + frag_color = vec4(0.0); // doesn't matter return; }*/ @@ -259,19 +261,19 @@ void main() shadow = 1.0; } - gl_FragColor[0] = shadow; - gl_FragColor[1] = calcAmbientOcclusion(pos, norm); + frag_color[0] = shadow; + frag_color[1] = calcAmbientOcclusion(pos, norm); spos = vec4(shadow_pos+norm*spot_shadow_offset, 1.0); //spotlight shadow 1 vec4 lpos = shadow_matrix[4]*spos; - gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.8); + frag_color[2] = pcfShadow(shadowMap4, lpos, 0.8); //spotlight shadow 2 lpos = shadow_matrix[5]*spos; - gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.8); + frag_color[3] = pcfShadow(shadowMap5, lpos, 0.8); - //gl_FragColor.rgb = pos.xyz; - //gl_FragColor.b = shadow; + //frag_color.rgb = pos.xyz; + //frag_color.b = shadow; } diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl index 4ab06c6e21..c8d89095d8 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif ///////////////////////////////////////////////////////////////////////// @@ -96,7 +98,7 @@ void main() color *= 2.; /// Gamma correct for WL (soft clip effect). - gl_FragColor.rgb = scaleSoftClip(color.rgb); - gl_FragColor.a = alpha1; + frag_color.rgb = scaleSoftClip(color.rgb); + frag_color.a = alpha1; } diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl index c9d96b2cf4..4aece6e032 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif ///////////////////////////////////////////////////////////////////////// @@ -57,7 +59,7 @@ void main() color *= 2.; /// Gamma correct for WL (soft clip effect). - gl_FragColor.rgb = scaleSoftClip(color.rgb); - gl_FragColor.a = 1.0; + frag_color.rgb = scaleSoftClip(color.rgb); + frag_color.a = 1.0; } diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index cd33a19a2a..838e541145 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1742,14 +1742,22 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, LLVector4a texIdx; - F32 index = (F32) (mTextureIndex < 255 ? mTextureIndex : 0); + U8 index = mTextureIndex < 255 ? mTextureIndex : 0; + + F32 val = 0.f; + U8* vp = (U8*) &val; + vp[0] = index; + vp[1] = 0; + vp[2] = 0; + vp[3] = 0; + llassert(index <= LLGLSLShader::sIndexedTextureChannels-1); LLVector4Logical mask; mask.clear(); mask.setElement<3>(); - texIdx.set(0,0,0,index); + texIdx.set(0,0,0,val); { LLFastTimer t(FTM_FACE_POSITION_STORE); diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 6db2138688..36a402e05e 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -416,6 +416,7 @@ void LLViewerShaderMgr::setShaders() LLGLSLShader::sNoFixedFunction = false; LLVertexBuffer::unbind(); if (LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable") + && (gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 10) && gSavedSettings.getBOOL("VertexShaderEnable")) { //using shaders, disable fixed function @@ -741,7 +742,10 @@ BOOL LLViewerShaderMgr::loadBasicShaders() shaders.push_back( make_pair( "windlight/atmosphericsV.glsl", mVertexShaderLevel[SHADER_WINDLIGHT] ) ); shaders.push_back( make_pair( "avatar/avatarSkinV.glsl", 1 ) ); shaders.push_back( make_pair( "avatar/objectSkinV.glsl", 1 ) ); - shaders.push_back( make_pair( "objects/indexedTextureV.glsl", 1 ) ); + if (gGLManager.mGLSLVersionMajor >= 2 || gGLManager.mGLSLVersionMinor >= 30) + { + shaders.push_back( make_pair( "objects/indexedTextureV.glsl", 1 ) ); + } shaders.push_back( make_pair( "objects/nonindexedTextureV.glsl", 1 ) ); // We no longer have to bind the shaders to global glhandles, they are automatically added to a map now. @@ -758,11 +762,11 @@ BOOL LLViewerShaderMgr::loadBasicShaders() // (in order of shader function call depth for reference purposes, deepest level first) shaders.clear(); - S32 ch = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1); + S32 ch = 1; - if (gGLManager.mGLVersion < 3.1f) - { //force to 1 texture index channel for old drivers - ch = 1; + if (gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 30) + { //use indexed texture rendering for GLSL >= 1.30 + ch = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1); } std::vector index_channels; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 6354230796..4d50a920d9 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4714,11 +4714,11 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: buffer_index = -1; } - S32 texture_index_channels = LLGLSLShader::sIndexedTextureChannels-1; //always reserve one for shiny for now just for simplicity + S32 texture_index_channels = 1; - if (gGLManager.mGLVersion < 3.1f) + if (gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 30) { - texture_index_channels = 1; + texture_index_channels = LLGLSLShader::sIndexedTextureChannels-1; //always reserve one for shiny for now just for simplicity; } if (LLPipeline::sRenderDeferred && distance_sort) -- cgit v1.2.3 From d245dad7ddbac36b013c70326ad25eb9247784f6 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 10 Feb 2012 18:05:07 -0800 Subject: EXP-1863 : Fix the filtering of cut folders, also fix the move to trash of folders in double cut scenarios --- indra/newview/llfolderview.cpp | 13 ++++++- indra/newview/llinventoryfilter.cpp | 77 +++++++++++++------------------------ indra/newview/llinventoryfilter.h | 5 +-- indra/newview/llinventorypanel.cpp | 3 +- 4 files changed, 42 insertions(+), 56 deletions(-) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 51a5839b75..0abfa9db8e 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -1028,7 +1028,18 @@ void LLFolderView::removeCutItems() ++iter) { const LLUUID& item_id = (*iter); - remove_item(&gInventory, item_id); + LLInventoryObject *obj = gInventory.getObject(item_id); + if (obj) + { + if (LLAssetType::AT_CATEGORY == obj->getType()) + { + remove_category(&gInventory, item_id); + } + else + { + remove_item(&gInventory, item_id); + } + } } } diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 808b7619eb..f3d4667034 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -97,13 +97,16 @@ BOOL LLInventoryFilter::check(const LLFolderViewItem* item) } mSubStringMatchOffset = mFilterSubString.size() ? item->getSearchableLabel().find(mFilterSubString) : std::string::npos; + const LLFolderViewEventListener* listener = item->getListener(); const BOOL passed_filtertype = checkAgainstFilterType(item); const BOOL passed_permissions = checkAgainstPermissions(item); const BOOL passed_filterlink = checkAgainstFilterLinks(item); + const BOOL passed_clipboard = (listener ? checkAgainstClipboard(listener->getUUID()) : TRUE); const BOOL passed = (passed_filtertype && passed_permissions && passed_filterlink && + passed_clipboard && (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos)); return passed; @@ -115,8 +118,10 @@ bool LLInventoryFilter::check(const LLInventoryItem* item) const bool passed_filtertype = checkAgainstFilterType(item); const bool passed_permissions = checkAgainstPermissions(item); + const BOOL passed_clipboard = checkAgainstClipboard(item->getUUID()); const bool passed = (passed_filtertype && passed_permissions && + passed_clipboard && (mFilterSubString.size() == 0 || mSubStringMatchOffset != std::string::npos)); return passed; @@ -145,7 +150,10 @@ bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder) return false; } - return true; + // Always check against the clipboard + const BOOL passed_clipboard = checkAgainstClipboard(folder_id); + + return passed_clipboard; } BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) const @@ -238,31 +246,6 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con } } - //////////////////////////////////////////////////////////////////////////////// - // FILTERTYPE_CLIPBOARD - // Pass if this item is not on the clipboard or is not a descendant of a folder - // which is on the clipboard - if (filterTypes & FILTERTYPE_CLIPBOARD) - { - if (LLClipboard::getInstance()->isCutMode()) - { - LLUUID current_id = object_id; - LLInventoryObject *current_object = gInventory.getObject(object_id); - while (current_id.notNull()) - { - if (LLClipboard::getInstance()->isOnClipboard(current_id)) - { - return FALSE; - } - current_id = current_object->getParentUUID(); - if (current_id.notNull()) - { - current_object = gInventory.getObject(current_id); - } - } - } - } - return TRUE; } @@ -323,31 +306,30 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLInventoryItem* item) cons return false; } - //////////////////////////////////////////////////////////////////////////////// - // FILTERTYPE_CLIPBOARD - // Pass if this item is not on the clipboard or is not a descendant of a folder - // which is on the clipboard - if (filterTypes & FILTERTYPE_CLIPBOARD) + return true; +} + +// Items and folders that are on the clipboard or, recursively, in a folder which +// is on the clipboard must be filtered out if the clipboard is in the "cut" mode. +bool LLInventoryFilter::checkAgainstClipboard(const LLUUID& object_id) const +{ + if (LLClipboard::getInstance()->isCutMode()) { - if (LLClipboard::getInstance()->isCutMode()) + LLUUID current_id = object_id; + LLInventoryObject *current_object = gInventory.getObject(object_id); + while (current_id.notNull()) { - LLUUID current_id = object_id; - LLInventoryObject *current_object = gInventory.getObject(object_id); - while (current_id.notNull()) + if (LLClipboard::getInstance()->isOnClipboard(current_id)) { - if (LLClipboard::getInstance()->isOnClipboard(current_id)) - { - return false; - } - current_id = current_object->getParentUUID(); - if (current_id.notNull()) - { - current_object = gInventory.getObject(current_id); - } + return false; + } + current_id = current_object->getParentUUID(); + if (current_id.notNull()) + { + current_object = gInventory.getObject(current_id); } } } - return true; } @@ -501,11 +483,6 @@ void LLInventoryFilter::setFilterEmptySystemFolders() mFilterOps.mFilterTypes |= FILTERTYPE_EMPTYFOLDERS; } -void LLInventoryFilter::setFilterClipboard() -{ - mFilterOps.mFilterTypes |= FILTERTYPE_CLIPBOARD; -} - void LLInventoryFilter::setFilterUUID(const LLUUID& object_id) { if (mFilterOps.mFilterUUID == LLUUID::null) diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index fb4f84b139..1ac90788b2 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -59,8 +59,7 @@ public: FILTERTYPE_UUID = 0x1 << 2, // find the object with UUID and any links to it FILTERTYPE_DATE = 0x1 << 3, // search by date range FILTERTYPE_WEARABLE = 0x1 << 4, // search by wearable type - FILTERTYPE_EMPTYFOLDERS = 0x1 << 5, // pass if folder is not a system folder to be hidden if empty - FILTERTYPE_CLIPBOARD = 0x1 << 6 // pass if item is not on the clipboard + FILTERTYPE_EMPTYFOLDERS = 0x1 << 5 // pass if folder is not a system folder to be hidden if empty }; enum EFilterLink @@ -92,7 +91,6 @@ public: void setFilterUUID(const LLUUID &object_id); void setFilterWearableTypes(U64 types); void setFilterEmptySystemFolders(); - void setFilterClipboard(); void updateFilterTypes(U64 types, U64& current_types); void setFilterSubString(const std::string& string); @@ -125,6 +123,7 @@ public: BOOL checkAgainstPermissions(const LLFolderViewItem* item) const; bool checkAgainstPermissions(const LLInventoryItem* item) const; BOOL checkAgainstFilterLinks(const LLFolderViewItem* item) const; + bool checkAgainstClipboard(const LLUUID& object_id) const; std::string::size_type getStringMatchOffset() const; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 27f97ad26f..4508e7e083 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -248,8 +248,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) getFilter()->setFilterEmptySystemFolders(); } - // hide items that are on the clipboard - getFilter()->setFilterClipboard(); + // keep track of the clipboard state so that we avoid filtering too much mClipboardState = LLClipboard::getInstance()->getState(); // Initialize base class params. -- cgit v1.2.3 From 51a8134f62ff0705ede2534945e808ccbd9d6b7e Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 10 Feb 2012 20:09:48 -0800 Subject: EXP-1885 FIX Viewer crashes when receiving multiple inventory offer notifications --- indra/newview/llscreenchannel.cpp | 10 +++++++++- indra/newview/lltoast.cpp | 13 ++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index a0f146e506..d340b304ca 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -798,6 +798,7 @@ void LLScreenChannel::showToastsTop() } // Dismiss toasts we don't have space for (STORM-391). + std::vector toasts_to_hide; if(it != mToastList.rend()) { mHiddenToastsNum = 0; @@ -806,10 +807,17 @@ void LLScreenChannel::showToastsTop() LLToast* toast = it->getToast(); if (toast) { - toast->hide(); + toasts_to_hide.push_back(toast); } } } + + for (std::vector::iterator it = toasts_to_hide.begin(), end_it = toasts_to_hide.end(); + it != end_it; + ++it) + { + (*it)->hide(); + } } //-------------------------------------------------------------------------- diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index cdc611f7af..0eec7f0afd 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -180,11 +180,14 @@ LLToast::~LLToast() //-------------------------------------------------------------------------- void LLToast::hide() { - setVisible(FALSE); - setFading(false); - mTimer->stop(); - mIsHidden = true; - mOnFadeSignal(this); + if (!mIsHidden) + { + setVisible(FALSE); + setFading(false); + mTimer->stop(); + mIsHidden = true; + mOnFadeSignal(this); + } } void LLToast::onFocusLost() -- cgit v1.2.3 From 47425d67fe032804d8a10123cd1a7daf9bff84f7 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 13 Feb 2012 17:12:03 +0200 Subject: EXP-1882 FIXED Crashes when invoking avatar picker from mouse look mode. Fixing the cases missed in EXP-1879. --- indra/newview/llavataractions.cpp | 5 +++++ indra/newview/llfloatergodtools.cpp | 6 +++++- indra/newview/llfloaterland.cpp | 14 ++++++++++++-- indra/newview/llfloaterregioninfo.cpp | 10 ++++++++-- indra/newview/llfloaterreporter.cpp | 6 +++++- indra/newview/llfloatersellland.cpp | 6 +++++- indra/newview/llpanelgroupinvite.cpp | 12 ++++++------ 7 files changed, 46 insertions(+), 13 deletions(-) diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 9a7cdcfa21..f618af9536 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -738,6 +738,11 @@ void LLAvatarActions::shareWithAvatars() LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(give_inventory, _1, _2), TRUE, FALSE); + if (!picker) + { + return; + } + picker->setOkBtnEnableCb(boost::bind(is_give_inventory_acceptable)); picker->openFriendsTab(); LLNotificationsUtil::add("ShareNotification"); diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index a34e0353ec..fb905eae11 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -1123,8 +1123,12 @@ bool LLPanelObjectTools::callbackSimWideDeletes( const LLSD& notification, const void LLPanelObjectTools::onClickSet() { + LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLPanelObjectTools::callbackAvatarID, this, _1,_2)); // grandparent is a floater, which can have a dependent - gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelObjectTools::callbackAvatarID, this, _1,_2))); + if (picker) + { + gFloaterView->getParentFloater(this)->addDependentFloater(picker); + } } void LLPanelObjectTools::onClickSetBySelection(void* data) diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 95da8ff948..ee18c95b34 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2739,7 +2739,12 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) void LLPanelLandAccess::onClickAddAccess() { - gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBAccess, this, _1)) ); + LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show( + boost::bind(&LLPanelLandAccess::callbackAvatarCBAccess, this, _1)); + if (picker) + { + gFloaterView->getParentFloater(this)->addDependentFloater(picker); + } } void LLPanelLandAccess::callbackAvatarCBAccess(const uuid_vec_t& ids) @@ -2783,7 +2788,12 @@ void LLPanelLandAccess::onClickRemoveAccess(void* data) // static void LLPanelLandAccess::onClickAddBanned() { - gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLPanelLandAccess::callbackAvatarCBBanned, this, _1))); + LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show( + boost::bind(&LLPanelLandAccess::callbackAvatarCBBanned, this, _1)); + if (picker) + { + gFloaterView->getParentFloater(this)->addDependentFloater(picker); + } } // static diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 676059779c..1f746ed31a 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -650,7 +650,10 @@ void LLPanelRegionGeneralInfo::onClickKick() // in order to set up floater dependency LLFloater* parent_floater = gFloaterView->getParentFloater(this); LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelRegionGeneralInfo::onKickCommit, this, _1), FALSE, TRUE); - parent_floater->addDependentFloater(child_floater); + if (child_floater) + { + parent_floater->addDependentFloater(child_floater); + } } void LLPanelRegionGeneralInfo::onKickCommit(const uuid_vec_t& ids) @@ -1470,7 +1473,10 @@ void LLPanelEstateInfo::onClickKickUser() // in order to set up floater dependency LLFloater* parent_floater = gFloaterView->getParentFloater(this); LLFloater* child_floater = LLFloaterAvatarPicker::show(boost::bind(&LLPanelEstateInfo::onKickUserCommit, this, _1), FALSE, TRUE); - parent_floater->addDependentFloater(child_floater); + if (child_floater) + { + parent_floater->addDependentFloater(child_floater); + } } void LLPanelEstateInfo::onKickUserCommit(const uuid_vec_t& ids) diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index c08848b1ea..3ec1e372eb 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -285,7 +285,11 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) void LLFloaterReporter::onClickSelectAbuser() { - gFloaterView->getParentFloater(this)->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLFloaterReporter::callbackAvatarID, this, _1, _2), FALSE, TRUE )); + LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterReporter::callbackAvatarID, this, _1, _2), FALSE, TRUE ); + if (picker) + { + gFloaterView->getParentFloater(this)->addDependentFloater(picker); + } } void LLFloaterReporter::callbackAvatarID(const uuid_vec_t& ids, const std::vector names) diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp index 3434841d09..64c0dfa023 100644 --- a/indra/newview/llfloatersellland.cpp +++ b/indra/newview/llfloatersellland.cpp @@ -392,8 +392,12 @@ void LLFloaterSellLandUI::onChangeValue(LLUICtrl *ctrl, void *userdata) void LLFloaterSellLandUI::doSelectAgent() { + LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterSellLandUI::callbackAvatarPick, this, _1, _2), FALSE, TRUE); // grandparent is a floater, in order to set up dependency - addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(&LLFloaterSellLandUI::callbackAvatarPick, this, _1, _2), FALSE, TRUE)); + if (picker) + { + addDependentFloater(picker); + } } void LLFloaterSellLandUI::callbackAvatarPick(const uuid_vec_t& ids, const std::vector names) diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index ca48e8561b..7a15d93181 100644 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -289,12 +289,12 @@ void LLPanelGroupInvite::impl::callbackClickAdd(void* userdata) //Soon the avatar picker will be embedded into this panel //instead of being it's own separate floater. But that is next week. //This will do for now. -jwolk May 10, 2006 - LLFloater* parentp; - - parentp = gFloaterView->getParentFloater(panelp); - parentp->addDependentFloater(LLFloaterAvatarPicker::show(boost::bind(impl::callbackAddUsers, _1, - panelp->mImplementation), - TRUE)); + LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show( + boost::bind(impl::callbackAddUsers, _1, panelp->mImplementation), TRUE); + if (picker) + { + gFloaterView->getParentFloater(panelp)->addDependentFloater(picker); + } } } -- cgit v1.2.3 From 12b4862330adcaca275967d45e97395ef7709c8f Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 13 Feb 2012 19:57:35 +0200 Subject: EXP-1832 FIXED Viewer Size not persistent across logins. Symptoms: Viewer window shrank by a few pixels on each startup. Reason: We used client rect (which did not include the window border) to create the viewer window. Solution: Convert client rect into window rect, i.e. expand it by the border size. --- indra/llwindow/llwindowwin32.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index ebc3203f14..3a3e4a90dd 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -886,7 +886,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO DWORD current_refresh; DWORD dw_ex_style; DWORD dw_style; - RECT window_rect; + RECT window_rect = {0, 0, 0, 0}; S32 width = size.mX; S32 height = size.mY; BOOL auto_show = FALSE; @@ -985,9 +985,6 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO window_rect.bottom = (long) height; dw_ex_style = WS_EX_APPWINDOW; dw_style = WS_POPUP; - - // Move window borders out not to cover window contents - AdjustWindowRectEx(&window_rect, dw_style, FALSE, dw_ex_style); } // If it failed, we don't want to run fullscreen else @@ -1014,6 +1011,10 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO dw_style = WS_OVERLAPPEDWINDOW; } + // Move window borders out not to cover window contents. + // This converts client rect to window rect, i.e. expands it by the window border size. + AdjustWindowRectEx(&window_rect, dw_style, FALSE, dw_ex_style); + // don't post quit messages when destroying old windows mPostQuit = FALSE; -- cgit v1.2.3 From 632c8c138c94fae24729ef75ac29967cd4758eb3 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 13 Feb 2012 10:09:33 -0800 Subject: EXP-1863 : Add comment and dead code cleanup --- indra/newview/llinventorybridge.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 1fa6820d2d..eb0f9803b0 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1778,9 +1778,9 @@ BOOL LLFolderBridge::isUpToDate() const BOOL LLFolderBridge::isItemCopyable() const { + // Folders are always copyable as they have no permissions attached to them as items. + // The story is different of course for items within folders. return TRUE; - // Can copy folders to paste-as-link, but not for straight paste. - //return gSavedSettings.getBOOL("InventoryLinking"); } BOOL LLFolderBridge::isClipboardPasteable() const -- cgit v1.2.3 From 76a27f5100666739aae53c0988318a6dae647666 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 13 Feb 2012 13:55:51 -0600 Subject: SH-2964 Fix for shader compilation error on some older NVIDIA cards. --- indra/llrender/llshadermgr.cpp | 4 ++-- .../newview/app_settings/shaders/class1/objects/indexedTextureV.glsl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 321b139181..269f78c8cd 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -663,7 +663,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade . uniform sampler2D texN; - VARYING uvec4 vary_texture_index; + VARYING ivec4 vary_texture_index; vec4 diffuseLookup(vec2 texcoord) { @@ -691,7 +691,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade if (texture_index_channels > 1) { - text[count++] = strdup("VARYING_FLAT uvec4 vary_texture_index;\n"); + text[count++] = strdup("VARYING_FLAT ivec4 vary_texture_index;\n"); } text[count++] = strdup("vec4 diffuseLookup(vec2 texcoord)\n"); diff --git a/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl b/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl index a0f513d73d..7c0699d72f 100644 --- a/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl @@ -23,9 +23,9 @@ * $/LicenseInfo$ */ -ATTRIBUTE uvec4 texture_index; +ATTRIBUTE ivec4 texture_index; -VARYING_FLAT uvec4 vary_texture_index; +VARYING_FLAT ivec4 vary_texture_index; void passTextureIndex() { -- cgit v1.2.3 From 80505ddf68c8a0a962a720a1c1d2a894df47157f Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 13 Feb 2012 15:02:07 -0600 Subject: SH-2908 Fix for linux build. --- indra/llrender/llgl.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 79d4415117..e855dda57d 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -344,7 +344,6 @@ PFNGLVERTEXATTRIB4UBVARBPROC glVertexAttrib4ubvARB = NULL; PFNGLVERTEXATTRIB4UIVARBPROC glVertexAttrib4uivARB = NULL; PFNGLVERTEXATTRIB4USVARBPROC glVertexAttrib4usvARB = NULL; PFNGLVERTEXATTRIBPOINTERARBPROC glVertexAttribPointerARB = NULL; -PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer = NULL; PFNGLENABLEVERTEXATTRIBARRAYARBPROC glEnableVertexAttribArrayARB = NULL; PFNGLDISABLEVERTEXATTRIBARRAYARBPROC glDisableVertexAttribArrayARB = NULL; PFNGLPROGRAMSTRINGARBPROC glProgramStringARB = NULL; -- cgit v1.2.3 From 001e32074d4fbc5d115c9a2fa1cb5de4b5932731 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 13 Feb 2012 15:32:15 -0600 Subject: SH-2908 More linux build fixes. --- indra/newview/pipeline.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index c8a8b910ea..ce3a4893bf 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -6643,8 +6643,8 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) mDeferredLight.flush(); } - U32 dof_width = mScreen.getWidth()*CameraDoFResScale; - U32 dof_height = mScreen.getHeight()*CameraDoFResScale; + U32 dof_width = (U32) (mScreen.getWidth()*CameraDoFResScale); + U32 dof_height = (U32) (mScreen.getHeight()*CameraDoFResScale); { //perform DoF sampling at half-res (preserve alpha channel) mScreen.bindTarget(); -- cgit v1.2.3 From 64c89ee2c51c539d38d4d55807b18172d6606514 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 13 Feb 2012 15:41:21 -0600 Subject: SH-2908 Fix for mac build --- indra/llrender/llgl.cpp | 9 +++++++++ indra/llrender/llvertexbuffer.cpp | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index e855dda57d..197bc2b422 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -561,6 +561,15 @@ bool LLGLManager::initGL() if (mGLVersion >= 2.f) { parse_glsl_version(mGLSLVersionMajor, mGLSLVersionMinor); + +#if LL_DARWIN + //never use GLSL greater than 1.20 on OSX + if (mGLSLVersionMajor > 1 || mGLSLVersionMinor >= 30) + { + mGLSLVersionMajor = 1; + mGLSLVersionMinor = 20; + } +#endif } // Trailing space necessary to keep "nVidia Corpor_ati_on" cards diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index b2438ef824..a7f0170658 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -1264,11 +1264,13 @@ void LLVertexBuffer::setupVertexArray() if (attrib_integer) { +#if !LL_DARWIN //glVertexattribIPointer requires GLSL 1.30 or later if (gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 30) { glVertexAttribIPointer(i, attrib_size[i], attrib_type[i], sTypeSize[i], (void*) mOffsets[i]); } +#endif } else { @@ -2258,9 +2260,11 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask) if (data_mask & MAP_TEXTURE_INDEX && (gGLManager.mGLSLVersionMajor >= 2 || gGLManager.mGLSLVersionMinor >= 30)) //indexed texture rendering requires GLSL 1.30 or later { +#if !LL_DARWIN S32 loc = TYPE_TEXTURE_INDEX; void *ptr = (void*) (base + mOffsets[TYPE_VERTEX] + 12); glVertexAttribIPointer(loc, 4, GL_UNSIGNED_BYTE, LLVertexBuffer::sTypeSize[TYPE_VERTEX], ptr); +#endif } if (data_mask & MAP_VERTEX) { -- cgit v1.2.3 From 03c002641ed1720f07a8c704219abd704a369043 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 13 Feb 2012 15:43:47 -0800 Subject: EXP-1888 FIX -- Update text for emtpy Received Items folder in the Viewer --- indra/newview/skins/default/xui/en/sidepanel_inventory.xml | 2 +- indra/newview/skins/default/xui/en/strings.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index fcba937bdb..29aa6d1039 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -112,7 +112,7 @@ bg_opaque_color="InventoryBackgroundColor" background_visible="true" background_opaque="true" - tool_tip="Drag and drop items to your inventory to manage and use them" + tool_tip="Drag and drop items to your inventory to use them" > Didn't find what you're looking for? Try [secondlife:///app/search/places/[SEARCH_TERM] Search]. Drag a landmark here to add it to your favorites. You do not have a copy of this texture in your inventory - Certain items you receive, such as premium gifts, will appear here. You may then drag them into your inventory. + Certain items you receive, such as Marketplace purchases and objects shared with you in world, will appear here. You may then drag them into your inventory to use them. https://marketplace.[MARKETPLACE_DOMAIN_NAME]/ http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.4 https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard -- cgit v1.2.3 From e8b8be637bf63f4ff530c2ec6d0abb89da50035f Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 13 Feb 2012 15:53:41 -0800 Subject: Fix Linux compile issue : make templated type casting explicit --- indra/llmath/llcoord.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llmath/llcoord.h b/indra/llmath/llcoord.h index 1f617e649e..533aa2978b 100644 --- a/indra/llmath/llcoord.h +++ b/indra/llmath/llcoord.h @@ -45,7 +45,7 @@ public: LLCoord(): mX(0), mY(0) {} - LLCoord(S32 x, S32 y): mX(x), mY(y) + LLCoord(S32 x, S32 y): mX((typename COORD_FRAME::value_t)(x)), mY((typename COORD_FRAME::value_t)(y)) {} LLCoord(const LLCoordCommon& other) -- cgit v1.2.3 From 3267b42ee521a7a059e0e87cba75a3d32af678e5 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 13 Feb 2012 18:26:48 -0600 Subject: SH-2908 Temporary fix for mac build --- indra/llrender/llglslshader.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index a879a18895..4b7e639aed 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -109,7 +109,9 @@ void LLGLSLShader::unload() glGetAttachedObjectsARB(mProgramObject, 1024, &count, obj); for (GLsizei i = 0; i < count; i++) { +#if !LL_DARWIN if (glIsProgramARB(obj[i])) +#endif { glDeleteObjectARB(obj[i]); } -- cgit v1.2.3 From 5c8bcc4643e8f2e02c96847e3eeeced0d2b4157a Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 13 Feb 2012 16:39:35 -0800 Subject: Fix Linux compile issue : make templated type casting explicit (2) --- indra/llmath/llcoord.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llmath/llcoord.h b/indra/llmath/llcoord.h index 533aa2978b..756e23dbdf 100644 --- a/indra/llmath/llcoord.h +++ b/indra/llmath/llcoord.h @@ -45,7 +45,7 @@ public: LLCoord(): mX(0), mY(0) {} - LLCoord(S32 x, S32 y): mX((typename COORD_FRAME::value_t)(x)), mY((typename COORD_FRAME::value_t)(y)) + LLCoord(typename COORD_FRAME::value_t x, typename COORD_FRAME::value_t y): mX(x), mY(y) {} LLCoord(const LLCoordCommon& other) @@ -58,7 +58,7 @@ public: return COORD_FRAME::convertToCommon(); } - void set(S32 x, S32 y) { mX = x; mY = y;} + void set(typename COORD_FRAME::value_t x, typename COORD_FRAME::value_t y) { mX = x; mY = y;} bool operator==(const self_t& other) const { return mX == other.mX && mY == other.mY; } bool operator!=(const self_t& other) const { return !(*this == other); } -- cgit v1.2.3 From 7206160fb5d1e8ef2e7fa4d037f34ba1633b0981 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 13 Feb 2012 19:13:22 -0600 Subject: SH-2973 Potential fix for crash in ~LLVOAvatarSelf --- indra/newview/llappviewer.cpp | 2 ++ indra/newview/lldriverparam.cpp | 2 +- indra/newview/llvoavatarself.cpp | 5 +++-- indra/newview/llvoavatarself.h | 2 +- indra/newview/llwearable.cpp | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 49fbdbf1df..3a257e1f1c 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1769,6 +1769,8 @@ bool LLAppViewer::cleanup() LLAvatarIconIDCache::getInstance()->save(); + gAgentAvatarp = NULL; + LLViewerMedia::saveCookieFile(); // Stop the plugin read thread if it's running. diff --git a/indra/newview/lldriverparam.cpp b/indra/newview/lldriverparam.cpp index 8f47d3c5e5..64eb11fc9b 100644 --- a/indra/newview/lldriverparam.cpp +++ b/indra/newview/lldriverparam.cpp @@ -139,7 +139,7 @@ void LLDriverParamInfo::toStream(std::ostream &out) } else { - llwarns << "could not get parameter " << driven.mDrivenID << " from avatar " << gAgentAvatarp << " for driver parameter " << getID() << llendl; + llwarns << "could not get parameter " << driven.mDrivenID << " from avatar " << gAgentAvatarp.get() << " for driver parameter " << getID() << llendl; } out << std::endl; } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index f1df67494f..e525d6bad0 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -66,10 +66,11 @@ #include -LLVOAvatarSelf *gAgentAvatarp = NULL; +LLPointer gAgentAvatarp = NULL; + BOOL isAgentAvatarValid() { - return (gAgentAvatarp && + return (gAgentAvatarp.notNull() && (gAgentAvatarp->getRegion() != NULL) && (!gAgentAvatarp->isDead())); } diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 54dbe81993..655fb3a012 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -383,7 +383,7 @@ private: }; -extern LLVOAvatarSelf *gAgentAvatarp; +extern LLPointer gAgentAvatarp; BOOL isAgentAvatarValid(); diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index d8aa0b7d5c..0f7f63061b 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -221,7 +221,7 @@ void LLWearable::createVisualParams() param->resetDrivenParams(); if(!param->linkDrivenParams(boost::bind(wearable_function,(LLWearable*)this, _1), false)) { - if( !param->linkDrivenParams(boost::bind(avatar_function,gAgentAvatarp,_1 ), true)) + if( !param->linkDrivenParams(boost::bind(avatar_function,gAgentAvatarp.get(),_1 ), true)) { llwarns << "could not link driven params for wearable " << getName() << " id: " << param->getID() << llendl; continue; -- cgit v1.2.3 From ca179444a1fb56bb42896c735b23906460c40d88 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 13 Feb 2012 19:13:22 -0600 Subject: SH-2973 Potential fix for crash in ~LLVOAvatarSelf --- indra/newview/llappviewer.cpp | 2 ++ indra/newview/lldriverparam.cpp | 2 +- indra/newview/llvoavatarself.cpp | 5 +++-- indra/newview/llvoavatarself.h | 2 +- indra/newview/llwearable.cpp | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 49fbdbf1df..3a257e1f1c 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1769,6 +1769,8 @@ bool LLAppViewer::cleanup() LLAvatarIconIDCache::getInstance()->save(); + gAgentAvatarp = NULL; + LLViewerMedia::saveCookieFile(); // Stop the plugin read thread if it's running. diff --git a/indra/newview/lldriverparam.cpp b/indra/newview/lldriverparam.cpp index 8f47d3c5e5..64eb11fc9b 100644 --- a/indra/newview/lldriverparam.cpp +++ b/indra/newview/lldriverparam.cpp @@ -139,7 +139,7 @@ void LLDriverParamInfo::toStream(std::ostream &out) } else { - llwarns << "could not get parameter " << driven.mDrivenID << " from avatar " << gAgentAvatarp << " for driver parameter " << getID() << llendl; + llwarns << "could not get parameter " << driven.mDrivenID << " from avatar " << gAgentAvatarp.get() << " for driver parameter " << getID() << llendl; } out << std::endl; } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index f1df67494f..e525d6bad0 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -66,10 +66,11 @@ #include -LLVOAvatarSelf *gAgentAvatarp = NULL; +LLPointer gAgentAvatarp = NULL; + BOOL isAgentAvatarValid() { - return (gAgentAvatarp && + return (gAgentAvatarp.notNull() && (gAgentAvatarp->getRegion() != NULL) && (!gAgentAvatarp->isDead())); } diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 54dbe81993..655fb3a012 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -383,7 +383,7 @@ private: }; -extern LLVOAvatarSelf *gAgentAvatarp; +extern LLPointer gAgentAvatarp; BOOL isAgentAvatarValid(); diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index d8aa0b7d5c..0f7f63061b 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -221,7 +221,7 @@ void LLWearable::createVisualParams() param->resetDrivenParams(); if(!param->linkDrivenParams(boost::bind(wearable_function,(LLWearable*)this, _1), false)) { - if( !param->linkDrivenParams(boost::bind(avatar_function,gAgentAvatarp,_1 ), true)) + if( !param->linkDrivenParams(boost::bind(avatar_function,gAgentAvatarp.get(),_1 ), true)) { llwarns << "could not link driven params for wearable " << getName() << " id: " << param->getID() << llendl; continue; -- cgit v1.2.3 From 60fa5c3d4e23967d1ecd1e5189685ca94223cfb4 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 13 Feb 2012 19:53:39 -0600 Subject: SH-2908 Fix for shaders failing to compile when using GLSL 1.20 or 1.10 profile. --- indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl | 2 +- .../newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl | 2 +- .../app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl | 2 +- .../newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/cofF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl | 2 +- .../app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl | 2 +- .../newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl | 2 +- indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl | 2 +- indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl | 2 +- indra/newview/app_settings/shaders/class1/effects/glowF.glsl | 2 +- indra/newview/app_settings/shaders/class1/environment/terrainF.glsl | 2 +- .../newview/app_settings/shaders/class1/environment/terrainWaterF.glsl | 2 +- indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl | 2 +- indra/newview/app_settings/shaders/class1/environment/waterF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/debugF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl | 2 +- .../newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/highlightF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl | 2 +- .../app_settings/shaders/class1/interface/onetexturenocolorF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl | 2 +- .../app_settings/shaders/class1/interface/splattexturerectF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/uiF.glsl | 2 +- indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl | 2 +- .../app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl | 2 +- indra/newview/app_settings/shaders/class1/lighting/lightF.glsl | 2 +- .../app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl | 2 +- .../newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl | 2 +- .../shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl | 2 +- .../shaders/class1/lighting/lightFullbrightNonIndexedF.glsl | 2 +- .../app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl | 2 +- .../shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl | 2 +- .../shaders/class1/lighting/lightFullbrightShinyWaterF.glsl | 2 +- .../shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl | 2 +- .../shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl | 2 +- .../app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl | 2 +- .../class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl | 2 +- .../shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl | 2 +- .../newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl | 2 +- indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl | 2 +- .../app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl | 2 +- .../newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl | 2 +- .../shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl | 2 +- .../app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl | 2 +- .../shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl | 2 +- indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl | 2 +- .../app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl | 2 +- indra/newview/app_settings/shaders/class1/objects/impostorF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl | 2 +- .../newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl | 2 +- .../app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl | 2 +- indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl | 2 +- indra/newview/app_settings/shaders/class2/windlight/skyF.glsl | 2 +- 79 files changed, 79 insertions(+), 79 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl index 54e2f04459..7a35905280 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index 37fd63b7d5..73f05a5dd4 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRect depthMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl index 14ac9f1f78..bfbd30a455 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRect depthMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl index 654e272b06..dae1131bbb 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedNoColorF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRect depthMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl index b88041490a..92e3f7f388 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowF.glsl @@ -25,7 +25,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl index 594ed778e3..3686f2f647 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl index a08b018702..f400eb7a5b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRect depthMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl index 3fcfbf55c4..ccbc3c557c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRect diffuseRect; diff --git a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl index f05ea557e3..a425e5062e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRect diffuseRect; diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl index ebe9a66bb4..6aa4d7b4ed 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif vec3 fullbrightAtmosTransport(vec3 light); diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl index 616ffca2d1..36433a5827 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl index 76b1748813..d93e897029 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif #define FXAA_PC 1 diff --git a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl index 31da124cb1..dcf474824d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/luminanceF.glsl @@ -28,7 +28,7 @@ uniform sampler2DRect diffuseMap; #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec2 vary_fragcoord; diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 40dd363061..75de47614c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif //class 1 -- no shadows diff --git a/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl b/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl index 32881ef042..62cfa5c316 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2D alphaMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl index 619b7bcd03..a5e04fba57 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRect diffuseRect; diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl index e7b2174280..bf362e21a4 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRect diffuseRect; diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl index ed2352b51f..eb5beeef39 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRect diffuseRect; diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl index 18550b2e12..96f9628424 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRect depthMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl index 7d75b50aa2..cf8cf8364a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform float minimum_alpha; diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl index 3eb733aa51..7e55fdc12a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 post_pos; diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 70b0f6fbd0..b5501c2820 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRect diffuseRect; diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index d3d6a155f0..7ed8ed3370 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -29,7 +29,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRect diffuseRect; diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl index aa29be09a1..5ca817aff6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl @@ -30,7 +30,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif void main() diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl index 9bee632472..7fa666a739 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif //class 1 -- no shadow, SSAO only diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl index 6be66a402f..d4d2f5f571 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform float minimum_alpha; diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl index 952706841d..0f5eb288fd 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRect diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl index 289c5b367f..c1f6af9f57 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl index 51efdd4b39..668a710c04 100644 --- a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl index d9b5c5f7f5..a956562396 100644 --- a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl index 32459eff6a..0d8dab0a41 100644 --- a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl index 0cde7d0133..79bffab745 100644 --- a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif vec3 scaleSoftClip(vec3 inColor); diff --git a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl index e8b8513bd1..f520f301d9 100644 --- a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl index b990ce9f03..a96d04cc39 100644 --- a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl index ad05f17a30..67c6baddbb 100644 --- a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform vec4 color; diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl index 7e4515db40..ed803de277 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif #extension GL_ARB_texture_rectangle : enable diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl index 5a5894523d..59520bb99f 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRect diffuseRect; diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl index d1d140d2a6..6cc9bbbea2 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform vec4 color; diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl index a18a3cdb50..db130e456c 100644 --- a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif void main() diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl index bfaa4774d9..415181126b 100644 --- a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2D tex0; diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl index 5d7edf33a9..67dc500493 100644 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2D tex0; diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl index 7a28ca847a..772bb374e8 100644 --- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRect screenMap; diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl index 73a5839028..95679e93e7 100644 --- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2D tex0; diff --git a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl index 8fac2862b1..299bfb72aa 100644 --- a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl index aabff3196a..cf29939cb2 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform float minimum_alpha; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl index 6e6aec8532..4070d41f47 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform float minimum_alpha; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl index f9a3eb8d90..d6ebfcb825 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl index a3eb133133..6c34643aab 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform float minimum_alpha; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl index 222c6bbf0e..2ff7f795b0 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl index 441fcd0d7a..f4477bd29a 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform float minimum_alpha; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl index 7020fbc72b..2738ff8947 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightNonIndexedF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl index 889a3e48ba..777c8b45bb 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl index f0727c377b..4fa3b1d939 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyNonIndexedF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl index aac13462b3..58984a4263 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl @@ -25,7 +25,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl index 4f57b7a9f5..a39b7205d7 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterNonIndexedF.glsl @@ -25,7 +25,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl index 6c277cddc1..99a6fe85fe 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform float minimum_alpha; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl index 5c4bedefcc..df182168f3 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl index df07071236..63f92a8844 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform float minimum_alpha; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl index 91208bc56a..0e68091e7c 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl index 1a0473b9e2..0aca768021 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl index a24d8d4ecd..52e3b2ad02 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl index 16f64633ac..474d5ea496 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyNonIndexedF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl index cf78149733..d2a4c47aac 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl index 97531fd937..f3bd662364 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterNonIndexedF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl index 4fcdad09fc..b68240ba0d 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform float minimum_alpha; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl index d235ed2491..da3b20012d 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform float minimum_alpha; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl index c295579028..00609e93cd 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl index 5a5cc2c821..13ecb7a636 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl index 6358fdfeae..add437d144 100644 --- a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform float minimum_alpha; diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index 373a6c157b..e5edb482a9 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl index 04460ea7c0..c467e6c5cb 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRectShadow shadowMap0; diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl index c50145f753..8aaf87a1b5 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRectShadow shadowMap0; diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 7d78a888a5..f7f1f649ce 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRect diffuseRect; diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index f73163898e..61a7f1e32f 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif uniform sampler2DRect diffuseRect; diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 7cc621b1f6..99a277fbfc 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index a92a9fc8e8..a40b29d2c4 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -28,7 +28,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif //class 2, shadows, no SSAO diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl index 45b8db5adc..774f70262a 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -27,7 +27,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif //class 2 -- shadows and SSAO diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl index c8d89095d8..96c70651b1 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif ///////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl index 4aece6e032..e2a2367626 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif ///////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 7bb8373d7cb746af8814e09373ed89c332e14619 Mon Sep 17 00:00:00 2001 From: paulgproductengine Date: Tue, 14 Feb 2012 20:08:10 +0200 Subject: EXP-1546 FIXED (received items - purchasing some bodyparts and clothing from a prim marked for sale show wrong inventory icons) - In buy floater, for multiple WEARABLES inventory items show corresponding wearable icons --- indra/newview/llfloaterbuycontents.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp index a7388d21a3..bca4b5e447 100644 --- a/indra/newview/llfloaterbuycontents.cpp +++ b/indra/newview/llfloaterbuycontents.cpp @@ -210,7 +210,9 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj, LLSD row; BOOL item_is_multi = FALSE; - if ( inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_LANDMARK_VISITED ) + if ((inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_LANDMARK_VISITED + || inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS) + && !(inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK)) { item_is_multi = TRUE; } -- cgit v1.2.3 From d660d1ad65614068e6134ad83c4beca46415165f Mon Sep 17 00:00:00 2001 From: paulgproductengine Date: Tue, 14 Feb 2012 20:13:26 +0200 Subject: EXP-1890 FIXED (The "Shop" button is partially not clickable) - Adjusted width of the panel which contains the shop button --- indra/newview/skins/default/xui/de/panel_status_bar.xml | 2 +- indra/newview/skins/default/xui/en/panel_status_bar.xml | 4 ++-- indra/newview/skins/default/xui/es/panel_status_bar.xml | 2 +- indra/newview/skins/default/xui/fr/panel_status_bar.xml | 2 +- indra/newview/skins/default/xui/it/panel_status_bar.xml | 2 +- indra/newview/skins/default/xui/ja/panel_status_bar.xml | 2 +- indra/newview/skins/default/xui/pt/panel_status_bar.xml | 2 +- indra/newview/skins/default/xui/ru/panel_status_bar.xml | 2 +- indra/newview/skins/default/xui/tr/panel_status_bar.xml | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/indra/newview/skins/default/xui/de/panel_status_bar.xml b/indra/newview/skins/default/xui/de/panel_status_bar.xml index 2493d60df6..14ace0ac3a 100644 --- a/indra/newview/skins/default/xui/de/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/de/panel_status_bar.xml @@ -15,7 +15,7 @@ [AMT] L$ - + @@ -107,7 +107,7 @@ layout="topleft" left="335" name="btn_restore_defaults" - top="285" + top="330" width="130"> diff --git a/indra/newview/skins/default/xui/en/floater_ui_preview.xml b/indra/newview/skins/default/xui/en/floater_ui_preview.xml index 3921cfcd2c..06d4327293 100644 --- a/indra/newview/skins/default/xui/en/floater_ui_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_ui_preview.xml @@ -22,6 +22,7 @@ or specifying its path in the "Editor Path" field. layout="topleft" left="0" mouse_opaque="false" + default_tab_group="1" name="main_panel" right="750" top="0"> @@ -196,6 +197,7 @@ or specifying its path in the "Editor Path" field. left="10" name="name_list" right="-10" + tab_group="1" search_column="1" top="80"> - + diff --git a/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml b/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml index f95f21e63a..a04050e7eb 100644 --- a/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml +++ b/indra/newview/skins/default/xui/en/floater_test_layout_stacks.xml @@ -26,6 +26,26 @@ background_visible="true"> flex + + flex + + + flex + + + +this +is +some +text +that +is +top +aligned + +this +is +some +text +that +is +center +aligned + +this +is +some +text +that +is +bottom +aligned + +this +is +some +text +that +is +top +aligned + + +this +is +some +text +that +is +center +aligned + + +this +is +some +text +that +is +bottom +aligned + + diff --git a/indra/newview/skins/default/xui/en/floater_test_textbox.xml b/indra/newview/skins/default/xui/en/floater_test_textbox.xml index 2df9bb35fe..1d31fbd6dc 100644 --- a/indra/newview/skins/default/xui/en/floater_test_textbox.xml +++ b/indra/newview/skins/default/xui/en/floater_test_textbox.xml @@ -8,21 +8,7 @@ help_topic="floater_test_textbox" translate="false" width="800"> - - First line of multiple lines -Second line of multiple lines -Third line of multiple lines -Fourth line of multiple lines -Fifth line of multiple lines - - - + Screen + + + Local + + + World + + + Reference + + + Attachment + + Drag colored bands to rotate object @@ -312,20 +332,48 @@ top_pad="0" name="checkbox snap to grid" width="134" /> - + + + -- cgit v1.2.3 From 30140f66be90b78006b29b7f3740ddc473a0ac96 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 3 May 2012 17:25:02 -0400 Subject: SH-3079 FIX - minimize retries and avoid log spam when people API is missing --- indra/llmessage/llavatarnamecache.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 97f2792686..fbc3cc6de2 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -87,6 +87,9 @@ namespace LLAvatarNameCache /// Time when unrefreshed cached names were checked last static F64 sLastExpireCheck; + /// Time-to-live for a temp cache entry. + const F64 TEMP_CACHE_ENTRY_LIFETIME = 60.0; + //----------------------------------------------------------------------- // Internal methods //----------------------------------------------------------------------- @@ -274,7 +277,7 @@ void LLAvatarNameCache::handleAgentError(const LLUUID& agent_id) { // there is no existing cache entry, so make a temporary name from legacy LL_WARNS("AvNameCache") << "LLAvatarNameCache get legacy for agent " - << agent_id << LL_ENDL; + << agent_id << LL_ENDL; gCacheName->get(agent_id, false, // legacy compatibility boost::bind(&LLAvatarNameCache::legacyNameCallback, _1, _2, _3)); @@ -287,13 +290,14 @@ void LLAvatarNameCache::handleAgentError(const LLUUID& agent_id) // Clear this agent from the pending list LLAvatarNameCache::sPendingQueue.erase(agent_id); - const LLAvatarName& av_name = existing->second; + LLAvatarName& av_name = existing->second; LL_DEBUGS("AvNameCache") << "LLAvatarNameCache use cache for agent " << agent_id << "user '" << av_name.mUsername << "' " << "display '" << av_name.mDisplayName << "' " << "expires in " << av_name.mExpires - LLFrameTimer::getTotalSeconds() << " seconds" << LL_ENDL; + av_name.mExpires = LLFrameTimer::getTotalSeconds() + TEMP_CACHE_ENTRY_LIFETIME; // reset expiry time so we don't constantly rerequest. } } @@ -402,10 +406,12 @@ void LLAvatarNameCache::legacyNameCallback(const LLUUID& agent_id, << LL_ENDL; buildLegacyName(full_name, &av_name); - // Don't add to cache, the data already exists in the legacy name system - // cache and we don't want or need duplicate storage, because keeping the - // two copies in sync is complex. - processName(agent_id, av_name, false); + // Add to cache, because if we don't we'll keep rerequesting the + // same record forever. buildLegacyName should always guarantee + // that these records expire reasonably soon + // (in TEMP_CACHE_ENTRY_LIFETIME seconds), so if the failure was due + // to something temporary we will eventually request and get the right data. + processName(agent_id, av_name, true); } void LLAvatarNameCache::requestNamesViaLegacy() @@ -583,7 +589,7 @@ void LLAvatarNameCache::buildLegacyName(const std::string& full_name, av_name->mDisplayName = full_name; av_name->mIsDisplayNameDefault = true; av_name->mIsTemporaryName = true; - av_name->mExpires = F64_MAX; // not used because these are not cached + av_name->mExpires = LLFrameTimer::getTotalSeconds() + TEMP_CACHE_ENTRY_LIFETIME; LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::buildLegacyName " << full_name << LL_ENDL; -- cgit v1.2.3 From 0afca8603a56205df4c4e310387651726cbfbe3c Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 4 May 2012 18:16:37 -0600 Subject: fix crashes and flaws for SH-3086 --- indra/newview/llfloatertexturefetchdebugger.cpp | 145 +++++++++++++++------ indra/newview/llfloatertexturefetchdebugger.h | 3 + indra/newview/lltexturefetch.cpp | 125 ++++++++++++------ indra/newview/lltexturefetch.h | 14 +- indra/newview/llviewertexture.cpp | 11 +- .../xui/en/floater_texture_fetch_debugger.xml | 14 +- 6 files changed, 208 insertions(+), 104 deletions(-) diff --git a/indra/newview/llfloatertexturefetchdebugger.cpp b/indra/newview/llfloatertexturefetchdebugger.cpp index b6210423d1..02872f54a0 100644 --- a/indra/newview/llfloatertexturefetchdebugger.cpp +++ b/indra/newview/llfloatertexturefetchdebugger.cpp @@ -67,6 +67,7 @@ LLFloaterTextureFetchDebugger::LLFloaterTextureFetchDebugger(const LLSD& key) BOOL LLFloaterTextureFetchDebugger::postBuild(void) { mDebugger = LLAppViewer::getTextureFetch()->getFetchDebugger(); + mStartStatus = (S32)LLTextureFetchDebugger::IDLE; //set states for buttons mButtonStateMap["start_btn"] = true; @@ -93,7 +94,7 @@ BOOL LLFloaterTextureFetchDebugger::postBuild(void) LLFloaterTextureFetchDebugger::~LLFloaterTextureFetchDebugger() { //stop everything - mDebugger->stopDebug(); + mDebugger->setStopDebug(); } void LLFloaterTextureFetchDebugger::updateButtons() @@ -125,11 +126,69 @@ void LLFloaterTextureFetchDebugger::disableButtons() childDisable("refetchallcache_btn"); childDisable("refetchallhttp_btn"); } +void LLFloaterTextureFetchDebugger::setStartStatus(S32 status) +{ + llassert_always(LLTextureFetchDebugger::IDLE == (LLTextureFetchDebugger::e_debug_state)mStartStatus) ; + mStartStatus = status; +} + +bool LLFloaterTextureFetchDebugger::idleStart() +{ + switch((LLTextureFetchDebugger::e_debug_state)mStartStatus) + { + case LLTextureFetchDebugger::IDLE: + break; + case LLTextureFetchDebugger::START_DEBUG: + mDebugger->startDebug(); + break; + case LLTextureFetchDebugger::READ_CACHE: + mDebugger->debugCacheRead(); + break; + case LLTextureFetchDebugger::WRITE_CACHE: + mDebugger->debugCacheWrite(); + break; + case LLTextureFetchDebugger::DECODING: + mDebugger->debugDecoder(); + break; + case LLTextureFetchDebugger::HTTP_FETCHING: + mDebugger->debugHTTP(); + break; + case LLTextureFetchDebugger::GL_TEX: + mDebugger->debugGLTextureCreation(); + break; + case LLTextureFetchDebugger::REFETCH_VIS_CACHE: + mDebugger->debugRefetchVisibleFromCache(); + break; + case LLTextureFetchDebugger::REFETCH_VIS_HTTP: + mDebugger->debugRefetchVisibleFromHTTP(); + break; + case LLTextureFetchDebugger::REFETCH_ALL_CACHE: + mDebugger->debugRefetchAllFromCache(); + break; + case LLTextureFetchDebugger::REFETCH_ALL_HTTP: + mDebugger->debugRefetchAllFromHTTP(); + break; + default: + break; + } + + if(mStartStatus != (S32)LLTextureFetchDebugger::IDLE) + { + mStartStatus = (S32)LLTextureFetchDebugger::IDLE; + return true; + } + + return false; +} void LLFloaterTextureFetchDebugger::idle() { - LLTextureFetchDebugger::e_debug_state state = mDebugger->getState(); - + if(idleStart()) + { + return; + } + + LLTextureFetchDebugger::e_debug_state state = mDebugger->getState(); if(mDebugger->update()) { switch(state) @@ -137,38 +196,36 @@ void LLFloaterTextureFetchDebugger::idle() case LLTextureFetchDebugger::IDLE: break; case LLTextureFetchDebugger::READ_CACHE: - mButtonStateMap["decode_btn"] = true; - updateButtons(); + mButtonStateMap["decode_btn"] = true; break; - case LLTextureFetchDebugger::WRITE_CACHE: - updateButtons(); + case LLTextureFetchDebugger::WRITE_CACHE: break; case LLTextureFetchDebugger::DECODING: - mButtonStateMap["gl_btn"] = true; - updateButtons(); + mButtonStateMap["gl_btn"] = true; break; case LLTextureFetchDebugger::HTTP_FETCHING: mButtonStateMap["cacheread_btn"] = true; mButtonStateMap["cachewrite_btn"] = true; - mButtonStateMap["decode_btn"] = true; - updateButtons(); + mButtonStateMap["decode_btn"] = true; break; - case LLTextureFetchDebugger::GL_TEX: - updateButtons(); + case LLTextureFetchDebugger::GL_TEX: break; - case LLTextureFetchDebugger::REFETCH_VIS_CACHE: - updateButtons(); - case LLTextureFetchDebugger::REFETCH_VIS_HTTP: - updateButtons(); + case LLTextureFetchDebugger::REFETCH_VIS_CACHE: + break; + case LLTextureFetchDebugger::REFETCH_VIS_HTTP: + break; + case LLTextureFetchDebugger::REFETCH_ALL_CACHE: break; - case LLTextureFetchDebugger::REFETCH_ALL_CACHE: - updateButtons(); case LLTextureFetchDebugger::REFETCH_ALL_HTTP: - updateButtons(); break; default: break; } + + if(state != LLTextureFetchDebugger::IDLE) + { + updateButtons(); + } } } @@ -182,21 +239,21 @@ void LLFloaterTextureFetchDebugger::onClickStart() { disableButtons(); - mDebugger->startDebug(); + setStartStatus((S32)LLTextureFetchDebugger::START_DEBUG); mButtonStateMap["start_btn"] = false; - if(LLAppViewer::getTextureFetch()->canLoadFromCache()) - { - mButtonStateMap["cacheread_btn"] = true; - mButtonStateMap["http_btn"] = false; - mButtonStateMap["refetchviscache_btn"] = true; - mButtonStateMap["refetchvishttp_btn"] = false; - mButtonStateMap["refetchallcache_btn"] = true; - mButtonStateMap["refetchallhttp_btn"] = false; - mButtonStateMap["cachewrite_btn"] = false; - } - else + //if(LLAppViewer::getTextureFetch()->canLoadFromCache()) + //{ + // mButtonStateMap["cacheread_btn"] = true; + // mButtonStateMap["http_btn"] = false; + // mButtonStateMap["refetchviscache_btn"] = true; + // mButtonStateMap["refetchvishttp_btn"] = false; + // mButtonStateMap["refetchallcache_btn"] = true; + // mButtonStateMap["refetchallhttp_btn"] = false; + // mButtonStateMap["cachewrite_btn"] = false; + //} + //else { mButtonStateMap["cacheread_btn"] = true; mButtonStateMap["http_btn"] = true; @@ -214,7 +271,9 @@ void LLFloaterTextureFetchDebugger::onClickClose() setVisible(FALSE); //stop everything - mDebugger->stopDebug(); + mDebugger->setStopDebug(); + + delete this; } void LLFloaterTextureFetchDebugger::onClickClear() @@ -232,7 +291,7 @@ void LLFloaterTextureFetchDebugger::onClickClear() updateButtons(); //stop everything - mDebugger->stopDebug(); + mDebugger->setStopDebug(); mDebugger->clearHistory(); } @@ -240,63 +299,63 @@ void LLFloaterTextureFetchDebugger::onClickCacheRead() { disableButtons(); - mDebugger->debugCacheRead(); + setStartStatus((S32)LLTextureFetchDebugger::READ_CACHE); } void LLFloaterTextureFetchDebugger::onClickCacheWrite() { disableButtons(); - mDebugger->debugCacheWrite(); + setStartStatus((S32)LLTextureFetchDebugger::WRITE_CACHE); } void LLFloaterTextureFetchDebugger::onClickHTTPLoad() { disableButtons(); - mDebugger->debugHTTP(); + setStartStatus((S32)LLTextureFetchDebugger::HTTP_FETCHING); } void LLFloaterTextureFetchDebugger::onClickDecode() { disableButtons(); - mDebugger->debugDecoder(); + setStartStatus((S32)LLTextureFetchDebugger::DECODING); } void LLFloaterTextureFetchDebugger::onClickGLTexture() { disableButtons(); - mDebugger->debugGLTextureCreation(); + setStartStatus((S32)LLTextureFetchDebugger::GL_TEX); } void LLFloaterTextureFetchDebugger::onClickRefetchVisCache() { disableButtons(); - mDebugger->debugRefetchVisibleFromCache(); + setStartStatus((S32)LLTextureFetchDebugger::REFETCH_VIS_CACHE); } void LLFloaterTextureFetchDebugger::onClickRefetchVisHTTP() { disableButtons(); - mDebugger->debugRefetchVisibleFromHTTP(); + setStartStatus((S32)LLTextureFetchDebugger::REFETCH_VIS_HTTP); } void LLFloaterTextureFetchDebugger::onClickRefetchAllCache() { disableButtons(); - mDebugger->debugRefetchAllFromCache(); + setStartStatus((S32)LLTextureFetchDebugger::REFETCH_ALL_CACHE); } void LLFloaterTextureFetchDebugger::onClickRefetchAllHTTP() { disableButtons(); - mDebugger->debugRefetchAllFromHTTP(); + setStartStatus((S32)LLTextureFetchDebugger::REFETCH_ALL_HTTP); } void LLFloaterTextureFetchDebugger::draw() diff --git a/indra/newview/llfloatertexturefetchdebugger.h b/indra/newview/llfloatertexturefetchdebugger.h index da1bff19d5..096ad88e07 100644 --- a/indra/newview/llfloatertexturefetchdebugger.h +++ b/indra/newview/llfloatertexturefetchdebugger.h @@ -65,9 +65,12 @@ private: void updateButtons(); void disableButtons(); + void setStartStatus(S32 status); + bool idleStart(); private: LLTextureFetchDebugger* mDebugger; std::map mButtonStateMap; + S32 mStartStatus; }; #endif // LL_FLOATER_TEXTURE_FETCH_DEBUGGER__H diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 5e2141caf6..332b5e6f6a 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -695,7 +695,7 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mMetricsStartTime(0) { mCanUseNET = mUrl.empty() ; - + calcWorkPriority(); mType = host.isOk() ? LLImageBase::TYPE_AVATAR_BAKE : LLImageBase::TYPE_NORMAL; // llinfos << "Create: " << mID << " mHost:" << host << " Discard=" << discard << llendl; @@ -953,7 +953,7 @@ bool LLTextureFetchWorker::doWork(S32 param) offset, size, responder); mCacheReadTimer.reset(); } - else if(!mUrl.empty() && mCanUseHTTP && mFetcher->canLoadFromNetwork()) + else if(!mUrl.empty() && mCanUseHTTP) { if (!(mUrl.compare(0, 7, "http://") == 0)) { @@ -963,15 +963,11 @@ bool LLTextureFetchWorker::doWork(S32 param) setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); mState = SEND_HTTP_REQ; } - else if(mFetcher->canLoadFromNetwork()) + else { setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); mState = LOAD_FROM_NETWORK; } - else - { - return true; //failed - } } if (mLoaded) @@ -1019,15 +1015,12 @@ bool LLTextureFetchWorker::doWork(S32 param) return true; } // need more data - else if(mFetcher->canLoadFromNetwork()) + else { LL_DEBUGS("Texture") << mID << ": Not in Cache" << LL_ENDL; mState = LOAD_FROM_NETWORK; } - else - { - return true; //failed - } + // fall through LLTextureFetch::sCacheHitRate.addValue(0.f); } @@ -2306,6 +2299,10 @@ S32 LLTextureFetch::update(F32 max_time_ms) commonUpdate(); } + if(mFetchDebugger) + { + mFetchDebugger->tryToStopDebug(); //check if need to stop debugger. + } return res; } @@ -3192,7 +3189,8 @@ LLTextureFetchDebugger::LLTextureFetchDebugger(LLTextureFetch* fetcher, LLTextur LLTextureFetchDebugger::~LLTextureFetchDebugger() { mFetchingHistory.clear(); - stopDebug(); + mStopDebug = TRUE; + tryToStopDebug(); } void LLTextureFetchDebugger::init() @@ -3228,6 +3226,8 @@ void LLTextureFetchDebugger::init() mRefetchedAllPixels = 0; mFreezeHistory = FALSE; + mStopDebug = FALSE; + mClearHistory = FALSE; } void LLTextureFetchDebugger::startDebug() @@ -3235,6 +3235,7 @@ void LLTextureFetchDebugger::startDebug() //lock the fetcher mFetcher->lockFetcher(true); mFreezeHistory = TRUE; + mFetcher->resetLoadSource(); //clear the current fetching queue gTextureList.clearFetchingRequests(); @@ -3290,8 +3291,13 @@ void LLTextureFetchDebugger::startDebug() mNumFetchedTextures = fetched_textures.size(); } -void LLTextureFetchDebugger::stopDebug() +void LLTextureFetchDebugger::tryToStopDebug() { + if(!mStopDebug) + { + return; + } + //clear the current debug work S32 size = mFetchingHistory.size(); switch(mState) @@ -3320,35 +3326,50 @@ void LLTextureFetchDebugger::stopDebug() break; case GL_TEX: break; + case REFETCH_VIS_CACHE: + break; + case REFETCH_VIS_HTTP: + break; + case REFETCH_ALL_CACHE: + mRefetchList.clear(); + break; + case REFETCH_ALL_HTTP: + mRefetchList.clear(); + break; default: break; } - while(1) + if(update()) { - if(update()) + //unlock the fetcher + mFetcher->lockFetcher(false); + mFetcher->resetLoadSource(); + mFreezeHistory = FALSE; + mStopDebug = FALSE; + + if(mClearHistory) { - break; + mFetchingHistory.clear(); + init(); + mTotalFetchingTime = gDebugTimers[0].getElapsedTimeF32(); //reset } } - - //unlock the fetcher - mFetcher->lockFetcher(false); - mFetcher->resetLoadSource(); - mFreezeHistory = FALSE; - mTotalFetchingTime = gDebugTimers[0].getElapsedTimeF32(); //reset - mRefetchList.clear(); } //called in the main thread and when the fetching queue is empty void LLTextureFetchDebugger::clearHistory() { - mFetchingHistory.clear(); - init(); + mClearHistory = TRUE; } void LLTextureFetchDebugger::addHistoryEntry(LLTextureFetchWorker* worker) { + if(worker->mRawImage.isNull() || worker->mFormattedImage.isNull()) + { + return; + } + if(mFreezeHistory) { if(mState == REFETCH_VIS_CACHE || mState == REFETCH_VIS_HTTP) @@ -3517,6 +3538,12 @@ void LLTextureFetchDebugger::debugHTTP() S32 LLTextureFetchDebugger::fillCurlQueue() { + if(mStopDebug) //stop + { + mNbCurlCompleted = mFetchingHistory.size(); + return 0; + } + if (mNbCurlRequests == 24) return mNbCurlRequests; @@ -3624,6 +3651,15 @@ void LLTextureFetchDebugger::makeRefetchList() void LLTextureFetchDebugger::scanRefetchList() { + if(mStopDebug) + { + return; + } + if(!mRefetchNonVis) + { + return; + } + for(std::map< LLPointer, std::vector >::iterator iter = mRefetchList.begin(); iter != mRefetchList.end(); ) { @@ -3646,14 +3682,13 @@ void LLTextureFetchDebugger::debugRefetchVisibleFromCache() mState = REFETCH_VIS_CACHE; clearTextures(); - mFetcher->setLoadSource(LLTextureFetch::FROM_CACHE_ONLY); - + mFetcher->setLoadSource(LLTextureFetch::FROM_ALL); + mTimer.reset(); mFetcher->lockFetcher(false); mRefetchVisCacheTime = -1.f; mRefetchedVisData = 0; mRefetchedVisPixels = 0; - mRefetchStartTime = gDebugTimers[0].getElapsedTimeF32(); } void LLTextureFetchDebugger::debugRefetchVisibleFromHTTP() @@ -3661,16 +3696,14 @@ void LLTextureFetchDebugger::debugRefetchVisibleFromHTTP() llassert_always(mState == IDLE); mState = REFETCH_VIS_HTTP; - clearCache(); clearTextures(); - mFetcher->setLoadSource(LLTextureFetch::FROM_NETWORK_ONLY); + mFetcher->setLoadSource(LLTextureFetch::FROM_HTTP_ONLY); mTimer.reset(); mFetcher->lockFetcher(false); mRefetchVisHTTPTime = -1.f; mRefetchedVisData = 0; mRefetchedVisPixels = 0; - mRefetchStartTime = gDebugTimers[0].getElapsedTimeF32(); } void LLTextureFetchDebugger::debugRefetchAllFromCache() @@ -3680,14 +3713,14 @@ void LLTextureFetchDebugger::debugRefetchAllFromCache() clearTextures(); makeRefetchList(); - mFetcher->setLoadSource(LLTextureFetch::FROM_CACHE_ONLY); + mFetcher->setLoadSource(LLTextureFetch::FROM_ALL); mTimer.reset(); mFetcher->lockFetcher(false); mRefetchAllCacheTime = -1.f; mRefetchedAllData = 0; mRefetchedAllPixels = 0; - mRefetchStartTime = gDebugTimers[0].getElapsedTimeF32(); + mRefetchNonVis = FALSE; } void LLTextureFetchDebugger::debugRefetchAllFromHTTP() @@ -3695,17 +3728,16 @@ void LLTextureFetchDebugger::debugRefetchAllFromHTTP() llassert_always(mState == IDLE); mState = REFETCH_ALL_HTTP; - clearCache(); clearTextures(); makeRefetchList(); - mFetcher->setLoadSource(LLTextureFetch::FROM_NETWORK_ONLY); + mFetcher->setLoadSource(LLTextureFetch::FROM_HTTP_ONLY); mTimer.reset(); mFetcher->lockFetcher(false); mRefetchAllHTTPTime = -1.f; mRefetchedAllData = 0; mRefetchedAllPixels = 0; - mRefetchStartTime = gDebugTimers[0].getElapsedTimeF32(); + mRefetchNonVis = TRUE; } bool LLTextureFetchDebugger::update() @@ -3751,7 +3783,7 @@ bool LLTextureFetchDebugger::update() case REFETCH_VIS_CACHE: if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) { - mRefetchVisCacheTime = gDebugTimers[0].getElapsedTimeF32() - mRefetchStartTime; + mRefetchVisCacheTime = mTimer.getElapsedTimeF32() ; mState = IDLE; mFetcher->lockFetcher(true); mFetcher->resetLoadSource(); @@ -3760,7 +3792,7 @@ bool LLTextureFetchDebugger::update() case REFETCH_VIS_HTTP: if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) { - mRefetchVisHTTPTime = gDebugTimers[0].getElapsedTimeF32() - mRefetchStartTime; + mRefetchVisHTTPTime = mTimer.getElapsedTimeF32() ; mState = IDLE; mFetcher->lockFetcher(true); mFetcher->resetLoadSource(); @@ -3770,22 +3802,31 @@ bool LLTextureFetchDebugger::update() scanRefetchList(); if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) { - mRefetchAllCacheTime = gDebugTimers[0].getElapsedTimeF32() - mRefetchStartTime; - mState = IDLE; + if(!mRefetchNonVis) + { + mRefetchNonVis = TRUE; //start to fetch non-vis + scanRefetchList(); + break; + } + + mRefetchAllCacheTime = mTimer.getElapsedTimeF32() ; + mState = IDLE; mFetcher->lockFetcher(true); mFetcher->resetLoadSource(); mRefetchList.clear(); + mRefetchNonVis = FALSE; } break; case REFETCH_ALL_HTTP: scanRefetchList(); if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) { - mRefetchAllHTTPTime = gDebugTimers[0].getElapsedTimeF32() - mRefetchStartTime; + mRefetchAllHTTPTime = mTimer.getElapsedTimeF32() ; mState = IDLE; mFetcher->lockFetcher(true); mFetcher->resetLoadSource(); mRefetchList.clear(); + mRefetchNonVis = FALSE; } break; default: diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index ff78d34eda..436306398e 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -221,8 +221,7 @@ public: enum e_tex_source { FROM_ALL = 0, - FROM_CACHE_ONLY, - FROM_NETWORK_ONLY, + FROM_HTTP_ONLY, INVALID_SOURCE }; private: @@ -240,8 +239,7 @@ public: void setLoadSource(e_tex_source source) {mFetchSource = source;} void resetLoadSource() {mFetchSource = mOriginFetchSource;} - bool canLoadFromCache() { return mFetchSource != FROM_NETWORK_ONLY;} - bool canLoadFromNetwork() { return mFetchSource != FROM_CACHE_ONLY;} + bool canLoadFromCache() { return mFetchSource != FROM_HTTP_ONLY;} }; //debug use @@ -257,6 +255,7 @@ public: enum e_debug_state { IDLE = 0, + START_DEBUG, READ_CACHE, WRITE_CACHE, DECODING, @@ -347,13 +346,15 @@ private: U32 mRefetchedAllPixels; BOOL mFreezeHistory; + BOOL mStopDebug; + BOOL mClearHistory; + BOOL mRefetchNonVis; std::string mHTTPUrl; S32 mNbCurlRequests; S32 mNbCurlCompleted; std::map< LLPointer, std::vector > mRefetchList; - F32 mRefetchStartTime; public: bool update(); //called in the main thread once per frame @@ -364,7 +365,8 @@ public: void setCurlGetRequest(LLCurlRequest* request) { mCurlGetRequest = request;} void startDebug(); - void stopDebug(); //stop everything + void setStopDebug() {mStopDebug = TRUE;} + void tryToStopDebug(); //stop everything void debugCacheRead(); void debugCacheWrite(); void debugHTTP(); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 684d1afa4f..511fc13973 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -409,7 +409,11 @@ void LLViewerTextureManager::cleanup() void LLViewerTexture::initClass() { LLImageGL::sDefaultGLTexture = LLViewerFetchedTexture::sDefaultImagep->getGLTexture() ; - sTexelPixelRatio = gSavedSettings.getF32("TexelPixelRatio"); + + if(gSavedSettings.getBOOL("TextureFetchDebuggerEnabled")) + { + sTexelPixelRatio = gSavedSettings.getF32("TexelPixelRatio"); + } } // static @@ -2168,7 +2172,10 @@ bool LLViewerFetchedTexture::updateFetch() void LLViewerFetchedTexture::clearFetchedResults() { - llassert_always(!mNeedsCreateTexture && !mIsFetching); + if(mNeedsCreateTexture || mIsFetching) + { + return ; + } cleanup(); destroyGLTexture(); diff --git a/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml b/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml index ca2f9bfd94..6fbdd8a318 100644 --- a/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml +++ b/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml @@ -266,7 +266,7 @@ width="264"> - -- cgit v1.2.3 From 327970a2169998bc8c01d6c3a88a5b3799b82502 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 7 May 2012 13:32:13 -0700 Subject: Fix Mac and Linux compile error in lltexturefetch.cpp --- indra/newview/lltexturefetch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 332b5e6f6a..541f9bd12b 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -3666,7 +3666,7 @@ void LLTextureFetchDebugger::scanRefetchList() if(iter->second.empty()) { gTextureList.setDebugFetching(iter->first, -1); - iter = mRefetchList.erase(iter); + mRefetchList.erase(iter++); // This is the correct method to "erase and move on" in an std::map } else { -- cgit v1.2.3 From 3eb139419c806f1aa68ba86bf3a44b53ef2c1102 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 7 May 2012 13:53:39 -0700 Subject: SH-3126 : Clean up stray comment --- indra/newview/lltexturefetch.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index a25876a1e6..c7f522fc68 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -780,7 +780,6 @@ U32 LLTextureFetchWorker::calcWorkPriority() } // mWorkMutex is locked -// Merov : Change so to take into account size == 0 == max void LLTextureFetchWorker::setDesiredDiscard(S32 discard, S32 size) { bool prioritize = false; -- cgit v1.2.3 From ccb86a2a6675b21dda6267d4a850e5a09acbafa4 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 7 May 2012 18:51:33 -0700 Subject: SH-3126 : Cleanup image completion test as per Bao's review --- indra/newview/lltexturefetch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index c7f522fc68..60d38e7436 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1714,7 +1714,7 @@ S32 LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels, mBuffer = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), data_size); buffer->readAfter(channels.in(), NULL, mBuffer, data_size); mBufferSize += data_size; - if ((data_size < mRequestedSize) || (mRequestedSize == 0)) + if (mRequestedSize == 0) { mHaveAllData = TRUE; } -- cgit v1.2.3 From 29da931051202a10ea71db56e47acecae1603a5d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 8 May 2012 10:16:14 -0700 Subject: SH-3047 : Tweak of the performance compression data gathering code --- indra/llimage/llimagej2c.cpp | 6 +++++- indra/llimage/llimagej2c.h | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index a0e90b6b08..3c3cf980ca 100755 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -464,6 +464,7 @@ LLImageCompressionTester::LLImageCompressionTester() : LLMetricPerformanceTester addMetric("Perf Compression (kB/s)"); mRunBytesInDecompression = 0; + mRunBytesOutDecompression = 0; mRunBytesInCompression = 0; mTotalBytesInDecompression = 0; @@ -556,13 +557,16 @@ void LLImageCompressionTester::updateDecompressionStats(const S32 bytesIn, const mTotalBytesInDecompression += bytesIn; mRunBytesInDecompression += bytesIn; mTotalBytesOutDecompression += bytesOut; + mRunBytesOutDecompression += bytesOut; //if (mRunBytesInDecompression > (1000000)) - if ((mTotalTimeDecompression - mRunTimeDecompression) >= (5.0f)) + if (mRunBytesOutDecompression > (10000000)) + //if ((mTotalTimeDecompression - mRunTimeDecompression) >= (5.0f)) { // Output everything outputTestResults(); // Reset the decompression data of the run mRunBytesInDecompression = 0; + mRunBytesOutDecompression = 0; mRunTimeDecompression = mTotalTimeDecompression; } } diff --git a/indra/llimage/llimagej2c.h b/indra/llimage/llimagej2c.h index 42093e0e64..ce8195940d 100644 --- a/indra/llimage/llimagej2c.h +++ b/indra/llimage/llimagej2c.h @@ -156,7 +156,8 @@ class LLImageCompressionTester : public LLMetricPerformanceTesterBasic U32 mTotalBytesOutDecompression; // Total bytes produced by decompressor U32 mTotalBytesInCompression; // Total bytes fed to compressor U32 mTotalBytesOutCompression; // Total bytes produced by compressor - U32 mRunBytesInDecompression; // Bytes fed to decompressor in this run + U32 mRunBytesInDecompression; // Bytes fed to decompressor in this run + U32 mRunBytesOutDecompression; // Bytes produced by the decompressor in this run U32 mRunBytesInCompression; // Bytes fed to compressor in this run // // Time -- cgit v1.2.3 From 5caea1bcae24688bf3bbc3172a811bcccd4c3016 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 8 May 2012 16:02:24 -0600 Subject: For SH-3086. Make the fetch debugger not to stall the main thread. --- indra/newview/llfloatertexturefetchdebugger.cpp | 70 +++----------- indra/newview/lltexturefetch.cpp | 120 +++++++++++++++++++++--- indra/newview/lltexturefetch.h | 33 ++++--- 3 files changed, 137 insertions(+), 86 deletions(-) diff --git a/indra/newview/llfloatertexturefetchdebugger.cpp b/indra/newview/llfloatertexturefetchdebugger.cpp index 02872f54a0..9157389187 100644 --- a/indra/newview/llfloatertexturefetchdebugger.cpp +++ b/indra/newview/llfloatertexturefetchdebugger.cpp @@ -134,46 +134,9 @@ void LLFloaterTextureFetchDebugger::setStartStatus(S32 status) bool LLFloaterTextureFetchDebugger::idleStart() { - switch((LLTextureFetchDebugger::e_debug_state)mStartStatus) - { - case LLTextureFetchDebugger::IDLE: - break; - case LLTextureFetchDebugger::START_DEBUG: - mDebugger->startDebug(); - break; - case LLTextureFetchDebugger::READ_CACHE: - mDebugger->debugCacheRead(); - break; - case LLTextureFetchDebugger::WRITE_CACHE: - mDebugger->debugCacheWrite(); - break; - case LLTextureFetchDebugger::DECODING: - mDebugger->debugDecoder(); - break; - case LLTextureFetchDebugger::HTTP_FETCHING: - mDebugger->debugHTTP(); - break; - case LLTextureFetchDebugger::GL_TEX: - mDebugger->debugGLTextureCreation(); - break; - case LLTextureFetchDebugger::REFETCH_VIS_CACHE: - mDebugger->debugRefetchVisibleFromCache(); - break; - case LLTextureFetchDebugger::REFETCH_VIS_HTTP: - mDebugger->debugRefetchVisibleFromHTTP(); - break; - case LLTextureFetchDebugger::REFETCH_ALL_CACHE: - mDebugger->debugRefetchAllFromCache(); - break; - case LLTextureFetchDebugger::REFETCH_ALL_HTTP: - mDebugger->debugRefetchAllFromHTTP(); - break; - default: - break; - } - if(mStartStatus != (S32)LLTextureFetchDebugger::IDLE) { + mDebugger->startWork((LLTextureFetchDebugger::e_debug_state)mStartStatus); mStartStatus = (S32)LLTextureFetchDebugger::IDLE; return true; } @@ -188,13 +151,22 @@ void LLFloaterTextureFetchDebugger::idle() return; } + const F32 max_time = 0.005f; //5ms LLTextureFetchDebugger::e_debug_state state = mDebugger->getState(); - if(mDebugger->update()) + if(mDebugger->update(max_time)) { switch(state) { case LLTextureFetchDebugger::IDLE: break; + case LLTextureFetchDebugger::START_DEBUG: + mButtonStateMap["cacheread_btn"] = true; + mButtonStateMap["http_btn"] = true; + mButtonStateMap["refetchviscache_btn"] = true; + mButtonStateMap["refetchvishttp_btn"] = true; + mButtonStateMap["refetchallcache_btn"] = true; + mButtonStateMap["refetchallhttp_btn"] = true; + break; case LLTextureFetchDebugger::READ_CACHE: mButtonStateMap["decode_btn"] = true; break; @@ -243,26 +215,6 @@ void LLFloaterTextureFetchDebugger::onClickStart() mButtonStateMap["start_btn"] = false; - //if(LLAppViewer::getTextureFetch()->canLoadFromCache()) - //{ - // mButtonStateMap["cacheread_btn"] = true; - // mButtonStateMap["http_btn"] = false; - // mButtonStateMap["refetchviscache_btn"] = true; - // mButtonStateMap["refetchvishttp_btn"] = false; - // mButtonStateMap["refetchallcache_btn"] = true; - // mButtonStateMap["refetchallhttp_btn"] = false; - // mButtonStateMap["cachewrite_btn"] = false; - //} - //else - { - mButtonStateMap["cacheread_btn"] = true; - mButtonStateMap["http_btn"] = true; - mButtonStateMap["refetchviscache_btn"] = true; - mButtonStateMap["refetchvishttp_btn"] = true; - mButtonStateMap["refetchallcache_btn"] = true; - mButtonStateMap["refetchallhttp_btn"] = true; - } - updateButtons(); } diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 332b5e6f6a..a4c8993ae6 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -3230,6 +3230,48 @@ void LLTextureFetchDebugger::init() mClearHistory = FALSE; } +void LLTextureFetchDebugger::startWork(e_debug_state state) +{ + switch(state) + { + case IDLE: + break; + case START_DEBUG: + startDebug(); + break; + case READ_CACHE: + debugCacheRead(); + break; + case WRITE_CACHE: + debugCacheWrite(); + break; + case DECODING: + debugDecoder(); + break; + case HTTP_FETCHING: + debugHTTP(); + break; + case GL_TEX: + debugGLTextureCreation(); + break; + case REFETCH_VIS_CACHE: + debugRefetchVisibleFromCache(); + break; + case REFETCH_VIS_HTTP: + debugRefetchVisibleFromHTTP(); + break; + case REFETCH_ALL_CACHE: + debugRefetchAllFromCache(); + break; + case REFETCH_ALL_HTTP: + debugRefetchAllFromHTTP(); + break; + default: + break; + } + return; +} + void LLTextureFetchDebugger::startDebug() { //lock the fetcher @@ -3240,6 +3282,13 @@ void LLTextureFetchDebugger::startDebug() //clear the current fetching queue gTextureList.clearFetchingRequests(); + mState = START_DEBUG; +} + +bool LLTextureFetchDebugger::processStartDebug(F32 max_time) +{ + mTimer.reset(); + //wait for all works to be done while(1) { @@ -3251,6 +3300,11 @@ void LLTextureFetchDebugger::startDebug() { break; } + + if(mTimer.getElapsedTimeF32() > max_time) + { + return false; + } } //collect statistics @@ -3289,6 +3343,8 @@ void LLTextureFetchDebugger::startDebug() } mNumFetchedTextures = fetched_textures.size(); + + return true; } void LLTextureFetchDebugger::tryToStopDebug() @@ -3340,7 +3396,7 @@ void LLTextureFetchDebugger::tryToStopDebug() break; } - if(update()) + if(update(0.005f)) { //unlock the fetcher mFetcher->lockFetcher(false); @@ -3582,7 +3638,7 @@ void LLTextureFetchDebugger::debugGLTextureCreation() { llassert_always(mState == IDLE); mState = GL_TEX; - std::vector tex_list; + mTempTexList.clear(); S32 size = mFetchingHistory.size(); for(S32 i = 0 ; i < size ; i++) @@ -3593,30 +3649,54 @@ void LLTextureFetchDebugger::debugGLTextureCreation() if(tex && !tex->isForSculptOnly()) { tex->destroyGLTexture() ; - tex_list.push_back(tex); + mTempTexList.push_back(tex); } } } + + mGLCreationTime = -1.f; + mTempIndex = 0; + mHistoryListIndex = 0; + + return; +} +bool LLTextureFetchDebugger::processGLCreation(F32 max_time) +{ mTimer.reset(); - mGLCreationTime = -1.f; - S32 j = 0 ; - S32 size1 = tex_list.size(); - for(S32 i = 0 ; i < size && j < size1; i++) + bool done = true; + S32 size = mFetchingHistory.size(); + S32 size1 = mTempTexList.size(); + for(; mHistoryListIndex < size && mTempIndex < size1; mHistoryListIndex++) { - if(mFetchingHistory[i].mRawImage.notNull()) + if(mFetchingHistory[mHistoryListIndex].mRawImage.notNull()) { - if(mFetchingHistory[i].mID == tex_list[j]->getID()) + if(mFetchingHistory[mHistoryListIndex].mID == mTempTexList[mTempIndex]->getID()) { - tex_list[j]->createGLTexture(mFetchingHistory[i].mDecodedLevel, mFetchingHistory[i].mRawImage, 0, TRUE, tex_list[j]->getBoostLevel()); - j++; + mTempTexList[mTempIndex]->createGLTexture(mFetchingHistory[mHistoryListIndex].mDecodedLevel, + mFetchingHistory[mHistoryListIndex].mRawImage, 0, TRUE, mTempTexList[mTempIndex]->getBoostLevel()); + mTempIndex++; } } + + if(mTimer.getElapsedTimeF32() > max_time) + { + done = false; + break; + } } - mGLCreationTime = mTimer.getElapsedTimeF32() ; - return; + if(mGLCreationTime < 0.f) + { + mGLCreationTime = mTimer.getElapsedTimeF32() ; + } + else + { + mGLCreationTime += mTimer.getElapsedTimeF32() ; + } + + return done; } //clear fetching results of all textures. @@ -3740,10 +3820,16 @@ void LLTextureFetchDebugger::debugRefetchAllFromHTTP() mRefetchNonVis = TRUE; } -bool LLTextureFetchDebugger::update() +bool LLTextureFetchDebugger::update(F32 max_time) { switch(mState) { + case START_DEBUG: + if(processStartDebug(max_time)) + { + mState = IDLE; + } + break; case READ_CACHE: if(!mTextureCache->update(1)) { @@ -3778,7 +3864,11 @@ bool LLTextureFetchDebugger::update() } break; case GL_TEX: - mState = IDLE; + if(processGLCreation(max_time)) + { + mState = IDLE; + mTempTexList.clear(); + } break; case REFETCH_VIS_CACHE: if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 436306398e..d7677295c0 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -355,8 +355,12 @@ private: S32 mNbCurlCompleted; std::map< LLPointer, std::vector > mRefetchList; + std::vector< LLPointer > mTempTexList; + S32 mTempIndex; + S32 mHistoryListIndex; + public: - bool update(); //called in the main thread once per frame + bool update(F32 max_time); //called in the main thread once per frame //fetching history void clearHistory(); @@ -364,19 +368,10 @@ public: void setCurlGetRequest(LLCurlRequest* request) { mCurlGetRequest = request;} - void startDebug(); + void startWork(e_debug_state state); void setStopDebug() {mStopDebug = TRUE;} void tryToStopDebug(); //stop everything - void debugCacheRead(); - void debugCacheWrite(); - void debugHTTP(); - void debugDecoder(); - void debugGLTextureCreation(); - void debugRefetchVisibleFromCache(); - void debugRefetchVisibleFromHTTP(); - void debugRefetchAllFromCache(); - void debugRefetchAllFromHTTP(); - + void callbackCacheRead(S32 id, bool success, LLImageFormatted* image, S32 imagesize, BOOL islocal); void callbackCacheWrite(S32 id, bool success); @@ -434,6 +429,20 @@ private: S32 fillCurlQueue(); + void startDebug(); + void debugCacheRead(); + void debugCacheWrite(); + void debugHTTP(); + void debugDecoder(); + void debugGLTextureCreation(); + void debugRefetchVisibleFromCache(); + void debugRefetchVisibleFromHTTP(); + void debugRefetchAllFromCache(); + void debugRefetchAllFromHTTP(); + + bool processStartDebug(F32 max_time); + bool processGLCreation(F32 max_time); + private: static bool sDebuggerEnabled; public: -- cgit v1.2.3 From 28cf5199ce783eddd89bad5b8b41318abf7c7dff Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 8 May 2012 21:42:53 -0700 Subject: SH-3047 : Fix lossless compression for small textures. --- indra/llkdu/llimagej2ckdu.cpp | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index cbfc34ebb8..53d2a2f3c5 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -619,36 +619,27 @@ BOOL LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co // This code is where we specify the target number of bytes for each quality layer. // We're using a logarithmic spacing rule that fits with our way of fetching texture data. // Note: For more info on this layers business, read kdu_codestream::flush() doc in kdu_compressed.h - U32 i = FIRST_PACKET_SIZE; + layer_bytes[nb_layers++] = FIRST_PACKET_SIZE; + U32 i = MIN_LAYER_SIZE; while ((i < max_bytes) && (nb_layers < (MAX_NB_LAYERS-1))) { - if (i == FIRST_PACKET_SIZE * 4) - { - // That really just means that the first layer is FIRST_PACKET_SIZE and the second is MIN_LAYER_SIZE - i = MIN_LAYER_SIZE; - } - layer_bytes[nb_layers] = i; - nb_layers++; + layer_bytes[nb_layers++] = i; i *= 4; } + if (layer_bytes[nb_layers-1] < max_bytes) + { + // Set the last quality layer if necessary so to fit the preset compression ratio + // Use 0 for that last layer for reversible images so all remaining code blocks will be flushed + layer_bytes[nb_layers++] = (reversible ? 0 : max_bytes); + } if (reversible) { codestream.access_siz()->parse_string("Creversible=yes"); - // *TODO: we should use yuv in reversible mode and one res level since those images are small. - // Don't turn this on now though as both create problems on decoding for the moment - //codestream.access_siz()->parse_string("Clevels=1"); + // *TODO: we should use yuv in reversible mode + // Don't turn this on now though as it creates problems on decoding for the moment //codestream.access_siz()->parse_string("Cycc=no"); - // In the reversible case, set the last entry of that table to 0 so that all generated bits will - // indeed be output by the time the last quality layer is encountered. - layer_bytes[nb_layers] = 0; - } - else - { - // Truncate the last quality layer if necessary so to fit the set compression ratio - layer_bytes[nb_layers] = max_bytes; } - nb_layers++; std::string layer_string = llformat("Clayers=%d",nb_layers); codestream.access_siz()->parse_string(layer_string.c_str()); -- cgit v1.2.3 From e8ef6fd0e7d0830a5939ab7f0bbe5a7d280c719f Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 9 May 2012 17:04:02 -0700 Subject: SH-3075 : Fix reversible compression for very small textures. Also supress the forcing to reversible for small textures. --- indra/llkdu/llimagej2ckdu.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index 53d2a2f3c5..cf88de12b4 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -609,13 +609,6 @@ BOOL LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co llassert (base.mRate > 0.f); max_bytes = (U32)((F32)(max_bytes) * base.mRate); - // If the image is very small, code it in a lossless way. - // Note: it'll also have only 1 layer which is fine as there's no point reordering blocks in that case. - if (max_bytes < FIRST_PACKET_SIZE) - { - reversible = true; - } - // This code is where we specify the target number of bytes for each quality layer. // We're using a logarithmic spacing rule that fits with our way of fetching texture data. // Note: For more info on this layers business, read kdu_codestream::flush() doc in kdu_compressed.h @@ -626,27 +619,32 @@ BOOL LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co layer_bytes[nb_layers++] = i; i *= 4; } + // Note: for small images, we can have (max_bytes < FIRST_PACKET_SIZE), hence the test if (layer_bytes[nb_layers-1] < max_bytes) { - // Set the last quality layer if necessary so to fit the preset compression ratio - // Use 0 for that last layer for reversible images so all remaining code blocks will be flushed - layer_bytes[nb_layers++] = (reversible ? 0 : max_bytes); + // Set the last quality layer so to fit the preset compression ratio + layer_bytes[nb_layers++] = max_bytes; } if (reversible) { + // Use 0 for a last quality layer for reversible images so all remaining code blocks will be flushed + // Hack: KDU encoding for reversible images has a bug for small images that leads to j2c images that + // cannot be open or are very blurry. Avoiding that last layer prevents the problem to happen. + if ((base.getWidth() >= 32) || (base.getHeight() >= 32)) + { + layer_bytes[nb_layers++] = 0; + } codestream.access_siz()->parse_string("Creversible=yes"); // *TODO: we should use yuv in reversible mode // Don't turn this on now though as it creates problems on decoding for the moment //codestream.access_siz()->parse_string("Cycc=no"); } - + std::string layer_string = llformat("Clayers=%d",nb_layers); codestream.access_siz()->parse_string(layer_string.c_str()); // Set up data ordering, markers, etc... if precincts or blocks specified - // Note: This code is *not* used in the encoding made by the viewer. It is currently used only - // by llimage_libtest to create various j2c and test alternative compression schemes. if ((mBlocksSize != -1) || (mPrecinctsSize != -1)) { if (mPrecinctsSize != -1) -- cgit v1.2.3 From b73527420b4e664978f8d5587b7801435a7b56ca Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 10 May 2012 11:04:51 -0600 Subject: fix for SH-3132: Many "HTTP GET failed errors" with Drano merge candidate 255539 --- indra/newview/lltexturefetch.cpp | 54 ++++++++++++++++++++++++++++++++++++---- indra/newview/lltexturefetch.h | 7 ++++++ 2 files changed, 56 insertions(+), 5 deletions(-) diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index eac6abc1ca..e96bcd2ad0 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1162,8 +1162,7 @@ bool LLTextureFetchWorker::doWork(S32 param) //1, not openning too many file descriptors at the same time; //2, control the traffic of http so udp gets bandwidth. // - static const S32 MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE = 24 ; - if(mFetcher->getNumHTTPRequests() > MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE) + if(!mFetcher->canIssueHTTPRequest()) { return false ; //wait. } @@ -1275,6 +1274,7 @@ bool LLTextureFetchWorker::doWork(S32 param) // requests instead of returning 503... we already limit the number pending. ++mHTTPFailCount; max_attempts = mHTTPFailCount+1; // Keep retrying + mFetcher->adjustHTTPConcurrency(false); LL_INFOS_ONCE("Texture") << "Texture server busy (503): " << mUrl << LL_ENDL; } else @@ -1282,6 +1282,7 @@ bool LLTextureFetchWorker::doWork(S32 param) const S32 HTTP_MAX_RETRY_COUNT = 3; max_attempts = HTTP_MAX_RETRY_COUNT + 1; ++mHTTPFailCount; + mFetcher->adjustHTTPConcurrency(false); llinfos << "HTTP GET failed for: " << mUrl << " Status: " << mGetStatus << " Reason: '" << mGetReason << "'" << " Attempt:" << mHTTPFailCount+1 << "/" << max_attempts << llendl; @@ -1869,7 +1870,8 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mQAMode(qa_mode), mFetchDebugger(NULL), mFetchSource(LLTextureFetch::FROM_ALL), - mOriginFetchSource(LLTextureFetch::FROM_ALL) + mOriginFetchSource(LLTextureFetch::FROM_ALL), + mHTTPConcurrency(24) { mCurlPOSTRequestCount = 0; mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS"); @@ -2094,6 +2096,42 @@ S32 LLTextureFetch::getNumRequests() return size ; } +bool LLTextureFetch::canIssueHTTPRequest() +{ + LLMutexLock lock(&mNetworkQueueMutex); + + return (S32)mHTTPTextureQueue.size() < mHTTPConcurrency ; +} + +void LLTextureFetch::adjustHTTPConcurrency(bool success) +{ + static LLTimer timer; + + LLMutexLock lock(&mNetworkQueueMutex); + if(success) + { + if(mHTTPConcurrency < 21 && timer.getElapsedTimeF32() > 15.f) //seconds + { + mHTTPConcurrency += 4; //max is 24 + timer.reset(); + } + } + else + { + if(mHTTPConcurrency > 11 && timer.getElapsedTimeF32() > 2.0f) + { + mHTTPConcurrency -= 8; //min is 4 + timer.reset(); + } + } +} + +S32 LLTextureFetch::getHTTPConcurrency() +{ + LLMutexLock lock(&mNetworkQueueMutex); + return mHTTPConcurrency; +} + S32 LLTextureFetch::getNumHTTPRequests() { mNetworkQueueMutex.lock() ; @@ -2311,6 +2349,9 @@ S32 LLTextureFetch::update(F32 max_time_ms) { mFetchDebugger->tryToStopDebug(); //check if need to stop debugger. } + + adjustHTTPConcurrency(true); + return res; } @@ -3608,7 +3649,8 @@ S32 LLTextureFetchDebugger::fillCurlQueue() return 0; } - if (mNbCurlRequests == 24) + S32 max_concurrency = mFetcher->getHTTPConcurrency(); + if (mNbCurlRequests == max_concurrency) return mNbCurlRequests; S32 size = mFetchingHistory.size(); @@ -3630,7 +3672,7 @@ S32 LLTextureFetchDebugger::fillCurlQueue() mFetchingHistory[i].mCurlState = FetchEntry::CURL_IN_PROGRESS; mNbCurlRequests++; // Hack - if (mNbCurlRequests == 24) + if (mNbCurlRequests == max_concurrency) break; } else @@ -4007,6 +4049,8 @@ void LLTextureFetchDebugger::callbackHTTP(S32 id, const LLChannelDescriptors& ch mFetchingHistory[id].mCurlState = FetchEntry::CURL_DONE; mNbCurlCompleted++; } + + mFetcher->adjustHTTPConcurrency(false); } } diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index d7677295c0..3ac08ecbc2 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -109,6 +109,10 @@ public: inline void incrCurlPOSTCount() { mCurlPOSTRequestCount++; } inline void decrCurlPOSTCount() { mCurlPOSTRequestCount--; } + bool canIssueHTTPRequest(); + void adjustHTTPConcurrency(bool success); + S32 getHTTPConcurrency(); + protected: void addToNetworkQueue(LLTextureFetchWorker* worker); void removeFromNetworkQueue(LLTextureFetchWorker* worker, bool cancel); @@ -209,6 +213,9 @@ private: // use the LLCurl module's request counter as it isn't thread compatible. // *NOTE: Don't mix Atomic and static, apr_initialize must be called first. LLAtomic32 mCurlPOSTRequestCount; + + //control http concurrency for texture fetching + S32 mHTTPConcurrency; //which is adaptive to the network situation at an instant public: // A probabilistically-correct indicator that the current -- cgit v1.2.3 From a4eb314b76f7dfb490bed1868eed8af2315c48c8 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 10 May 2012 14:56:52 -0600 Subject: for SH-3132. roll back http concurrency for texture fetching back to 8. --- indra/newview/lltexturefetch.cpp | 33 ++------------------------------- indra/newview/lltexturefetch.h | 1 - 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index e96bcd2ad0..8ac6acf877 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1274,7 +1274,6 @@ bool LLTextureFetchWorker::doWork(S32 param) // requests instead of returning 503... we already limit the number pending. ++mHTTPFailCount; max_attempts = mHTTPFailCount+1; // Keep retrying - mFetcher->adjustHTTPConcurrency(false); LL_INFOS_ONCE("Texture") << "Texture server busy (503): " << mUrl << LL_ENDL; } else @@ -1282,7 +1281,6 @@ bool LLTextureFetchWorker::doWork(S32 param) const S32 HTTP_MAX_RETRY_COUNT = 3; max_attempts = HTTP_MAX_RETRY_COUNT + 1; ++mHTTPFailCount; - mFetcher->adjustHTTPConcurrency(false); llinfos << "HTTP GET failed for: " << mUrl << " Status: " << mGetStatus << " Reason: '" << mGetReason << "'" << " Attempt:" << mHTTPFailCount+1 << "/" << max_attempts << llendl; @@ -1871,7 +1869,7 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mFetchDebugger(NULL), mFetchSource(LLTextureFetch::FROM_ALL), mOriginFetchSource(LLTextureFetch::FROM_ALL), - mHTTPConcurrency(24) + mHTTPConcurrency(8) { mCurlPOSTRequestCount = 0; mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS"); @@ -2103,32 +2101,9 @@ bool LLTextureFetch::canIssueHTTPRequest() return (S32)mHTTPTextureQueue.size() < mHTTPConcurrency ; } -void LLTextureFetch::adjustHTTPConcurrency(bool success) -{ - static LLTimer timer; - - LLMutexLock lock(&mNetworkQueueMutex); - if(success) - { - if(mHTTPConcurrency < 21 && timer.getElapsedTimeF32() > 15.f) //seconds - { - mHTTPConcurrency += 4; //max is 24 - timer.reset(); - } - } - else - { - if(mHTTPConcurrency > 11 && timer.getElapsedTimeF32() > 2.0f) - { - mHTTPConcurrency -= 8; //min is 4 - timer.reset(); - } - } -} - S32 LLTextureFetch::getHTTPConcurrency() { - LLMutexLock lock(&mNetworkQueueMutex); + //LLMutexLock lock(&mNetworkQueueMutex); return mHTTPConcurrency; } @@ -2350,8 +2325,6 @@ S32 LLTextureFetch::update(F32 max_time_ms) mFetchDebugger->tryToStopDebug(); //check if need to stop debugger. } - adjustHTTPConcurrency(true); - return res; } @@ -4049,8 +4022,6 @@ void LLTextureFetchDebugger::callbackHTTP(S32 id, const LLChannelDescriptors& ch mFetchingHistory[id].mCurlState = FetchEntry::CURL_DONE; mNbCurlCompleted++; } - - mFetcher->adjustHTTPConcurrency(false); } } diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 3ac08ecbc2..4d17cd0b7b 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -110,7 +110,6 @@ public: inline void decrCurlPOSTCount() { mCurlPOSTRequestCount--; } bool canIssueHTTPRequest(); - void adjustHTTPConcurrency(bool success); S32 getHTTPConcurrency(); protected: -- cgit v1.2.3 From bfb02fa872805ab748d96389ca22cb0d05546161 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 17 May 2012 14:48:45 -0700 Subject: SH-3134 : Fix the http callback clearing the url so that further requests will look at the local cache first --- indra/newview/lltexturefetch.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 8ac6acf877..d5ecda1e61 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1739,6 +1739,10 @@ S32 LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels, { mRequestedSize = -1; // error } + // Clear the url since we're done with the fetch + // Note: mUrl is used to check is fetching is required so failure to clear it will force an http fetch + // next time the texture is requested, even if the data have already been fetched. + mUrl.clear(); mLoaded = TRUE; setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); -- cgit v1.2.3 From 93c68c7c12f2a0d19e94bae833554139f78914e9 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 18 May 2012 21:03:45 -0700 Subject: MAINT-959 FIX [PUBLIC]Trouble resizing tabbed floaters don't auto position other floater when it is hosted --- indra/llui/llfloater.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index a8a3a1f906..8ca1e685a9 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -3307,8 +3307,11 @@ void LLFloater::stackWith(LLFloater& other) setShape(next_rect); - other.mPositioning = LLFloaterEnums::POSITIONING_CASCADE_GROUP; - other.setFollows(FOLLOWS_LEFT | FOLLOWS_TOP); + if (!other.getHost()) + { + other.mPositioning = LLFloaterEnums::POSITIONING_CASCADE_GROUP; + other.setFollows(FOLLOWS_LEFT | FOLLOWS_TOP); + } } void LLFloater::applyRelativePosition() -- cgit v1.2.3 From a254d0e9b0af8e6f37fedafa6147b20d5659784f Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 22 May 2012 05:37:35 -0400 Subject: Added tag 3.3.2-beta1 for changeset d29a260119f8 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index f0cd9f0736..dfcc0edda9 100644 --- a/.hgtags +++ b/.hgtags @@ -292,3 +292,4 @@ b43cd25be49e3984ff5361cefad020e069131d98 3.3.1-start 5e8d2662f38a66eca6c591295f5880d47afc73f7 viewer-release-candidate c623bbc854b6f7ee1b33a3718f76715046aa2937 viewer-release-candidate c623bbc854b6f7ee1b33a3718f76715046aa2937 3.3.1-release +d29a260119f8d5a5d168e25fed0c7ea6b3f40161 3.3.2-beta1 -- cgit v1.2.3 From dd0094ada48af0a7596eba218ddc5f43197e4823 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 22 May 2012 05:39:57 -0400 Subject: Added tag 3.3.2-beta2 for changeset 675668bd24d3 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index dfcc0edda9..28e4438abf 100644 --- a/.hgtags +++ b/.hgtags @@ -293,3 +293,4 @@ b43cd25be49e3984ff5361cefad020e069131d98 3.3.1-start c623bbc854b6f7ee1b33a3718f76715046aa2937 viewer-release-candidate c623bbc854b6f7ee1b33a3718f76715046aa2937 3.3.1-release d29a260119f8d5a5d168e25fed0c7ea6b3f40161 3.3.2-beta1 +675668bd24d3bea570814f71762a2a806f7e1b8d 3.3.2-beta2 -- cgit v1.2.3 From b2b446aed7f7f32151bc152ba25d44253ebf864f Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 24 May 2012 10:01:24 -0400 Subject: Added tag viewer-release-candidate, 3.3.2-release for changeset 675668bd24d3 --- .hgtags | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.hgtags b/.hgtags index 28e4438abf..4f3f55ad94 100644 --- a/.hgtags +++ b/.hgtags @@ -294,3 +294,6 @@ c623bbc854b6f7ee1b33a3718f76715046aa2937 viewer-release-candidate c623bbc854b6f7ee1b33a3718f76715046aa2937 3.3.1-release d29a260119f8d5a5d168e25fed0c7ea6b3f40161 3.3.2-beta1 675668bd24d3bea570814f71762a2a806f7e1b8d 3.3.2-beta2 +c623bbc854b6f7ee1b33a3718f76715046aa2937 viewer-release-candidate +675668bd24d3bea570814f71762a2a806f7e1b8d viewer-release-candidate +675668bd24d3bea570814f71762a2a806f7e1b8d 3.3.2-release -- cgit v1.2.3 From e37917b66856d8737eae378c2017c3525f756b4d Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 24 May 2012 14:32:14 -0600 Subject: fix for VWR-28996: Texture stalls and threading models --- indra/llmessage/llcurl.cpp | 168 ++++++++++++++++++++++++++++++++++++- indra/llmessage/llcurl.h | 61 ++++++++++++++ indra/newview/lltexturefetch.cpp | 175 +++++++++++++++++---------------------- indra/newview/lltexturefetch.h | 27 ++---- indra/newview/lltextureview.cpp | 4 +- 5 files changed, 311 insertions(+), 124 deletions(-) diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index f153c94911..c06cf2489d 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -911,8 +911,8 @@ bool LLCurlThread::CurlRequest::processRequest() if(!completed) { - setPriority(LLQueuedThread::PRIORITY_LOW) ; - } + setPriority(LLQueuedThread::PRIORITY_LOW) ; + } } return completed ; @@ -1224,6 +1224,170 @@ S32 LLCurlRequest::getQueued() return queued; } +LLCurlTextureRequest::LLCurlTextureRequest(S32 concurrency) : + LLCurlRequest(), + mConcurrency(concurrency), + mInQueue(0), + mMutex(NULL), + mHandleCounter(1), + mTotalIssuedRequests(0), + mTotalReceivedBits(0) +{ +} + +LLCurlTextureRequest::~LLCurlTextureRequest() +{ + mRequestMap.clear(); + + for(req_queue_t::iterator iter = mCachedRequests.begin(); iter != mCachedRequests.end(); ++iter) + { + delete *iter; + } + mCachedRequests.clear(); +} + +//return 0: success +// > 0: cached handle +U32 LLCurlTextureRequest::getByteRange(const std::string& url, + const headers_t& headers, + S32 offset, S32 length, U32 pri, + LLCurl::ResponderPtr responder) +{ + U32 ret_val = 0; + bool success = false; + + if(mInQueue < mConcurrency) + { + success = LLCurlRequest::getByteRange(url, headers, offset, length, responder); + } + + LLMutexLock lock(&mMutex); + + if(success) + { + mInQueue++; + mTotalIssuedRequests++; + } + else + { + request_t* request = new request_t(mHandleCounter, url, headers, offset, length, pri, responder); + mCachedRequests.insert(request); + mRequestMap[mHandleCounter] = request; + ret_val = mHandleCounter; + mHandleCounter++; + + if(!mHandleCounter) + { + mHandleCounter = 1; + } + } + + return ret_val; +} + +void LLCurlTextureRequest::completeRequest(S32 received_bytes) +{ + LLMutexLock lock(&mMutex); + + llassert_always(mInQueue > 0); + + mInQueue--; + mTotalReceivedBits += received_bytes * 8; +} + +void LLCurlTextureRequest::nextRequests() +{ + while(!mCachedRequests.empty() && mInQueue < mConcurrency) + { + request_t* request; + + { + LLMutexLock lock(&mMutex); + req_queue_t::iterator iter = mCachedRequests.begin(); + request = *iter; + } + + if(!LLCurlRequest::getByteRange(request->mUrl, request->mHeaders, request->mOffset, request->mLength, request->mResponder)) + { + break; + } + + { + LLMutexLock lock(&mMutex); + mInQueue++; + mTotalIssuedRequests++; + llassert_always(1 == mCachedRequests.erase(request)); + mRequestMap.erase(request->mHandle); + } + delete request; + } + + return; +} + +void LLCurlTextureRequest::updatePriority(U32 handle, U32 pri) +{ + if(!handle) + { + return; + } + + LLMutexLock lock(&mMutex); + + std::map::iterator iter = mRequestMap.find(handle); + if(iter != mRequestMap.end()) + { + request_t* req = iter->second; + + if(req->mPriority != pri) + { + mCachedRequests.erase(req); + req->mPriority = pri; + mCachedRequests.insert(req); + } + } +} + +void LLCurlTextureRequest::removeRequest(U32 handle) +{ + if(!handle) + { + return; + } + + LLMutexLock lock(&mMutex); + + std::map::iterator iter = mRequestMap.find(handle); + if(iter != mRequestMap.end()) + { + request_t* req = iter->second; + mRequestMap.erase(iter); + mCachedRequests.erase(req); + delete req; + } +} + +U32 LLCurlTextureRequest::getTotalReceivedBits() +{ + LLMutexLock lock(&mMutex); + + U32 bits = mTotalReceivedBits; + mTotalReceivedBits = 0; + return bits; +} + +U32 LLCurlTextureRequest::getTotalIssuedRequests() +{ + LLMutexLock lock(&mMutex); + return mTotalIssuedRequests; +} + +S32 LLCurlTextureRequest::getNumRequests() +{ + LLMutexLock lock(&mMutex); + return mInQueue; +} + //////////////////////////////////////////////////////////////////////////// // For generating one easy request // associated with a single multi request diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h index fd664c0fa1..04a2bd4287 100644 --- a/indra/llmessage/llcurl.h +++ b/indra/llmessage/llcurl.h @@ -413,6 +413,67 @@ private: BOOL mProcessing; }; +//for texture fetch only +class LLCurlTextureRequest : public LLCurlRequest +{ +public: + LLCurlTextureRequest(S32 concurrency); + ~LLCurlTextureRequest(); + + U32 getByteRange(const std::string& url, const headers_t& headers, S32 offset, S32 length, U32 pri, LLCurl::ResponderPtr responder); + void nextRequests(); + void completeRequest(S32 received_bytes); + + void updatePriority(U32 handle, U32 pri); + void removeRequest(U32 handle); + + U32 getTotalReceivedBits(); + U32 getTotalIssuedRequests(); + S32 getNumRequests(); + +private: + LLMutex mMutex; + S32 mConcurrency; + S32 mInQueue; //request currently in queue. + U32 mHandleCounter; + U32 mTotalIssuedRequests; + U32 mTotalReceivedBits; + + typedef struct _request_t + { + _request_t(U32 handle, const std::string& url, const headers_t& headers, S32 offset, S32 length, U32 pri, LLCurl::ResponderPtr responder) : + mHandle(handle), mUrl(url), mHeaders(headers), mOffset(offset), mLength(length), mPriority(pri), mResponder(responder) + {} + + U32 mHandle; + std::string mUrl; + LLCurlRequest::headers_t mHeaders; + S32 mOffset; + S32 mLength; + LLCurl::ResponderPtr mResponder; + U32 mPriority; + } request_t; + + struct request_compare + { + bool operator()(const request_t* lhs, const request_t* rhs) const + { + if(lhs->mPriority != rhs->mPriority) + { + return lhs->mPriority > rhs->mPriority; // higher priority in front of queue (set) + } + else + { + return (U32)lhs < (U32)rhs; + } + } + }; + + typedef std::set req_queue_t; + req_queue_t mCachedRequests; + std::map mRequestMap; +}; + class LLCurlEasyRequest { public: diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 8ac6acf877..1e1152ea85 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -151,7 +151,7 @@ public: /*virtual*/ bool doWork(S32 param); // Called from LLWorkerThread::processRequest() /*virtual*/ void finishWork(S32 param, bool completed); // called from finishRequest() (WORK THREAD) /*virtual*/ bool deleteOK(); // called from update() (WORK THREAD) - + ~LLTextureFetchWorker(); // void relese() { --mActiveCount; } @@ -196,6 +196,8 @@ private: bool processSimulatorPackets(); bool writeToCacheComplete(); + void removeFromHTTPQueue(); + void lockWorkMutex() { mWorkMutex.lock(); } void unlockWorkMutex() { mWorkMutex.unlock(); } @@ -275,6 +277,7 @@ private: S32 mRetryAttempt; S32 mActiveCount; U32 mGetStatus; + U32 mHTTPHandle; std::string mGetReason; // Work Data @@ -328,6 +331,7 @@ public: mFetcher->mTextureInfo.setRequestCompleteTimeAndLog(mID, timeNow); } + S32 data_size = 0; lldebugs << "HTTP COMPLETE: " << mID << llendl; LLTextureFetchWorker* worker = mFetcher->getWorker(mID); if (worker) @@ -349,7 +353,7 @@ public: // llwarns << "CURL GET FAILED, status:" << status << " reason:" << reason << llendl; } - S32 data_size = worker->callbackHttpGet(channels, buffer, partial, success); + data_size = worker->callbackHttpGet(channels, buffer, partial, success); if(log_texture_traffic && data_size > 0) { @@ -359,9 +363,7 @@ public: gTotalTextureBytesPerBoostLevel[tex->getBoostLevel()] += data_size ; } } - - mFetcher->removeFromHTTPQueue(mID, data_size); - + if (worker->mMetricsStartTime) { LLViewerAssetStatsFF::record_response_thread1(LLViewerAssetType::AT_TEXTURE, @@ -376,9 +378,10 @@ public: } else { - mFetcher->removeFromHTTPQueue(mID); - llwarns << "Worker not found: " << mID << llendl; + llwarns << "Worker not found: " << mID << llendl; } + + mFetcher->getCurlRequest().completeRequest(data_size); } virtual bool followRedir() @@ -692,7 +695,8 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mLastPacket(-1), mTotalPackets(0), mImageCodec(IMG_CODEC_INVALID), - mMetricsStartTime(0) + mMetricsStartTime(0), + mHTTPHandle(0) { mCanUseNET = mUrl.empty() ; @@ -726,7 +730,19 @@ LLTextureFetchWorker::~LLTextureFetchWorker() mFormattedImage = NULL; clearPackets(); unlockWorkMutex(); - mFetcher->removeFromHTTPQueue(mID); + + removeFromHTTPQueue(); +} + +void LLTextureFetchWorker::removeFromHTTPQueue() +{ + if(mHTTPHandle > 0) + { + llassert_always(mState == WAIT_HTTP_REQ); + + mFetcher->getCurlRequest().removeRequest(mHTTPHandle); + mHTTPHandle = 0; + } } void LLTextureFetchWorker::clearPackets() @@ -824,6 +840,7 @@ void LLTextureFetchWorker::setImagePriority(F32 priority) mImagePriority = priority; calcWorkPriority(); U32 work_priority = mWorkPriority | (getPriority() & LLWorkerThread::PRIORITY_HIGHBITS); + mFetcher->getCurlRequest().updatePriority(mHTTPHandle, mWorkPriority); setPriority(work_priority); } } @@ -927,7 +944,7 @@ bool LLTextureFetchWorker::doWork(S32 param) S32 size = mDesiredSize - offset; if (size <= 0) { - mState = CACHE_POST; + mState = CACHE_POST; //have enough data, will fall to decode return false; } mFileSize = 0; @@ -981,6 +998,9 @@ bool LLTextureFetchWorker::doWork(S32 param) } else { + // + //This should never happen + // return false; } } @@ -1157,16 +1177,6 @@ bool LLTextureFetchWorker::doWork(S32 param) { if(mCanUseHTTP) { - //NOTE: - //control the number of the http requests issued for: - //1, not openning too many file descriptors at the same time; - //2, control the traffic of http so udp gets bandwidth. - // - if(!mFetcher->canIssueHTTPRequest()) - { - return false ; //wait. - } - mFetcher->removeFromNetworkQueue(this, false); S32 cur_size = 0; @@ -1179,6 +1189,7 @@ bool LLTextureFetchWorker::doWork(S32 param) { // We already have all the data, just decode it mLoadedDiscard = mFormattedImage->getDiscardLevel(); + setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); mState = DECODE_IMAGE; return false; } @@ -1209,7 +1220,6 @@ bool LLTextureFetchWorker::doWork(S32 param) setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); mState = WAIT_HTTP_REQ; - mFetcher->addToHTTPQueue(mID); if (! mMetricsStartTime) { mMetricsStartTime = LLViewerAssetStatsFF::get_timestamp(); @@ -1227,8 +1237,9 @@ bool LLTextureFetchWorker::doWork(S32 param) { mRequestedSize = 0; } - res = mFetcher->mCurlGetRequest->getByteRange(mUrl, headers, offset, mRequestedSize, + mHTTPHandle = mFetcher->mCurlGetRequest->getByteRange(mUrl, headers, offset, mRequestedSize, mWorkPriority, new HTTPGetResponder(mFetcher, mID, LLTimer::getTotalTime(), mRequestedSize, offset, true)); + res = true; } if (!res) { @@ -1292,6 +1303,7 @@ bool LLTextureFetchWorker::doWork(S32 param) { // Use available data mLoadedDiscard = mFormattedImage->getDiscardLevel(); + setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); mState = DECODE_IMAGE; return false; } @@ -1304,6 +1316,7 @@ bool LLTextureFetchWorker::doWork(S32 param) } else { + setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); mState = SEND_HTTP_REQ; return false; // retry } @@ -1366,6 +1379,7 @@ bool LLTextureFetchWorker::doWork(S32 param) if(FETCHING_TIMEOUT < mRequestedTimer.getElapsedTimeF32()) { //timeout, abort. + removeFromHTTPQueue(); mState = DONE; return true; } @@ -1689,7 +1703,7 @@ S32 LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels, S32 data_size = 0 ; LLMutexLock lock(&mWorkMutex); - + mHTTPHandle = 0; if (mState != WAIT_HTTP_REQ) { llwarns << "callbackHttpGet for unrequested fetch worker: " << mID @@ -1862,14 +1876,11 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mTextureCache(cache), mImageDecodeThread(imagedecodethread), mTextureBandwidth(0), - mHTTPTextureBits(0), - mTotalHTTPRequests(0), mCurlGetRequest(NULL), mQAMode(qa_mode), mFetchDebugger(NULL), mFetchSource(LLTextureFetch::FROM_ALL), - mOriginFetchSource(LLTextureFetch::FROM_ALL), - mHTTPConcurrency(8) + mOriginFetchSource(LLTextureFetch::FROM_ALL) { mCurlPOSTRequestCount = 0; mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS"); @@ -2035,21 +2046,6 @@ void LLTextureFetch::removeFromNetworkQueue(LLTextureFetchWorker* worker, bool c } } -// protected -void LLTextureFetch::addToHTTPQueue(const LLUUID& id) -{ - LLMutexLock lock(&mNetworkQueueMutex); - mHTTPTextureQueue.insert(id); - mTotalHTTPRequests++; -} - -void LLTextureFetch::removeFromHTTPQueue(const LLUUID& id, S32 received_size) -{ - LLMutexLock lock(&mNetworkQueueMutex); - mHTTPTextureQueue.erase(id); - mHTTPTextureBits += received_size * 8; // Approximate - does not include header bits -} - void LLTextureFetch::deleteRequest(const LLUUID& id, bool cancel) { lockQueue() ; @@ -2064,6 +2060,7 @@ void LLTextureFetch::deleteRequest(const LLUUID& id, bool cancel) removeFromNetworkQueue(worker, cancel); llassert_always(!(worker->getFlags(LLWorkerClass::WCF_DELETE_REQUESTED))) ; + worker->removeFromHTTPQueue(); worker->scheduleDelete(); } else @@ -2082,6 +2079,7 @@ void LLTextureFetch::removeRequest(LLTextureFetchWorker* worker, bool cancel) removeFromNetworkQueue(worker, cancel); llassert_always(!(worker->getFlags(LLWorkerClass::WCF_DELETE_REQUESTED))) ; + worker->removeFromHTTPQueue(); worker->scheduleDelete(); } @@ -2094,37 +2092,6 @@ S32 LLTextureFetch::getNumRequests() return size ; } -bool LLTextureFetch::canIssueHTTPRequest() -{ - LLMutexLock lock(&mNetworkQueueMutex); - - return (S32)mHTTPTextureQueue.size() < mHTTPConcurrency ; -} - -S32 LLTextureFetch::getHTTPConcurrency() -{ - //LLMutexLock lock(&mNetworkQueueMutex); - return mHTTPConcurrency; -} - -S32 LLTextureFetch::getNumHTTPRequests() -{ - mNetworkQueueMutex.lock() ; - S32 size = (S32)mHTTPTextureQueue.size(); - mNetworkQueueMutex.unlock() ; - - return size ; -} - -U32 LLTextureFetch::getTotalNumHTTPRequests() -{ - mNetworkQueueMutex.lock() ; - U32 size = mTotalHTTPRequests ; - mNetworkQueueMutex.unlock() ; - - return size ; -} - // call lockQueue() first! LLTextureFetchWorker* LLTextureFetch::getWorkerAfterLock(const LLUUID& id) { @@ -2210,7 +2177,7 @@ bool LLTextureFetch::updateRequestPriority(const LLUUID& id, F32 priority) { worker->lockWorkMutex(); worker->setImagePriority(priority); - worker->unlockWorkMutex(); + worker->unlockWorkMutex(); res = true; } return res; @@ -2292,15 +2259,7 @@ S32 LLTextureFetch::update(F32 max_time_ms) { static LLCachedControl band_width(gSavedSettings,"ThrottleBandwidthKBPS"); - { - mNetworkQueueMutex.lock() ; - mMaxBandwidth = band_width ; - - gTextureList.sTextureBits += mHTTPTextureBits ; - mHTTPTextureBits = 0 ; - - mNetworkQueueMutex.unlock() ; - } + mMaxBandwidth = band_width ; S32 res = LLWorkerThread::update(max_time_ms); @@ -2311,13 +2270,23 @@ S32 LLTextureFetch::update(F32 max_time_ms) // won't work so don't bother trying if (LLStartUp::getStartupState() > STATE_AGENT_SEND) { - sendRequestListToSimulators(); + sendRequestListToSimulators(); } } if (!mThreaded) { commonUpdate(); + + if(mCurlGetRequest) + { + mCurlGetRequest->nextRequests(); + } + } + + if(mCurlGetRequest) + { + gTextureList.sTextureBits += mCurlGetRequest->getTotalReceivedBits(); } if(mFetchDebugger) @@ -2352,7 +2321,7 @@ void LLTextureFetch::shutDownImageDecodeThread() void LLTextureFetch::startThread() { // Construct mCurlGetRequest from Worker Thread - mCurlGetRequest = new LLCurlRequest(); + mCurlGetRequest = new LLCurlTextureRequest(8); if(mFetchDebugger) { @@ -2377,6 +2346,8 @@ void LLTextureFetch::threadedUpdate() { llassert_always(mCurlGetRequest); + mCurlGetRequest->nextRequests(); + // Limit update frequency const F32 PROCESS_TIME = 0.05f; static LLFrameTimer process_timer; @@ -3189,6 +3160,7 @@ public: llinfos << "Fetch Debugger : CURL GET FAILED, index = " << mIndex << ", status:" << status << " reason:" << reason << llendl; } mDebugger->callbackHTTP(mIndex, channels, buffer, partial, success); + mDebugger->getCurlGetRequest()->completeRequest(0); } virtual bool followRedir() { @@ -3621,16 +3593,23 @@ S32 LLTextureFetchDebugger::fillCurlQueue() mNbCurlCompleted = mFetchingHistory.size(); return 0; } + S32 size = mFetchingHistory.size(); - S32 max_concurrency = mFetcher->getHTTPConcurrency(); - if (mNbCurlRequests == max_concurrency) - return mNbCurlRequests; + if (mNbCurlRequests == size) //all issued + { + return 0; + } - S32 size = mFetchingHistory.size(); + S32 counter = 8; + mNbCurlRequests = 0; for (S32 i = 0 ; i < size ; i++) { + mNbCurlRequests++; + if (mFetchingHistory[i].mCurlState != FetchEntry::CURL_NOT_DONE) + { continue; + } std::string texture_url = mHTTPUrl + "/?texture_id=" + mFetchingHistory[i].mID.asString().c_str(); S32 requestedSize = mFetchingHistory[i].mRequestedSize; // We request the whole file if the size was not set. @@ -3639,16 +3618,11 @@ S32 LLTextureFetchDebugger::fillCurlQueue() requestedSize = (requestedSize == 33554432 ? 0 : requestedSize); std::vector headers; headers.push_back("Accept: image/x-j2c"); - bool res = mCurlGetRequest->getByteRange(texture_url, headers, 0, requestedSize, new LLDebuggerHTTPResponder(this, i)); - if (res) - { - mFetchingHistory[i].mCurlState = FetchEntry::CURL_IN_PROGRESS; - mNbCurlRequests++; - // Hack - if (mNbCurlRequests == max_concurrency) - break; - } - else + mCurlGetRequest->getByteRange(texture_url, headers, 0, requestedSize, 0x10000, new LLDebuggerHTTPResponder(this, i)); + + mFetchingHistory[i].mCurlState = FetchEntry::CURL_IN_PROGRESS; + counter--; + if(counter < 1) { break; } @@ -3879,6 +3853,7 @@ bool LLTextureFetchDebugger::update(F32 max_time) break; case HTTP_FETCHING: mCurlGetRequest->process(); + mCurlGetRequest->nextRequests(); LLCurl::getCurlThread()->update(1); if (!fillCurlQueue() && mNbCurlCompleted == mFetchingHistory.size()) { @@ -3980,7 +3955,6 @@ void LLTextureFetchDebugger::callbackHTTP(S32 id, const LLChannelDescriptors& ch const LLIOPipe::buffer_ptr_t& buffer, bool partial, bool success) { - mNbCurlRequests--; if (success) { mFetchingHistory[id].mCurlState = FetchEntry::CURL_DONE; @@ -4016,6 +3990,7 @@ void LLTextureFetchDebugger::callbackHTTP(S32 id, const LLChannelDescriptors& ch { // Fetch will have to be redone mFetchingHistory[id].mCurlState = FetchEntry::CURL_NOT_DONE; + mNbCurlRequests--; } else //skip { diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 4d17cd0b7b..e04c9124a0 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -81,8 +81,6 @@ public: U32& fetch_priority_p, F32& fetch_dtime_p, F32& request_dtime_p, bool& can_use_http); void dump(); S32 getNumRequests() ; - S32 getNumHTTPRequests() ; - U32 getTotalNumHTTPRequests() ; // Public for access by callbacks S32 getPending(); @@ -101,7 +99,7 @@ public: LLViewerAssetStats * main_stats); void commandDataBreak(); - LLCurlRequest & getCurlRequest() { return *mCurlGetRequest; } + LLCurlTextureRequest & getCurlRequest() { return *mCurlGetRequest; } bool isQAMode() const { return mQAMode; } @@ -109,14 +107,10 @@ public: inline void incrCurlPOSTCount() { mCurlPOSTRequestCount++; } inline void decrCurlPOSTCount() { mCurlPOSTRequestCount--; } - bool canIssueHTTPRequest(); - S32 getHTTPConcurrency(); - protected: void addToNetworkQueue(LLTextureFetchWorker* worker); void removeFromNetworkQueue(LLTextureFetchWorker* worker, bool cancel); void addToHTTPQueue(const LLUUID& id); - void removeFromHTTPQueue(const LLUUID& id, S32 received_size = 0); void removeRequest(LLTextureFetchWorker* worker, bool cancel); // Overrides from the LLThread tree @@ -175,8 +169,8 @@ private: LLTextureCache* mTextureCache; LLImageDecodeThread* mImageDecodeThread; - LLCurlRequest* mCurlGetRequest; - + LLCurlTextureRequest* mCurlGetRequest; + // Map of all requests by UUID typedef std::map map_t; map_t mRequestMap; @@ -191,11 +185,6 @@ private: F32 mMaxBandwidth; LLTextureInfo mTextureInfo; - U32 mHTTPTextureBits; - - //debug use - U32 mTotalHTTPRequests ; - // Out-of-band cross-thread command queue. This command queue // is logically tied to LLQueuedThread's list of // QueuedRequest instances and so must be covered by the @@ -212,9 +201,6 @@ private: // use the LLCurl module's request counter as it isn't thread compatible. // *NOTE: Don't mix Atomic and static, apr_initialize must be called first. LLAtomic32 mCurlPOSTRequestCount; - - //control http concurrency for texture fetching - S32 mHTTPConcurrency; //which is adaptive to the network situation at an instant public: // A probabilistically-correct indicator that the current @@ -332,7 +318,7 @@ private: LLTextureFetch* mFetcher; LLTextureCache* mTextureCache; LLImageDecodeThread* mImageDecodeThread; - LLCurlRequest* mCurlGetRequest; + LLCurlTextureRequest* mCurlGetRequest; S32 mNumFetchedTextures; S32 mNumCacheHits; @@ -372,8 +358,9 @@ public: void clearHistory(); void addHistoryEntry(LLTextureFetchWorker* worker); - void setCurlGetRequest(LLCurlRequest* request) { mCurlGetRequest = request;} - + void setCurlGetRequest(LLCurlTextureRequest* request) { mCurlGetRequest = request;} + LLCurlTextureRequest* getCurlGetRequest() { return mCurlGetRequest;} + void startWork(e_debug_state state); void setStopDebug() {mStopDebug = TRUE;} void tryToStopDebug(); //stop everything diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 425bf7ee87..a40928ce2a 100755 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -514,7 +514,7 @@ void LLGLTexMemBar::draw() S32 v_offset = 0;//(S32)((texture_bar_height + 2.2f) * mTextureView->mNumTextureBars + 2.0f); F32 total_texture_downloaded = (F32)gTotalTextureBytes / (1024 * 1024); F32 total_object_downloaded = (F32)gTotalObjectBytes / (1024 * 1024); - U32 total_http_requests = LLAppViewer::getTextureFetch()->getTotalNumHTTPRequests() ; + U32 total_http_requests = LLAppViewer::getTextureFetch()->getCurlRequest().getTotalIssuedRequests() ; //---------------------------------------------------------------------------- LLGLSUIDefault gls_ui; LLColor4 text_color(1.f, 1.f, 1.f, 0.75f); @@ -552,7 +552,7 @@ void LLGLTexMemBar::draw() LLAppViewer::getTextureCache()->getNumReads(), LLAppViewer::getTextureCache()->getNumWrites(), LLLFSThread::sLocal->getPending(), LLImageRaw::sRawImageCount, - LLAppViewer::getTextureFetch()->getNumHTTPRequests(), + LLAppViewer::getTextureFetch()->getCurlRequest().getNumRequests(), LLAppViewer::getImageDecodeThread()->getPending(), gTextureList.mCreateTextureList.size()); -- cgit v1.2.3 From cbb14e223c4db312191d0fe0b12362298fbf9fbd Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 25 May 2012 14:08:33 -0600 Subject: fix for SH-3137: delay to issue new http fetching requests if http connection failure happens --- indra/llmessage/llcurl.cpp | 76 ++++++++++++++++++++++++++++++---------- indra/llmessage/llcurl.h | 8 +++-- indra/newview/lltexturefetch.cpp | 41 +++++++++++++++++----- 3 files changed, 95 insertions(+), 30 deletions(-) diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index c06cf2489d..4cfa48cbd9 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -922,7 +922,7 @@ void LLCurlThread::CurlRequest::finishRequest(bool completed) { if(mMulti->isDead()) { - mCurlThread->deleteMulti(mMulti) ; + mCurlThread->deleteMulti(mMulti) ; } else { @@ -968,8 +968,8 @@ void LLCurlThread::killMulti(LLCurl::Multi* multi) if(multi->isValid()) { - multi->markDead() ; -} + multi->markDead() ; + } else { deleteMulti(multi) ; @@ -1233,6 +1233,7 @@ LLCurlTextureRequest::LLCurlTextureRequest(S32 concurrency) : mTotalIssuedRequests(0), mTotalReceivedBits(0) { + mGlobalTimer.reset(); } LLCurlTextureRequest::~LLCurlTextureRequest() @@ -1251,12 +1252,12 @@ LLCurlTextureRequest::~LLCurlTextureRequest() U32 LLCurlTextureRequest::getByteRange(const std::string& url, const headers_t& headers, S32 offset, S32 length, U32 pri, - LLCurl::ResponderPtr responder) + LLCurl::ResponderPtr responder, F32 delay_time) { U32 ret_val = 0; bool success = false; - if(mInQueue < mConcurrency) + if(mInQueue < mConcurrency && delay_time < 0.f) { success = LLCurlRequest::getByteRange(url, headers, offset, length, responder); } @@ -1271,6 +1272,11 @@ U32 LLCurlTextureRequest::getByteRange(const std::string& url, else { request_t* request = new request_t(mHandleCounter, url, headers, offset, length, pri, responder); + if(delay_time > 0.f) + { + request->mStartTime = mGlobalTimer.getElapsedTimeF32() + delay_time; + } + mCachedRequests.insert(request); mRequestMap[mHandleCounter] = request; ret_val = mHandleCounter; @@ -1297,29 +1303,50 @@ void LLCurlTextureRequest::completeRequest(S32 received_bytes) void LLCurlTextureRequest::nextRequests() { - while(!mCachedRequests.empty() && mInQueue < mConcurrency) + if(mCachedRequests.empty() || mInQueue >= mConcurrency) { - request_t* request; - - { - LLMutexLock lock(&mMutex); - req_queue_t::iterator iter = mCachedRequests.begin(); - request = *iter; - } + return; + } - if(!LLCurlRequest::getByteRange(request->mUrl, request->mHeaders, request->mOffset, request->mLength, request->mResponder)) - { - break; - } + F32 cur_time = mGlobalTimer.getElapsedTimeF32(); + req_queue_t::iterator iter; + { + LLMutexLock lock(&mMutex); + iter = mCachedRequests.begin(); + } + while(1) + { + request_t* request = *iter; + if(request->mStartTime < cur_time) { + if(!LLCurlRequest::getByteRange(request->mUrl, request->mHeaders, request->mOffset, request->mLength, request->mResponder)) + { + break; + } + LLMutexLock lock(&mMutex); + ++iter; mInQueue++; mTotalIssuedRequests++; - llassert_always(1 == mCachedRequests.erase(request)); + mCachedRequests.erase(request); mRequestMap.erase(request->mHandle); + delete request; + + if(iter == mCachedRequests.end() || mInQueue >= mConcurrency) + { + break; + } + } + else + { + LLMutexLock lock(&mMutex); + ++iter; + if(iter == mCachedRequests.end() || mInQueue >= mConcurrency) + { + break; + } } - delete request; } return; @@ -1367,6 +1394,17 @@ void LLCurlTextureRequest::removeRequest(U32 handle) } } +bool LLCurlTextureRequest::isWaiting(U32 handle) +{ + if(!handle) + { + return false; + } + + LLMutexLock lock(&mMutex); + return mRequestMap.find(handle) != mRequestMap.end(); +} + U32 LLCurlTextureRequest::getTotalReceivedBits() { LLMutexLock lock(&mMutex); diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h index 04a2bd4287..87cb192141 100644 --- a/indra/llmessage/llcurl.h +++ b/indra/llmessage/llcurl.h @@ -420,7 +420,7 @@ public: LLCurlTextureRequest(S32 concurrency); ~LLCurlTextureRequest(); - U32 getByteRange(const std::string& url, const headers_t& headers, S32 offset, S32 length, U32 pri, LLCurl::ResponderPtr responder); + U32 getByteRange(const std::string& url, const headers_t& headers, S32 offset, S32 length, U32 pri, LLCurl::ResponderPtr responder, F32 delay_time = -1.f); void nextRequests(); void completeRequest(S32 received_bytes); @@ -430,6 +430,7 @@ public: U32 getTotalReceivedBits(); U32 getTotalIssuedRequests(); S32 getNumRequests(); + bool isWaiting(U32 handle); private: LLMutex mMutex; @@ -442,7 +443,7 @@ private: typedef struct _request_t { _request_t(U32 handle, const std::string& url, const headers_t& headers, S32 offset, S32 length, U32 pri, LLCurl::ResponderPtr responder) : - mHandle(handle), mUrl(url), mHeaders(headers), mOffset(offset), mLength(length), mPriority(pri), mResponder(responder) + mHandle(handle), mUrl(url), mHeaders(headers), mOffset(offset), mLength(length), mPriority(pri), mResponder(responder), mStartTime(0.f) {} U32 mHandle; @@ -452,6 +453,7 @@ private: S32 mLength; LLCurl::ResponderPtr mResponder; U32 mPriority; + F32 mStartTime; //start time to issue this request } request_t; struct request_compare @@ -472,6 +474,8 @@ private: typedef std::set req_queue_t; req_queue_t mCachedRequests; std::map mRequestMap; + + LLFrameTimer mGlobalTimer; }; class LLCurlEasyRequest diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 2a94564fe0..a778a1ccb0 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -278,6 +278,7 @@ private: S32 mActiveCount; U32 mGetStatus; U32 mHTTPHandle; + F32 mDelay; std::string mGetReason; // Work Data @@ -696,7 +697,8 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mTotalPackets(0), mImageCodec(IMG_CODEC_INVALID), mMetricsStartTime(0), - mHTTPHandle(0) + mHTTPHandle(0), + mDelay(-1.f) { mCanUseNET = mUrl.empty() ; @@ -929,6 +931,7 @@ bool LLTextureFetchWorker::doWork(S32 param) mCacheWriteHandle = LLTextureCache::nullHandle(); mState = LOAD_FROM_TEXTURE_CACHE; mInCache = FALSE; + mDelay = -1.f; mDesiredSize = llmax(mDesiredSize, TEXTURE_CACHE_ENTRY_SIZE); // min desired size is TEXTURE_CACHE_ENTRY_SIZE LL_DEBUGS("Texture") << mID << ": Priority: " << llformat("%8.0f",mImagePriority) << " Desired Discard: " << mDesiredDiscard << " Desired Size: " << mDesiredSize << LL_ENDL; @@ -1238,7 +1241,8 @@ bool LLTextureFetchWorker::doWork(S32 param) mRequestedSize = 0; } mHTTPHandle = mFetcher->mCurlGetRequest->getByteRange(mUrl, headers, offset, mRequestedSize, mWorkPriority, - new HTTPGetResponder(mFetcher, mID, LLTimer::getTotalTime(), mRequestedSize, offset, true)); + new HTTPGetResponder(mFetcher, mID, LLTimer::getTotalTime(), mRequestedSize, offset, true), mDelay); + mDelay = -1.f; //reset res = true; } if (!res) @@ -1286,12 +1290,15 @@ bool LLTextureFetchWorker::doWork(S32 param) ++mHTTPFailCount; max_attempts = mHTTPFailCount+1; // Keep retrying LL_INFOS_ONCE("Texture") << "Texture server busy (503): " << mUrl << LL_ENDL; + mDelay = 2.0f; //delay 2 second to re-issue the http request } else { const S32 HTTP_MAX_RETRY_COUNT = 3; max_attempts = HTTP_MAX_RETRY_COUNT + 1; ++mHTTPFailCount; + mDelay = 2.0f; //delay 2 second to re-issue the http request + llinfos << "HTTP GET failed for: " << mUrl << " Status: " << mGetStatus << " Reason: '" << mGetReason << "'" << " Attempt:" << mHTTPFailCount+1 << "/" << max_attempts << llendl; @@ -1376,13 +1383,29 @@ bool LLTextureFetchWorker::doWork(S32 param) } else { - if(FETCHING_TIMEOUT < mRequestedTimer.getElapsedTimeF32()) - { - //timeout, abort. - removeFromHTTPQueue(); - mState = DONE; - return true; - } + // + //No need to timeout, the responder should be triggered automatically. + // + + //if(FETCHING_TIMEOUT < mRequestedTimer.getElapsedTimeF32()) + //{ + // if(mFetcher->getCurlRequest().isWaiting(mHTTPHandle)) + // { + // mRequestedTimer.reset(); //still waiting, request not issued yet. + // } + // else if(!mHTTPWaitCount) + // { + // mHTTPWaitCount++; + // mRequestedTimer.reset(); //wait for one more FETCHING_TIMEOUT cycle in case the request is just issued. + // } + // else + // { + // //timeout, abort. + // removeFromHTTPQueue(); + // mState = DONE; + // return true; + // } + //} setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); return false; -- cgit v1.2.3 From 3a63d88e7b48397cbfd508c05632453653e678e3 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 25 May 2012 14:59:13 -0600 Subject: trivial: fix a linux compiling error. --- indra/newview/lltexturefetch.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index a778a1ccb0..e307de329b 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -870,8 +870,6 @@ void LLTextureFetchWorker::startWork(S32 param) // Called from LLWorkerThread::processRequest() bool LLTextureFetchWorker::doWork(S32 param) { - static const F32 FETCHING_TIMEOUT = 120.f;//seconds - LLMutexLock lock(&mWorkMutex); if ((mFetcher->isQuitting() || getFlags(LLWorkerClass::WCF_DELETE_REQUESTED))) -- cgit v1.2.3 From a519e34f02b4b2663fe082ba9ad12f1b423669cb Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 28 May 2012 09:23:24 -0400 Subject: inconsequential change to force new ticket number --- BuildParams | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/BuildParams b/BuildParams index d24666aff9..cff51a286b 100644 --- a/BuildParams +++ b/BuildParams @@ -138,19 +138,6 @@ oz_viewer-beta-review.viewer_channel = "Second Life Beta Viewer" oz_viewer-beta-review.login_channel = "Second Life Beta Viewer" oz_viewer-beta-review.email = oz@lindenlab.com -oz_project-1.build_debug_release_separately = true -oz_project-1.codeticket_add_context = false -oz_project-1.email = oz@lindenlab.com -oz_project-2.build_debug_release_separately = true -oz_project-2.codeticket_add_context = false -oz_project-2.email = oz@lindenlab.com -oz_project-3.build_debug_release_separately = true -oz_project-3.codeticket_add_context = false -oz_project-3.email = oz@lindenlab.com -oz_project-4.build_debug_release_separately = true -oz_project-4.codeticket_add_context = false -oz_project-4.email = oz@lindenlab.com - # ================================================================= # asset delivery 2010 projects # ================================================================= -- cgit v1.2.3 From a9ef160f4eca2c6a55e2df286c9c75a27e38a831 Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Tue, 29 May 2012 23:01:19 +0000 Subject: SH-3135 Viewer UI corruption Presumed to be a complete failure of texture pipeline to decode anything. Got a fix from bao, a flag was not initialized properly in the texture pipeline. --- indra/newview/lltexturefetch.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index e307de329b..1e34954f79 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1905,7 +1905,8 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mQAMode(qa_mode), mFetchDebugger(NULL), mFetchSource(LLTextureFetch::FROM_ALL), - mOriginFetchSource(LLTextureFetch::FROM_ALL) + mOriginFetchSource(LLTextureFetch::FROM_ALL), + mFetcherLocked(FALSE) { mCurlPOSTRequestCount = 0; mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS"); -- cgit v1.2.3 From 957bfcd5d90b4ae0dfccd7a934364461059f8402 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 29 May 2012 18:02:11 -0600 Subject: fo SH-3074: clear ghost and stale texture fetching requests in time. --- indra/newview/llappviewer.cpp | 4 ++++ indra/newview/llface.cpp | 6 +++++ indra/newview/llface.h | 1 + indra/newview/lltexturefetch.cpp | 41 +++++++++++++++++++++-------------- indra/newview/lltexturefetch.h | 1 + indra/newview/llviewertexture.cpp | 24 +++++++++++++++----- indra/newview/llviewertexturelist.cpp | 18 +++++++++------ indra/newview/llvoavatar.cpp | 4 ++-- indra/newview/llvovolume.cpp | 2 +- indra/newview/pipeline.cpp | 25 +++++++++++++++++++++ indra/newview/pipeline.h | 1 + 11 files changed, 96 insertions(+), 31 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 178b96e42e..4fb0a7628c 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4270,6 +4270,10 @@ void LLAppViewer::idle() { return; } + if (gTeleportDisplay) + { + return; + } gViewerWindow->updateUI(); diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index cfb4147e71..cb445d6117 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1951,6 +1951,12 @@ BOOL LLFace::hasMedia() const const F32 LEAST_IMPORTANCE = 0.05f ; const F32 LEAST_IMPORTANCE_FOR_LARGE_IMAGE = 0.3f ; +void LLFace::resetVirtualSize() +{ + setVirtualSize(0.f); + mImportanceToCamera = 0.f; +} + F32 LLFace::getTextureVirtualSize() { F32 radius; diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 82e4ab61b7..8c2e229a81 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -204,6 +204,7 @@ public: F32 getTextureVirtualSize() ; F32 getImportanceToCamera()const {return mImportanceToCamera ;} + void resetVirtualSize(); void setHasMedia(bool has_media) { mHasMedia = has_media ;} BOOL hasMedia() const ; diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index e307de329b..8657fce093 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -2075,27 +2075,18 @@ void LLTextureFetch::deleteRequest(const LLUUID& id, bool cancel) { lockQueue() ; LLTextureFetchWorker* worker = getWorkerAfterLock(id); - if (worker) - { - size_t erased_1 = mRequestMap.erase(worker->mID); - unlockQueue() ; - - llassert_always(erased_1 > 0) ; - - removeFromNetworkQueue(worker, cancel); - llassert_always(!(worker->getFlags(LLWorkerClass::WCF_DELETE_REQUESTED))) ; + unlockQueue() ; - worker->removeFromHTTPQueue(); - worker->scheduleDelete(); - } - else - { - unlockQueue() ; - } + removeRequest(worker, cancel); } void LLTextureFetch::removeRequest(LLTextureFetchWorker* worker, bool cancel) { + if(!worker) + { + return; + } + lockQueue() ; size_t erased_1 = mRequestMap.erase(worker->mID); unlockQueue() ; @@ -2108,6 +2099,24 @@ void LLTextureFetch::removeRequest(LLTextureFetchWorker* worker, bool cancel) worker->scheduleDelete(); } +void LLTextureFetch::deleteAllRequests() +{ + while(1) + { + lockQueue(); + if(mRequestMap.empty()) + { + unlockQueue() ; + break; + } + + LLTextureFetchWorker* worker = mRequestMap.begin()->second; + unlockQueue() ; + + removeRequest(worker, true); + } +} + S32 LLTextureFetch::getNumRequests() { lockQueue() ; diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index e04c9124a0..f5072a79f1 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -65,6 +65,7 @@ public: bool createRequest(const std::string& url, const LLUUID& id, const LLHost& host, F32 priority, S32 w, S32 h, S32 c, S32 discard, bool needs_aux, bool can_use_http); void deleteRequest(const LLUUID& id, bool cancel); + void deleteAllRequests(); bool getRequestFinished(const LLUUID& id, S32& discard_level, LLPointer& raw, LLPointer& aux); bool updateRequestPriority(const LLUUID& id, F32 priority); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 511fc13973..a6f4b10540 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1240,7 +1240,7 @@ void LLViewerFetchedTexture::init(bool firstinit) mIsMissingAsset = FALSE; mLoadedCallbackDesiredDiscardLevel = S8_MAX; - mPauseLoadedCallBacks = TRUE ; + mPauseLoadedCallBacks = FALSE ; mNeedsCreateTexture = FALSE; @@ -2072,6 +2072,10 @@ bool LLViewerFetchedTexture::updateFetch() { make_request = false; } + else if(mDesiredDiscardLevel > getMaxDiscardLevel()) + { + make_request = false; + } else if (mNeedsCreateTexture || mIsMissingAsset) { make_request = false; @@ -2190,11 +2194,13 @@ void LLViewerFetchedTexture::forceToDeleteRequest() { if (mHasFetcher) { - LLAppViewer::getTextureFetch()->deleteRequest(getID(), true); mHasFetcher = FALSE; mIsFetching = FALSE ; - resetTextureStats(); } + + resetTextureStats(); + + mDesiredDiscardLevel = getMaxDiscardLevel() + 1; } void LLViewerFetchedTexture::setIsMissingAsset() @@ -2237,10 +2243,18 @@ void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_call mLoadedCallbackDesiredDiscardLevel = llmin(mLoadedCallbackDesiredDiscardLevel, (S8)discard_level) ; } - if(mPauseLoadedCallBacks && !pause) + if(mPauseLoadedCallBacks) { - unpauseLoadedCallbacks(src_callback_list) ; + if(!pause) + { + unpauseLoadedCallbacks(src_callback_list) ; + } } + else if(pause) + { + pauseLoadedCallbacks(src_callback_list) ; + } + LLLoadedCallbackEntry* entryp = new LLLoadedCallbackEntry(loaded_callback, discard_level, keep_imageraw, userdata, src_callback_list, this, pause); mLoadedCallbackList.push_back(entryp); diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index e3b633dc0e..d95a9cd13b 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -58,7 +58,7 @@ #include "pipeline.h" #include "llappviewer.h" #include "llxuiparser.h" -#include "llagent.h" +#include "llviewerdisplay.h" //////////////////////////////////////////////////////////////////////////// @@ -598,11 +598,15 @@ static LLFastTimer::DeclareTimer FTM_IMAGE_STATS("Stats"); void LLViewerTextureList::updateImages(F32 max_time) { - if(gAgent.getTeleportState() != LLAgent::TELEPORT_NONE) + static BOOL cleared = FALSE; + if(gTeleportDisplay && !cleared) { clearFetchingRequests(); + gPipeline.clearRebuildGroups(); + cleared = TRUE; return; } + cleared = FALSE; LLAppViewer::getTextureFetch()->setTextureBandwidth(LLViewerStats::getInstance()->mTextureKBitStat.getMeanPerSec()); @@ -673,14 +677,13 @@ void LLViewerTextureList::clearFetchingRequests() return; } + LLAppViewer::getTextureFetch()->deleteAllRequests(); + for (image_priority_list_t::iterator iter = mImageList.begin(); iter != mImageList.end(); ++iter) { - LLViewerFetchedTexture* image = *iter; - if(image->hasFetcher()) - { - image->forceToDeleteRequest() ; - } + LLViewerFetchedTexture* imagep = *iter; + imagep->forceToDeleteRequest() ; } } @@ -703,6 +706,7 @@ void LLViewerTextureList::updateImagesDecodePriorities() if(imagep->isInDebug()) { + update_counter--; continue; //is in debug, ignore. } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index ffe5837249..3c1f8cd71e 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6645,7 +6645,7 @@ void LLVOAvatar::updateMeshTextures() if(!isSelf()) { src_callback_list = &mCallbackTextureList ; - paused = mLoadedCallbacksPaused ; + paused = !isVisible(); } std::vector is_layer_baked; @@ -7190,7 +7190,7 @@ void LLVOAvatar::onFirstTEMessageReceived() if(!isSelf()) { src_callback_list = &mCallbackTextureList ; - paused = mLoadedCallbacksPaused ; + paused = !isVisible(); } for (U32 i = 0; i < mBakedTextureDatas.size(); i++) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 438d578ac5..aaa58a2914 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4178,7 +4178,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } llassert_always(vobj); - vobj->updateTextureVirtualSize(true); + vobj->updateTextureVirtualSize(); vobj->preRebuild(); drawablep->clearState(LLDrawable::HAS_ALPHA); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index a64655960f..a3292939a8 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2439,6 +2439,31 @@ void LLPipeline::updateGL() } } +void LLPipeline::clearRebuildGroups() +{ + mGroupQ1Locked = true; + // Iterate through all drawables on the priority build queue, + for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ1.begin(); + iter != mGroupQ1.end(); ++iter) + { + LLSpatialGroup* group = *iter; + group->clearState(LLSpatialGroup::IN_BUILD_Q1); + } + mGroupQ1.clear(); + mGroupQ1Locked = false; + + mGroupQ2Locked = true; + for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ2.begin(); + iter != mGroupQ2.end(); ++iter) + { + LLSpatialGroup* group = *iter; + group->clearState(LLSpatialGroup::IN_BUILD_Q2); + } + + mGroupQ2.clear(); + mGroupQ2Locked = false; +} + void LLPipeline::rebuildPriorityGroups() { LLTimer update_timer; diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 9ed38b1190..4d4da82460 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -220,6 +220,7 @@ public: void updateGL(); void rebuildPriorityGroups(); void rebuildGroups(); + void clearRebuildGroups(); //calculate pixel area of given box from vantage point of given camera static F32 calcPixelArea(LLVector3 center, LLVector3 size, LLCamera& camera); -- cgit v1.2.3 From 4f073a8d01f9875a67d53dcf47c6c96e6866956f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 30 May 2012 18:15:10 -0400 Subject: SH-3039 WIP - track sequence number and other standard fields in avatar appearance metrics --- indra/newview/llvoavatarself.cpp | 43 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index d2609e5587..fbc84c1d32 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2157,7 +2157,12 @@ LLSD LLVOAvatarSelf::metricsData() class ViewerAppearanceChangeMetricsResponder: public LLCurl::Responder { public: - ViewerAppearanceChangeMetricsResponder() + ViewerAppearanceChangeMetricsResponder( S32 expected_sequence, + volatile const S32 & live_sequence, + volatile bool & reporting_started): + mExpectedSequence(expected_sequence), + mLiveSequence(live_sequence), + mReportingStarted(reporting_started) { } @@ -2176,14 +2181,44 @@ public: error(status,reason); } } + + // virtual + void error(U32 status_num, const std::string & reason) + { + } + + // virtual + void result(const LLSD & content) + { + if (mLiveSequence == mExpectedSequence) + { + mReportingStarted = true; + } + } + +private: + S32 mExpectedSequence; + volatile const S32 & mLiveSequence; + volatile bool & mReportingStarted; }; void LLVOAvatarSelf::sendAppearanceChangeMetrics() { // gAgentAvatarp->stopAllPhases(); + static volatile bool reporting_started(false); + static volatile S32 report_sequence(0); LLSD msg = metricsData(); msg["message"] = "ViewerAppearanceChangeMetrics"; + msg["session_id"] = gAgentSessionID; + msg["agent_id"] = gAgentID; + msg["sequence"] = report_sequence; + msg["initial"] = !reporting_started; + msg["break"] = false; + + // Update sequence number + if (S32_MAX == ++report_sequence) + report_sequence = 0; LL_DEBUGS("Avatar") << avString() << "message: " << ll_pretty_print_sd(msg) << LL_ENDL; std::string caps_url; @@ -2196,8 +2231,10 @@ void LLVOAvatarSelf::sendAppearanceChangeMetrics() { LLCurlRequest::headers_t headers; LLHTTPClient::post(caps_url, - msg, - new ViewerAppearanceChangeMetricsResponder); + msg, + new ViewerAppearanceChangeMetricsResponder(report_sequence, + report_sequence, + reporting_started)); } } -- cgit v1.2.3 From f25dbddd5b3d5fcc271db81b91f777f60c497832 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 31 May 2012 18:10:32 -0600 Subject: fix for MAINT-1113: [PUBLIC_JIRA_USERS][crashhunters] crash at LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *) [secondlife-bin llviewertexturelist.cpp] --- indra/newview/llviewertexture.cpp | 2 -- indra/newview/llviewertexturelist.cpp | 13 ++++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index a6f4b10540..ad7e50b788 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1842,8 +1842,6 @@ F32 LLViewerFetchedTexture::maxDecodePriority() void LLViewerFetchedTexture::setDecodePriority(F32 priority) { - llassert(!mInImageList); - mDecodePriority = priority; if(mDecodePriority < F_ALMOST_ZERO) diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index d95a9cd13b..c8082d60bd 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -503,6 +503,7 @@ LLViewerFetchedTexture *LLViewerTextureList::findImage(const LLUUID &image_id) void LLViewerTextureList::addImageToList(LLViewerFetchedTexture *image) { + assert_main_thread(); llassert_always(mInitialized) ; llassert(image); if (image->isInImageList()) @@ -519,6 +520,7 @@ void LLViewerTextureList::addImageToList(LLViewerFetchedTexture *image) void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image) { + assert_main_thread(); llassert_always(mInitialized) ; llassert(image); if (!image->isInImageList()) @@ -763,7 +765,12 @@ void LLViewerTextureList::updateImagesDecodePriorities() imagep->setInactive() ; } } - + + if (!imagep->isInImageList()) + { + continue; + } + imagep->processTextureStats(); F32 old_priority = imagep->getDecodePriority(); F32 old_priority_test = llmax(old_priority, 0.0f); @@ -773,9 +780,9 @@ void LLViewerTextureList::updateImagesDecodePriorities() if ((decode_priority_test < old_priority_test * .8f) || (decode_priority_test > old_priority_test * 1.25f)) { - removeImageFromList(imagep); + mImageList.erase(imagep) ; imagep->setDecodePriority(decode_priority); - addImageToList(imagep); + mImageList.insert(imagep); } update_counter--; } -- cgit v1.2.3 From da6c5fbf7ff589b73f8cb834925206b6464ef632 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 6 Jun 2012 19:05:51 -0400 Subject: MAINT-1144: Unblock build for previous commit. Today, 2012-06-06, LLHTTPClient::get("http://www.google.com/") has stopped working. This is unrelated to viewer code changes: it crosses repo boundaries. Skip the afflicted tests to get builds working until we can recast the tests to avoid the flaky dependency. --- indra/test/llhttpclient_tut.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/test/llhttpclient_tut.cpp b/indra/test/llhttpclient_tut.cpp index 4b4046632c..1e0296918c 100644 --- a/indra/test/llhttpclient_tut.cpp +++ b/indra/test/llhttpclient_tut.cpp @@ -257,6 +257,7 @@ namespace tut template<> template<> void HTTPClientTestObject::test<1>() { + skip("google.com unit tests stopped working 2012-06-06"); LLHTTPClient::get("http://www.google.com/", newResult()); runThePump(); ensureStatusOK(); @@ -362,6 +363,7 @@ namespace tut template<> template<> void HTTPClientTestObject::test<8>() { + skip("google.com unit tests stopped working 2012-06-06"); // This is testing for the presence of the Header in the returned results // from an HTTP::get call. LLHTTPClient::get("http://www.google.com/", newResult()); @@ -373,6 +375,7 @@ namespace tut template<> template<> void HTTPClientTestObject::test<9>() { + skip("google.com unit tests stopped working 2012-06-06"); LLHTTPClient::head("http://www.google.com/", newResult()); runThePump(); ensureStatusOK(); -- cgit v1.2.3 From cd05a244da8d3249db1f3c1e8db215eb28da2816 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 6 Jun 2012 19:57:58 -0400 Subject: MAINT-1144: Break out llhttpclient_tut as standalone integration test. indra/test/llhttpclient_tut.cpp ==> indra/llmessage/tests/llhttpclient_test.cpp, with corresponding CMakeLists.txt changes in their respective directories. This first commit merely moves the test source file without changing it -- separating out moves from edits simplifies code review. --- indra/llmessage/CMakeLists.txt | 8 + indra/llmessage/tests/llhttpclient_test.cpp | 386 ++++++++++++++++++++++++++++ indra/test/CMakeLists.txt | 1 - indra/test/llhttpclient_tut.cpp | 386 ---------------------------- 4 files changed, 394 insertions(+), 387 deletions(-) create mode 100644 indra/llmessage/tests/llhttpclient_test.cpp delete mode 100644 indra/test/llhttpclient_tut.cpp diff --git a/indra/llmessage/CMakeLists.txt b/indra/llmessage/CMakeLists.txt index 0f40a670fa..d98781e9e6 100644 --- a/indra/llmessage/CMakeLists.txt +++ b/indra/llmessage/CMakeLists.txt @@ -254,6 +254,14 @@ if (LL_TESTS) "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_llsdmessage_peer.py" ) + LL_ADD_INTEGRATION_TEST( + llhttpclient + "llhttpclient.cpp" + "${test_libs}" + ${PYTHON_EXECUTABLE} + "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_llsdmessage_peer.py" + ) + LL_ADD_INTEGRATION_TEST(llavatarnamecache "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llhost "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llpartdata "" "${test_libs}") diff --git a/indra/llmessage/tests/llhttpclient_test.cpp b/indra/llmessage/tests/llhttpclient_test.cpp new file mode 100644 index 0000000000..1e0296918c --- /dev/null +++ b/indra/llmessage/tests/llhttpclient_test.cpp @@ -0,0 +1,386 @@ +/** + * @file llhttpclient_tut.cpp + * @brief Testing the HTTP client classes. + * + * $LicenseInfo:firstyear=2006&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +/** + * + * These classes test the HTTP client framework. + * + */ + +#include +#include "linden_common.h" + +// These are too slow on Windows to actually include in the build. JC +#if !LL_WINDOWS + +#include "lltut.h" +#include "llhttpclient.h" +#include "llformat.h" +#include "llpipeutil.h" +#include "llproxy.h" +#include "llpumpio.h" + +#include "llsdhttpserver.h" +#include "lliohttpserver.h" +#include "lliosocket.h" + +namespace tut +{ + LLSD storage; + + class LLSDStorageNode : public LLHTTPNode + { + public: + LLSD simpleGet() const { return storage; } + LLSD simplePut(const LLSD& value) const { storage = value; return LLSD(); } + }; + + class ErrorNode : public LLHTTPNode + { + public: + void get(ResponsePtr r, const LLSD& context) const + { r->status(599, "Intentional error"); } + void post(ResponsePtr r, const LLSD& context, const LLSD& input) const + { r->status(input["status"], input["reason"]); } + }; + + class TimeOutNode : public LLHTTPNode + { + public: + void get(ResponsePtr r, const LLSD& context) const + { + /* do nothing, the request will eventually time out */ + } + }; + + LLHTTPRegistration gStorageNode("/test/storage"); + LLHTTPRegistration gErrorNode("/test/error"); + LLHTTPRegistration gTimeOutNode("/test/timeout"); + + struct HTTPClientTestData + { + public: + HTTPClientTestData() + { + apr_pool_create(&mPool, NULL); + LLCurl::initClass(false); + mServerPump = new LLPumpIO(mPool); + mClientPump = new LLPumpIO(mPool); + + LLHTTPClient::setPump(*mClientPump); + } + + ~HTTPClientTestData() + { + delete mServerPump; + delete mClientPump; + LLProxy::cleanupClass(); + apr_pool_destroy(mPool); + } + + void setupTheServer() + { + LLHTTPNode& root = LLIOHTTPServer::create(mPool, *mServerPump, 8888); + + LLHTTPStandardServices::useServices(); + LLHTTPRegistrar::buildAllServices(root); + } + + void runThePump(float timeout = 100.0f) + { + LLTimer timer; + timer.setTimerExpirySec(timeout); + + while(!mSawCompleted && !mSawCompletedHeader && !timer.hasExpired()) + { + if (mServerPump) + { + mServerPump->pump(); + mServerPump->callback(); + } + if (mClientPump) + { + mClientPump->pump(); + mClientPump->callback(); + } + } + } + + void killServer() + { + delete mServerPump; + mServerPump = NULL; + } + + private: + apr_pool_t* mPool; + LLPumpIO* mServerPump; + LLPumpIO* mClientPump; + + + protected: + void ensureStatusOK() + { + if (mSawError) + { + std::string msg = + llformat("error() called when not expected, status %d", + mStatus); + fail(msg); + } + } + + void ensureStatusError() + { + if (!mSawError) + { + fail("error() wasn't called"); + } + } + + LLSD getResult() + { + return mResult; + } + LLSD getHeader() + { + return mHeader; + } + + protected: + bool mSawError; + U32 mStatus; + std::string mReason; + bool mSawCompleted; + bool mSawCompletedHeader; + LLSD mResult; + LLSD mHeader; + bool mResultDeleted; + + class Result : public LLHTTPClient::Responder + { + protected: + Result(HTTPClientTestData& client) + : mClient(client) + { + } + + public: + static boost::intrusive_ptr build(HTTPClientTestData& client) + { + return boost::intrusive_ptr(new Result(client)); + } + + ~Result() + { + mClient.mResultDeleted = true; + } + + virtual void error(U32 status, const std::string& reason) + { + mClient.mSawError = true; + mClient.mStatus = status; + mClient.mReason = reason; + } + + virtual void result(const LLSD& content) + { + mClient.mResult = content; + } + + virtual void completed( + U32 status, const std::string& reason, + const LLSD& content) + { + LLHTTPClient::Responder::completed(status, reason, content); + + mClient.mSawCompleted = true; + } + + virtual void completedHeader( + U32 status, const std::string& reason, + const LLSD& content) + { + mClient.mHeader = content; + mClient.mSawCompletedHeader = true; + } + + private: + HTTPClientTestData& mClient; + }; + + friend class Result; + + protected: + LLHTTPClient::ResponderPtr newResult() + { + mSawError = false; + mStatus = 0; + mSawCompleted = false; + mSawCompletedHeader = false; + mResult.clear(); + mHeader.clear(); + mResultDeleted = false; + + return Result::build(*this); + } + }; + + + typedef test_group HTTPClientTestGroup; + typedef HTTPClientTestGroup::object HTTPClientTestObject; + HTTPClientTestGroup httpClientTestGroup("http_client"); + + template<> template<> + void HTTPClientTestObject::test<1>() + { + skip("google.com unit tests stopped working 2012-06-06"); + LLHTTPClient::get("http://www.google.com/", newResult()); + runThePump(); + ensureStatusOK(); + ensure("result object wasn't destroyed", mResultDeleted); + } + + template<> template<> + void HTTPClientTestObject::test<2>() + { + skip("error test depends on dev's local ISP not supplying \"helpful\" search page"); + LLHTTPClient::get("http://www.invalid", newResult()); + runThePump(); + ensureStatusError(); + } + + template<> template<> + void HTTPClientTestObject::test<3>() + { + LLSD sd; + + sd["list"][0]["one"] = 1; + sd["list"][0]["two"] = 2; + sd["list"][1]["three"] = 3; + sd["list"][1]["four"] = 4; + + setupTheServer(); + + LLHTTPClient::post("http://localhost:8888/web/echo", sd, newResult()); + runThePump(); + ensureStatusOK(); + ensure_equals("echoed result matches", getResult(), sd); + } + + template<> template<> + void HTTPClientTestObject::test<4>() + { + LLSD sd; + + sd["message"] = "This is my test message."; + + setupTheServer(); + LLHTTPClient::put("http://localhost:8888/test/storage", sd, newResult()); + runThePump(); + ensureStatusOK(); + + LLHTTPClient::get("http://localhost:8888/test/storage", newResult()); + runThePump(); + ensureStatusOK(); + ensure_equals("echoed result matches", getResult(), sd); + + } + + template<> template<> + void HTTPClientTestObject::test<5>() + { + LLSD sd; + sd["status"] = 543; + sd["reason"] = "error for testing"; + + setupTheServer(); + + LLHTTPClient::post("http://localhost:8888/test/error", sd, newResult()); + runThePump(); + ensureStatusError(); + ensure_contains("reason", mReason, sd["reason"]); + } + + template<> template<> + void HTTPClientTestObject::test<6>() + { + setupTheServer(); + + LLHTTPClient::get("http://localhost:8888/test/timeout", newResult()); + runThePump(1.0f); + killServer(); + runThePump(); + ensureStatusError(); + ensure_equals("reason", mReason, "STATUS_ERROR"); + } + + template<> template<> + void HTTPClientTestObject::test<7>() + { + // Can not use the little mini server. The blocking request + // won't ever let it run. Instead get from a known LLSD + // source and compare results with the non-blocking get which + // is tested against the mini server earlier. + skip("secondlife.com is not reliable enough for unit tests."); + + + LLSD expected; + + LLHTTPClient::get("http://secondlife.com/xmlhttp/homepage.php", newResult()); + runThePump(); + ensureStatusOK(); + expected = getResult(); + + LLSD result; + result = LLHTTPClient::blockingGet("http://secondlife.com/xmlhttp/homepage.php"); + LLSD body = result["body"]; + ensure_equals("echoed result matches", body.size(), expected.size()); + } + template<> template<> + void HTTPClientTestObject::test<8>() + { + skip("google.com unit tests stopped working 2012-06-06"); + // This is testing for the presence of the Header in the returned results + // from an HTTP::get call. + LLHTTPClient::get("http://www.google.com/", newResult()); + runThePump(); + ensureStatusOK(); + LLSD header = getHeader(); + ensure_equals("got a header", header.emptyMap().asBoolean(), FALSE); + } + template<> template<> + void HTTPClientTestObject::test<9>() + { + skip("google.com unit tests stopped working 2012-06-06"); + LLHTTPClient::head("http://www.google.com/", newResult()); + runThePump(); + ensureStatusOK(); + ensure("result object wasn't destroyed", mResultDeleted); + } +} + +#endif // !LL_WINDOWS diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index 328ab4ca51..816f1d7175 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -37,7 +37,6 @@ set(test_SOURCE_FILES lldoubledispatch_tut.cpp llevents_tut.cpp llhttpdate_tut.cpp - llhttpclient_tut.cpp llhttpnode_tut.cpp lliohttpserver_tut.cpp llmessageconfig_tut.cpp diff --git a/indra/test/llhttpclient_tut.cpp b/indra/test/llhttpclient_tut.cpp deleted file mode 100644 index 1e0296918c..0000000000 --- a/indra/test/llhttpclient_tut.cpp +++ /dev/null @@ -1,386 +0,0 @@ -/** - * @file llhttpclient_tut.cpp - * @brief Testing the HTTP client classes. - * - * $LicenseInfo:firstyear=2006&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -/** - * - * These classes test the HTTP client framework. - * - */ - -#include -#include "linden_common.h" - -// These are too slow on Windows to actually include in the build. JC -#if !LL_WINDOWS - -#include "lltut.h" -#include "llhttpclient.h" -#include "llformat.h" -#include "llpipeutil.h" -#include "llproxy.h" -#include "llpumpio.h" - -#include "llsdhttpserver.h" -#include "lliohttpserver.h" -#include "lliosocket.h" - -namespace tut -{ - LLSD storage; - - class LLSDStorageNode : public LLHTTPNode - { - public: - LLSD simpleGet() const { return storage; } - LLSD simplePut(const LLSD& value) const { storage = value; return LLSD(); } - }; - - class ErrorNode : public LLHTTPNode - { - public: - void get(ResponsePtr r, const LLSD& context) const - { r->status(599, "Intentional error"); } - void post(ResponsePtr r, const LLSD& context, const LLSD& input) const - { r->status(input["status"], input["reason"]); } - }; - - class TimeOutNode : public LLHTTPNode - { - public: - void get(ResponsePtr r, const LLSD& context) const - { - /* do nothing, the request will eventually time out */ - } - }; - - LLHTTPRegistration gStorageNode("/test/storage"); - LLHTTPRegistration gErrorNode("/test/error"); - LLHTTPRegistration gTimeOutNode("/test/timeout"); - - struct HTTPClientTestData - { - public: - HTTPClientTestData() - { - apr_pool_create(&mPool, NULL); - LLCurl::initClass(false); - mServerPump = new LLPumpIO(mPool); - mClientPump = new LLPumpIO(mPool); - - LLHTTPClient::setPump(*mClientPump); - } - - ~HTTPClientTestData() - { - delete mServerPump; - delete mClientPump; - LLProxy::cleanupClass(); - apr_pool_destroy(mPool); - } - - void setupTheServer() - { - LLHTTPNode& root = LLIOHTTPServer::create(mPool, *mServerPump, 8888); - - LLHTTPStandardServices::useServices(); - LLHTTPRegistrar::buildAllServices(root); - } - - void runThePump(float timeout = 100.0f) - { - LLTimer timer; - timer.setTimerExpirySec(timeout); - - while(!mSawCompleted && !mSawCompletedHeader && !timer.hasExpired()) - { - if (mServerPump) - { - mServerPump->pump(); - mServerPump->callback(); - } - if (mClientPump) - { - mClientPump->pump(); - mClientPump->callback(); - } - } - } - - void killServer() - { - delete mServerPump; - mServerPump = NULL; - } - - private: - apr_pool_t* mPool; - LLPumpIO* mServerPump; - LLPumpIO* mClientPump; - - - protected: - void ensureStatusOK() - { - if (mSawError) - { - std::string msg = - llformat("error() called when not expected, status %d", - mStatus); - fail(msg); - } - } - - void ensureStatusError() - { - if (!mSawError) - { - fail("error() wasn't called"); - } - } - - LLSD getResult() - { - return mResult; - } - LLSD getHeader() - { - return mHeader; - } - - protected: - bool mSawError; - U32 mStatus; - std::string mReason; - bool mSawCompleted; - bool mSawCompletedHeader; - LLSD mResult; - LLSD mHeader; - bool mResultDeleted; - - class Result : public LLHTTPClient::Responder - { - protected: - Result(HTTPClientTestData& client) - : mClient(client) - { - } - - public: - static boost::intrusive_ptr build(HTTPClientTestData& client) - { - return boost::intrusive_ptr(new Result(client)); - } - - ~Result() - { - mClient.mResultDeleted = true; - } - - virtual void error(U32 status, const std::string& reason) - { - mClient.mSawError = true; - mClient.mStatus = status; - mClient.mReason = reason; - } - - virtual void result(const LLSD& content) - { - mClient.mResult = content; - } - - virtual void completed( - U32 status, const std::string& reason, - const LLSD& content) - { - LLHTTPClient::Responder::completed(status, reason, content); - - mClient.mSawCompleted = true; - } - - virtual void completedHeader( - U32 status, const std::string& reason, - const LLSD& content) - { - mClient.mHeader = content; - mClient.mSawCompletedHeader = true; - } - - private: - HTTPClientTestData& mClient; - }; - - friend class Result; - - protected: - LLHTTPClient::ResponderPtr newResult() - { - mSawError = false; - mStatus = 0; - mSawCompleted = false; - mSawCompletedHeader = false; - mResult.clear(); - mHeader.clear(); - mResultDeleted = false; - - return Result::build(*this); - } - }; - - - typedef test_group HTTPClientTestGroup; - typedef HTTPClientTestGroup::object HTTPClientTestObject; - HTTPClientTestGroup httpClientTestGroup("http_client"); - - template<> template<> - void HTTPClientTestObject::test<1>() - { - skip("google.com unit tests stopped working 2012-06-06"); - LLHTTPClient::get("http://www.google.com/", newResult()); - runThePump(); - ensureStatusOK(); - ensure("result object wasn't destroyed", mResultDeleted); - } - - template<> template<> - void HTTPClientTestObject::test<2>() - { - skip("error test depends on dev's local ISP not supplying \"helpful\" search page"); - LLHTTPClient::get("http://www.invalid", newResult()); - runThePump(); - ensureStatusError(); - } - - template<> template<> - void HTTPClientTestObject::test<3>() - { - LLSD sd; - - sd["list"][0]["one"] = 1; - sd["list"][0]["two"] = 2; - sd["list"][1]["three"] = 3; - sd["list"][1]["four"] = 4; - - setupTheServer(); - - LLHTTPClient::post("http://localhost:8888/web/echo", sd, newResult()); - runThePump(); - ensureStatusOK(); - ensure_equals("echoed result matches", getResult(), sd); - } - - template<> template<> - void HTTPClientTestObject::test<4>() - { - LLSD sd; - - sd["message"] = "This is my test message."; - - setupTheServer(); - LLHTTPClient::put("http://localhost:8888/test/storage", sd, newResult()); - runThePump(); - ensureStatusOK(); - - LLHTTPClient::get("http://localhost:8888/test/storage", newResult()); - runThePump(); - ensureStatusOK(); - ensure_equals("echoed result matches", getResult(), sd); - - } - - template<> template<> - void HTTPClientTestObject::test<5>() - { - LLSD sd; - sd["status"] = 543; - sd["reason"] = "error for testing"; - - setupTheServer(); - - LLHTTPClient::post("http://localhost:8888/test/error", sd, newResult()); - runThePump(); - ensureStatusError(); - ensure_contains("reason", mReason, sd["reason"]); - } - - template<> template<> - void HTTPClientTestObject::test<6>() - { - setupTheServer(); - - LLHTTPClient::get("http://localhost:8888/test/timeout", newResult()); - runThePump(1.0f); - killServer(); - runThePump(); - ensureStatusError(); - ensure_equals("reason", mReason, "STATUS_ERROR"); - } - - template<> template<> - void HTTPClientTestObject::test<7>() - { - // Can not use the little mini server. The blocking request - // won't ever let it run. Instead get from a known LLSD - // source and compare results with the non-blocking get which - // is tested against the mini server earlier. - skip("secondlife.com is not reliable enough for unit tests."); - - - LLSD expected; - - LLHTTPClient::get("http://secondlife.com/xmlhttp/homepage.php", newResult()); - runThePump(); - ensureStatusOK(); - expected = getResult(); - - LLSD result; - result = LLHTTPClient::blockingGet("http://secondlife.com/xmlhttp/homepage.php"); - LLSD body = result["body"]; - ensure_equals("echoed result matches", body.size(), expected.size()); - } - template<> template<> - void HTTPClientTestObject::test<8>() - { - skip("google.com unit tests stopped working 2012-06-06"); - // This is testing for the presence of the Header in the returned results - // from an HTTP::get call. - LLHTTPClient::get("http://www.google.com/", newResult()); - runThePump(); - ensureStatusOK(); - LLSD header = getHeader(); - ensure_equals("got a header", header.emptyMap().asBoolean(), FALSE); - } - template<> template<> - void HTTPClientTestObject::test<9>() - { - skip("google.com unit tests stopped working 2012-06-06"); - LLHTTPClient::head("http://www.google.com/", newResult()); - runThePump(); - ensureStatusOK(); - ensure("result object wasn't destroyed", mResultDeleted); - } -} - -#endif // !LL_WINDOWS -- cgit v1.2.3 From 3d1cb7ef111cbd5724262077702e0dc2a3d6998d Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 6 Jun 2012 23:12:11 -0400 Subject: MAINT-1144: Re-enable skipped LLHTTPClient tests with local server. Over the years we've skipped more and more of the tests in llhttpclient_test.cpp (nee llhttpclient_tut.cpp) because they've relied on particular behaviors from Internet sites not under our control. We skipped a test that fetches llsd+xml from secondlife.com because "secondlife.com is not reliable enough for unit tests." We skipped a test that tries to observe a failure with "http://www.invalid" because some local ISPs turn "no such domain" DNS errors into valid pages offering the requester to buy the specified domain name. Today we've had to skip tests attempting to contact "http://www.google.com" for reasons we haven't yet diagnosed, but that probably have to do with Google's IPv6 rollout. Use local temp server test_llsdmessage_peer.py as the success destination, eliminating DNS, Internet access and remote server behavior as failure modes. Use idle localhost port for failure test. Re-enable all skipped LLHTTPClient tests! Re-enable on Windows! In support of these tests, modify test_llsdmessage_peer.py: Support HEAD as no-data variant of GET. Change GET result dict to avoid resembling an error response -- confusing. Make GET/POST return actual dict rather than undecorated string "success". Because of that last, change llcapabilitylistener_test.cpp and llsdmessage_test.cpp to extract "reply" key from response rather than expecting response to be a string itself. --- indra/llmessage/tests/llhttpclient_test.cpp | 40 +++++++++-------------- indra/llmessage/tests/llsdmessage_test.cpp | 2 +- indra/llmessage/tests/test_llsdmessage_peer.py | 19 +++++++---- indra/newview/tests/llcapabilitylistener_test.cpp | 2 +- 4 files changed, 30 insertions(+), 33 deletions(-) diff --git a/indra/llmessage/tests/llhttpclient_test.cpp b/indra/llmessage/tests/llhttpclient_test.cpp index 1e0296918c..986fd5f3fc 100644 --- a/indra/llmessage/tests/llhttpclient_test.cpp +++ b/indra/llmessage/tests/llhttpclient_test.cpp @@ -1,5 +1,5 @@ /** - * @file llhttpclient_tut.cpp + * @file llhttpclient_test.cpp * @brief Testing the HTTP client classes. * * $LicenseInfo:firstyear=2006&license=viewerlgpl$ @@ -33,9 +33,6 @@ #include #include "linden_common.h" -// These are too slow on Windows to actually include in the build. JC -#if !LL_WINDOWS - #include "lltut.h" #include "llhttpclient.h" #include "llformat.h" @@ -46,6 +43,7 @@ #include "llsdhttpserver.h" #include "lliohttpserver.h" #include "lliosocket.h" +#include "stringize.h" namespace tut { @@ -83,7 +81,8 @@ namespace tut struct HTTPClientTestData { public: - HTTPClientTestData() + HTTPClientTestData(): + local_server(STRINGIZE("http://127.0.0.1:" << getenv("PORT") << "/")) { apr_pool_create(&mPool, NULL); LLCurl::initClass(false); @@ -134,13 +133,14 @@ namespace tut delete mServerPump; mServerPump = NULL; } - + + const std::string local_server; + private: apr_pool_t* mPool; LLPumpIO* mServerPump; LLPumpIO* mClientPump; - protected: void ensureStatusOK() { @@ -257,8 +257,7 @@ namespace tut template<> template<> void HTTPClientTestObject::test<1>() { - skip("google.com unit tests stopped working 2012-06-06"); - LLHTTPClient::get("http://www.google.com/", newResult()); + LLHTTPClient::get(local_server, newResult()); runThePump(); ensureStatusOK(); ensure("result object wasn't destroyed", mResultDeleted); @@ -267,8 +266,8 @@ namespace tut template<> template<> void HTTPClientTestObject::test<2>() { - skip("error test depends on dev's local ISP not supplying \"helpful\" search page"); - LLHTTPClient::get("http://www.invalid", newResult()); + // Please nobody listen on this particular port... + LLHTTPClient::get("http://127.0.0.1:7950", newResult()); runThePump(); ensureStatusError(); } @@ -345,28 +344,22 @@ namespace tut // won't ever let it run. Instead get from a known LLSD // source and compare results with the non-blocking get which // is tested against the mini server earlier. - skip("secondlife.com is not reliable enough for unit tests."); - - - LLSD expected; - - LLHTTPClient::get("http://secondlife.com/xmlhttp/homepage.php", newResult()); + LLHTTPClient::get(local_server, newResult()); runThePump(); ensureStatusOK(); - expected = getResult(); + LLSD expected = getResult(); LLSD result; - result = LLHTTPClient::blockingGet("http://secondlife.com/xmlhttp/homepage.php"); + result = LLHTTPClient::blockingGet(local_server); LLSD body = result["body"]; ensure_equals("echoed result matches", body.size(), expected.size()); } template<> template<> void HTTPClientTestObject::test<8>() { - skip("google.com unit tests stopped working 2012-06-06"); // This is testing for the presence of the Header in the returned results // from an HTTP::get call. - LLHTTPClient::get("http://www.google.com/", newResult()); + LLHTTPClient::get(local_server, newResult()); runThePump(); ensureStatusOK(); LLSD header = getHeader(); @@ -375,12 +368,9 @@ namespace tut template<> template<> void HTTPClientTestObject::test<9>() { - skip("google.com unit tests stopped working 2012-06-06"); - LLHTTPClient::head("http://www.google.com/", newResult()); + LLHTTPClient::head(local_server, newResult()); runThePump(); ensureStatusOK(); ensure("result object wasn't destroyed", mResultDeleted); } } - -#endif // !LL_WINDOWS diff --git a/indra/llmessage/tests/llsdmessage_test.cpp b/indra/llmessage/tests/llsdmessage_test.cpp index 0f2c069303..31a791e4b4 100644 --- a/indra/llmessage/tests/llsdmessage_test.cpp +++ b/indra/llmessage/tests/llsdmessage_test.cpp @@ -143,7 +143,7 @@ namespace tut httpPump.post(request); ensure("got response", netio.pump()); ensure("success response", success); - ensure_equals(result.asString(), "success"); + ensure_equals(result["reply"].asString(), "success"); body["status"] = 499; body["reason"] = "custom error message"; diff --git a/indra/llmessage/tests/test_llsdmessage_peer.py b/indra/llmessage/tests/test_llsdmessage_peer.py index 22edd9dad8..fe4f3a8c01 100644 --- a/indra/llmessage/tests/test_llsdmessage_peer.py +++ b/indra/llmessage/tests/test_llsdmessage_peer.py @@ -78,25 +78,32 @@ class TestHTTPRequestHandler(BaseHTTPRequestHandler): ## debug("root node tag %s", tree.getroot().tag) ## return llsd.to_python(tree.getroot()) - def do_GET(self): + def do_HEAD(self): + self.do_GET(withdata=False) + + def do_GET(self, withdata=True): # Of course, don't attempt to read data. - self.answer(dict(reply="success", status=500, - reason="Your GET operation requested failure")) + data = dict(reply="success", body="avatar", random=17) + self.answer(data, withdata=withdata) def do_POST(self): # Read the provided POST data. self.answer(self.read_xml()) - def answer(self, data): + def answer(self, data, withdata=True): debug("%s.answer(%s): self.path = %r", self.__class__.__name__, data, self.path) if "fail" not in self.path: - response = llsd.format_xml(data.get("reply", llsd.LLSD("success"))) + data = data.copy() # we're going to modify + # Ensure there's a "reply" key in data, even if there wasn't before + data["reply"] = data.get("reply", llsd.LLSD("success")) + response = llsd.format_xml(data) debug("success: %s", response) self.send_response(200) self.send_header("Content-type", "application/llsd+xml") self.send_header("Content-Length", str(len(response))) self.end_headers() - self.wfile.write(response) + if withdata: + self.wfile.write(response) else: # fail requested status = data.get("status", 500) # self.responses maps an int status to a (short, long) pair of diff --git a/indra/newview/tests/llcapabilitylistener_test.cpp b/indra/newview/tests/llcapabilitylistener_test.cpp index 2ad08dc1f3..e1cbd28f92 100644 --- a/indra/newview/tests/llcapabilitylistener_test.cpp +++ b/indra/newview/tests/llcapabilitylistener_test.cpp @@ -156,7 +156,7 @@ namespace tut regionPump.post(request); ensure("got response", netio.pump()); ensure("success response", success); - ensure_equals(result.asString(), "success"); + ensure_equals(result["reply"].asString(), "success"); body["status"] = 499; body["reason"] = "custom error message"; -- cgit v1.2.3 From d167ebe35f8cdec1ca88e0d817e2878f14a5aa68 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 7 Jun 2012 05:46:47 -0400 Subject: MAINT-1144: Try to fix Windows build error in llhttpclient_test.cpp. --- indra/llmessage/tests/llhttpclient_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llmessage/tests/llhttpclient_test.cpp b/indra/llmessage/tests/llhttpclient_test.cpp index 986fd5f3fc..843c3bcc4b 100644 --- a/indra/llmessage/tests/llhttpclient_test.cpp +++ b/indra/llmessage/tests/llhttpclient_test.cpp @@ -363,7 +363,7 @@ namespace tut runThePump(); ensureStatusOK(); LLSD header = getHeader(); - ensure_equals("got a header", header.emptyMap().asBoolean(), FALSE); + ensure("got a header", ! header.emptyMap().asBoolean()); } template<> template<> void HTTPClientTestObject::test<9>() -- cgit v1.2.3