diff --git a/indra/newview/llvisualeffect.cpp b/indra/newview/llvisualeffect.cpp index 23c9065f96..88e0b35807 100644 --- a/indra/newview/llvisualeffect.cpp +++ b/indra/newview/llvisualeffect.cpp @@ -107,7 +107,7 @@ bool LLVfxManager::removeEffect(const LLUUID& idEffect) return true; } -void LLVfxManager::runEffect(EVisualEffect eCode) +void LLVfxManager::runEffect(EVisualEffect eCode, const LLVisualEffectParams* pParams) { // *TODO-Catz: once we're done, check whether iterating over the entire list still has negliable impact auto pred = [eCode](const LLVisualEffect* pEffect) { return pEffect->getCode() == eCode; }; @@ -118,11 +118,11 @@ void LLVfxManager::runEffect(EVisualEffect eCode) auto effectRange = boost::make_iterator_range(beginEffect, endEffect); for (LLVisualEffect* pEffect : effectRange) { - pEffect->run(); + pEffect->run(pParams); } } -void LLVfxManager::runEffect(EVisualEffectType eType) +void LLVfxManager::runEffect(EVisualEffectType eType, const LLVisualEffectParams* pParams) { // *TODO-Catz: once we're done, check whether iterating over the entire list still has negliable impact auto pred = [eType](const LLVisualEffect* pEffect) { return pEffect->getType() == eType; }; @@ -133,7 +133,7 @@ void LLVfxManager::runEffect(EVisualEffectType eType) auto effectRange = boost::make_iterator_range(beginEffect, endEffect); for (LLVisualEffect* pEffect : effectRange) { - pEffect->run(); + pEffect->run(pParams); } } diff --git a/indra/newview/llvisualeffect.h b/indra/newview/llvisualeffect.h index 86f3ab56c7..fb11881e21 100644 --- a/indra/newview/llvisualeffect.h +++ b/indra/newview/llvisualeffect.h @@ -18,6 +18,12 @@ #include "llsingleton.h" +// ============================================================================ +// +// + +class LLRenderTarget; + // ============================================================================ // // @@ -38,6 +44,22 @@ enum class EVisualEffectType // // +struct LLVisualEffectParams +{ +}; + +struct LLShaderEffectParams : LLVisualEffectParams +{ + explicit LLShaderEffectParams(LLRenderTarget* pSrcBuffer, LLRenderTarget* pDstBuffer) : m_pSrcBuffer(pSrcBuffer), m_pDstBuffer(pDstBuffer) {} + + LLRenderTarget* m_pSrcBuffer = nullptr; + LLRenderTarget* m_pDstBuffer = nullptr; +}; + +// ============================================================================ +// +// + class LLVisualEffect { public: @@ -51,7 +73,7 @@ public: U32 getPriority() const { return m_nPriority; } EVisualEffectType getType() const { return m_eType;} - virtual void run() = 0; + virtual void run(const LLVisualEffectParams* pParams) = 0; /* * Member variables @@ -139,8 +161,8 @@ public: LLVisualEffect* getEffect(EVisualEffect eCode) const; template T* getEffect(EVisualEffect eCode) const { return dynamic_cast(getEffect(eCode)); } bool removeEffect(const LLUUID& idEffect); - void runEffect(EVisualEffect eCode); - void runEffect(EVisualEffectType eType); + void runEffect(EVisualEffect eCode, const LLVisualEffectParams* pParams = nullptr); + void runEffect(EVisualEffectType eType, const LLVisualEffectParams* pParams = nullptr); protected: /*