summaryrefslogtreecommitdiff
path: root/indra/newview/llgltfmateriallist.h
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-07-18 00:01:10 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-07-18 06:37:11 +0300
commite3a7ad3d35d1bf51544829b698525e7dcac5a8c8 (patch)
tree8784010f1d7aa06c835c8a0a2dfcfe9810757f26 /indra/newview/llgltfmateriallist.h
parent5482d6a92fcc2eb4f8506a521c2386849a2e9172 (diff)
viewer#2027 Cannot apply PBR Materials on larger linksets
Split updates into batches that respect server update limit
Diffstat (limited to 'indra/newview/llgltfmateriallist.h')
-rw-r--r--indra/newview/llgltfmateriallist.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/indra/newview/llgltfmateriallist.h b/indra/newview/llgltfmateriallist.h
index 982538f106..e79da3592a 100644
--- a/indra/newview/llgltfmateriallist.h
+++ b/indra/newview/llgltfmateriallist.h
@@ -58,7 +58,9 @@ public:
// NOTE: do not use to revert to asset when applying a new asset id, use queueApply below
static void queueModify(const LLViewerObject* obj, S32 side, const LLGLTFMaterial* mat);
- // Queue an application of a material asset we want to send to the simulator. Call "flushUpdates" to flush pending updates.
+ // Queue an application of a material asset we want to send to the simulator.
+ // Call "flushUpdates" to flush pending updates immediately.
+ // Will be flushed automatically if queue is full.
// object_id - ID of object to apply material asset to
// side - TextureEntry index to apply material to, or -1 for all sides
// asset_id - ID of material asset to apply, or LLUUID::null to disassociate current material asset
@@ -66,7 +68,9 @@ public:
// NOTE: Implicitly clears most override data if present
static void queueApply(const LLViewerObject* obj, S32 side, const LLUUID& asset_id);
- // Queue an application of a material asset we want to send to the simulator. Call "flushUpdates" to flush pending updates.
+ // Queue an application of a material asset we want to send to the simulator.
+ // Call "flushUpdates" to flush pending updates immediately.
+ // Will be flushed automatically if queue is full.
// object_id - ID of object to apply material asset to
// side - TextureEntry index to apply material to, or -1 for all sides
// asset_id - ID of material asset to apply, or LLUUID::null to disassociate current material asset
@@ -104,7 +108,22 @@ private:
// NOTE: this is NOT for applying overrides from the UI, see queueModifyMaterial above
void queueOverrideUpdate(const LLUUID& id, S32 side, LLGLTFMaterial* override_data);
- static void modifyMaterialCoro(std::string cap_url, LLSD overrides, void(*done_callback)(bool));
+
+ class CallbackHolder
+ {
+ public:
+ CallbackHolder(void(*done_callback)(bool))
+ : mCallback(done_callback)
+ {}
+ ~CallbackHolder()
+ {
+ if (mCallback) mCallback(mSuccess);
+ }
+ std::function<void(bool)> mCallback = nullptr;
+ bool mSuccess = true;
+ };
+ static void flushUpdatesOnce(std::shared_ptr<CallbackHolder> callback_holder);
+ static void modifyMaterialCoro(std::string cap_url, LLSD overrides, std::shared_ptr<CallbackHolder> callback_holder);
protected:
static void onAssetLoadComplete(