summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llmaterialmgr.cpp23
-rw-r--r--indra/newview/llmaterialmgr.h5
-rwxr-xr-xindra/newview/llviewerregion.cpp12
-rwxr-xr-xindra/newview/llviewerregion.h1
4 files changed, 15 insertions, 26 deletions
diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp
index 96dd402d84..658fea944d 100644
--- a/indra/newview/llmaterialmgr.cpp
+++ b/indra/newview/llmaterialmgr.cpp
@@ -50,9 +50,7 @@
#define MATERIALS_CAP_MATERIAL_FIELD "Material"
#define MATERIALS_CAP_OBJECT_ID_FIELD "ID"
#define MATERIALS_CAP_MATERIAL_ID_FIELD "MaterialID"
-#define SIM_FEATURE_MAX_MATERIALS_PER_TRANSACTION "MaxMaterialsPerTransaction"
-#define MATERIALS_DEFAULT_MAX_ENTRIES 50
#define MATERIALS_GET_TIMEOUT (60.f * 20)
#define MATERIALS_POST_TIMEOUT (60.f * 5)
#define MATERIALS_PUT_THROTTLE_SECS 1.f
@@ -592,7 +590,7 @@ void LLMaterialMgr::processGetQueue()
LLSD materialsData = LLSD::emptyArray();
material_queue_t& materials = itRegionQueue->second;
- U32 max_entries = getMaxEntries(regionp);
+ U32 max_entries = regionp->getMaxMaterialsPerTransaction();
material_queue_t::iterator loopMaterial = materials.begin();
while ( (materials.end() != loopMaterial) && (materialsData.size() < max_entries) )
{
@@ -698,7 +696,7 @@ void LLMaterialMgr::processPutQueue()
LLSD& facesData = requests[regionp];
facematerial_map_t& face_map = itQueue->second;
- U32 max_entries = getMaxEntries(regionp);
+ U32 max_entries = regionp->getMaxMaterialsPerTransaction();
facematerial_map_t::iterator itFace = face_map.begin();
while ( (face_map.end() != itFace) && (facesData.size() < max_entries) )
{
@@ -785,20 +783,3 @@ void LLMaterialMgr::onRegionRemoved(LLViewerRegion* regionp)
// Put doesn't need clearing: objects that can't be found will clean up in processPutQueue()
}
-U32 LLMaterialMgr::getMaxEntries(const LLViewerRegion* regionp)
-{
- LLSD sim_features;
- regionp->getSimulatorFeatures(sim_features);
- U32 max_entries;
- if ( sim_features.has( SIM_FEATURE_MAX_MATERIALS_PER_TRANSACTION )
- && sim_features[ SIM_FEATURE_MAX_MATERIALS_PER_TRANSACTION ].isInteger())
- {
- max_entries = sim_features[ SIM_FEATURE_MAX_MATERIALS_PER_TRANSACTION ].asInteger();
- }
- else
- {
- max_entries = MATERIALS_DEFAULT_MAX_ENTRIES;
- }
- return max_entries;
-}
-
diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h
index 2836019c27..e317a791ad 100644
--- a/indra/newview/llmaterialmgr.h
+++ b/indra/newview/llmaterialmgr.h
@@ -124,11 +124,6 @@ protected:
put_queue_t mPutQueue;
material_map_t mMaterials;
-
- U32 getMaxEntries(const LLViewerRegion* regionp);
-
- LLFrameTimer mCapThrottleTimer;
- F32 getThrottleIntervalSecs(const LLUUID& region_id);
};
#endif // LL_LLMATERIALMGR_H
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 0f8decc643..b541a35111 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1976,3 +1976,15 @@ void LLViewerRegion::resetMaterialsCapThrottle()
mMaterialsCapThrottleTimer.resetWithExpiry( 1.0f / requests_per_sec );
}
+U32 LLViewerRegion::getMaxMaterialsPerTransaction() const
+{
+ U32 max_entries = 50; // original hard coded default
+ if ( mSimulatorFeatures.has( "MaxMaterialsPerTransaction" )
+ && mSimulatorFeatures[ "MaxMaterialsPerTransaction" ].isInteger())
+ {
+ max_entries = mSimulatorFeatures[ "MaxMaterialsPerTransaction" ].asInteger();
+ }
+ return max_entries;
+}
+
+
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index a3db7f5ac7..109baccf9a 100755
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -348,6 +348,7 @@ public:
bool materialsCapThrottled() const { return !mMaterialsCapThrottleTimer.hasExpired(); }
void resetMaterialsCapThrottle();
+ U32 getMaxMaterialsPerTransaction() const;
public:
struct CompareDistance
{