Add LLVisualEffectParams (and derived LLShaderEffectParams)

meow-7.2.2
Kitty Barnett 2021-01-13 22:10:23 +01:00
parent 099c23ab68
commit 8238aee560
2 changed files with 29 additions and 7 deletions

View File

@ -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);
}
}

View File

@ -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<typename T> T* getEffect(EVisualEffect eCode) const { return dynamic_cast<T*>(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:
/*