summaryrefslogtreecommitdiff
path: root/indra/newview/llmeshrepository.h
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2018-04-25 17:10:21 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2018-04-25 17:10:21 +0100
commit7d91a263a8a634b0148fcd9b1a3af28f7b58ca1c (patch)
treed20c4abeb555c3efbf04a2b04af9e447bfe34455 /indra/newview/llmeshrepository.h
parentbc773adf618eb531fdccacd95f4cd51f6b87497a (diff)
MAINT-8549 - more on animesh ARC and associated refactoring
Diffstat (limited to 'indra/newview/llmeshrepository.h')
-rw-r--r--indra/newview/llmeshrepository.h52
1 files changed, 33 insertions, 19 deletions
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index e43f719471..9bf12e9e41 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -452,42 +452,57 @@ private:
};
// Params related to streaming cost, render cost, and scene complexity tracking.
-struct LLMeshCostData
+class LLMeshCostData
{
+public:
LLMeshCostData();
- // From the "size" field of the mesh header. LOD 0=lowest, 3=highest.
- std::vector<S32> mSizeByLOD;
+ bool init(const LLSD& header);
+
+ // Size for given LOD
+ S32 getSizeByLOD(S32 lod);
- // Estimated triangle counts derived from the LOD sizes. LOD 0=lowest, 3=highest.
- std::vector<F32> mEstTrisByLOD;
+ // Sum of all LOD sizes.
+ S32 getSizeTotal();
+ // Estimated triangle counts for the given LOD.
+ F32 getEstTrisByLOD(S32 lod);
+
// Estimated triangle counts for the largest LOD. Typically this
// is also the "high" LOD, but not necessarily.
- F32 mEstTrisMax;
-
- // Sum of all LOD sizes.
- S32 mSizeTotal;
-
- // Helper functions for building data
+ F32 getEstTrisMax();
// Triangle count as computed by original streaming cost
// formula. Triangles in each LOD are weighted based on how
// frequently they will be seen.
// This was called "unscaled_value" in the original getStreamingCost() functions.
- F32 computeRadiusWeightedTris(F32 radius);
+ F32 getRadiusWeightedTris(F32 radius);
// Triangle count used by triangle-based cost formula. Based on
// triangles in highest LOD plus potentially partial charges for
// lower LODs depending on complexity.
- F32 computeEstTrisForStreamingCost();
+ F32 getEstTrisForStreamingCost();
// Streaming cost. This should match the server-side calculation
// for the corresponding volume.
- F32 computeRadiusBasedStreamingCost(F32 radius);
+ F32 getRadiusBasedStreamingCost(F32 radius);
// New streaming cost formula, currently only used for animated objects.
- F32 computeTriangleBasedStreamingCost();
+ F32 getTriangleBasedStreamingCost();
+
+private:
+ // From the "size" field of the mesh header. LOD 0=lowest, 3=highest.
+ std::vector<S32> mSizeByLOD;
+
+ // Estimated triangle counts derived from the LOD sizes. LOD 0=lowest, 3=highest.
+ std::vector<F32> mEstTrisByLOD;
+
+ // Estimated triangle counts for the largest LOD. Typically this
+ // is also the "high" LOD, but not necessarily.
+ F32 mEstTrisMax;
+
+ // Sum of all LOD sizes.
+ S32 mSizeTotal;
};
class LLMeshRepository
@@ -511,14 +526,13 @@ public:
static LLDeadmanTimer sQuiescentTimer; // Time-to-complete-mesh-downloads after significant events
- bool getLODSizes(LLSD& header, std::vector<S32>& lod_byte_sizes, std::vector<F32>& lod_tri_counts);
// Estimated triangle count of the largest LOD
F32 getEstTrianglesMax(LLUUID mesh_id);
F32 getEstTrianglesStreamingCost(LLUUID mesh_id);
- F32 getStreamingCost(LLUUID mesh_id, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL);
- static F32 getStreamingCost(LLSD& header, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL);
+ F32 getStreamingCostLegacy(LLUUID mesh_id, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL);
+ static F32 getStreamingCostLegacy(LLSD& header, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL);
bool getCostData(LLUUID mesh_id, LLMeshCostData& data);
- bool getCostData(LLSD& header, LLUUID mesh_id, LLMeshCostData& data);
+ bool getCostData(LLSD& header, LLMeshCostData& data);
LLMeshRepository();