[FIXED] Crash when @setsphere is issued with ALM enabled without shadows, ambient occlusion, depth of field, or antialiasing

master
Kitty Barnett 2021-07-11 23:26:01 +02:00
parent 6a5ae01384
commit fe5a2e717e
4 changed files with 23 additions and 3 deletions

View File

@ -966,7 +966,10 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
mFXAABuffer.release();
}
if (shadow_detail > 0 || ssao || RenderDepthOfField || samples > 0)
// if (shadow_detail > 0 || ssao || RenderDepthOfField || samples > 0)
// [RLVa:KB] - @setsphere
if (shadow_detail > 0 || ssao || RenderDepthOfField || samples > 0 || RlvActions::hasPostProcess())
// [/RLVa:KB]
{ //only need mDeferredLight for shadows OR ssao OR dof OR fxaa
if (!mDeferredLight.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false;
}

View File

@ -18,6 +18,7 @@
#include "llagent.h"
#include "llimview.h"
#include "llviewercamera.h"
#include "llvisualeffect.h"
#include "llvoavatarself.h"
#include "llworld.h"
@ -397,6 +398,11 @@ bool RlvActions::canChangeEnvironment(const LLUUID& idRlvObject)
return (idRlvObject.isNull()) ? !gRlvHandler.hasBehaviour(RLV_BHVR_SETENV) : !gRlvHandler.hasBehaviourExcept(RLV_BHVR_SETENV, idRlvObject);
}
bool RlvActions::hasPostProcess()
{
return LLVfxManager::instance().hasEffect(EVisualEffect::RlvSphere);
}
// ============================================================================
// World interaction
//

View File

@ -236,6 +236,10 @@ public:
*/
static bool canChangeEnvironment(const LLUUID& idRlvObject = LLUUID::null);
/*
* Returns true if a postprocessing shader is currently active
*/
static bool hasPostProcess();
// =================
// World interaction

View File

@ -2124,6 +2124,8 @@ ERlvCmdRet RlvBehaviourHandler<RLV_BHVR_SETSPHERE>::onCommand(const RlvCommand&
{
if (gRlvHandler.hasBehaviour(rlvCmd.getObjectID(), rlvCmd.getBehaviourType()))
{
LLVfxManager::instance().addEffect(new RlvSphereEffect(rlvCmd.getObjectID()));
Rlv::forceAtmosphericShadersIfAvailable();
// If we're not using deferred but are using Windlight shaders we need to force use of FBO and depthmap texture
@ -2137,8 +2139,13 @@ ERlvCmdRet RlvBehaviourHandler<RLV_BHVR_SETSPHERE>::onCommand(const RlvCommand&
gPipeline.resetVertexBuffers();
LLViewerShaderMgr::instance()->setShaders();
}
LLVfxManager::instance().addEffect(new RlvSphereEffect(rlvCmd.getObjectID()));
else if (!gPipeline.mDeferredLight.isComplete())
{
// In case of deferred with no shadows, no ambient occlusion, no depth of field, and no antialiasing
gPipeline.releaseGLBuffers();
gPipeline.createGLBuffers();
RLV_ASSERT(gPipeline.mDeferredLight.isComplete());
}
}
else
{