Skip to content
Snippets Groups Projects
Commit 8238aee5 authored by Kitty Barnett's avatar Kitty Barnett
Browse files

Add LLVisualEffectParams (and derived LLShaderEffectParams)

parent 099c23ab
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
}
......
......@@ -22,6 +22,12 @@
//
//
class LLRenderTarget;
// ============================================================================
//
//
enum class EVisualEffect
{
RlvOverlay,
......@@ -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 @@ class LLVisualEffect
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 @@ class LLVfxManager : public LLSingleton<LLVfxManager>
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:
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment