summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorKyle Ambroff <ambroff@lindenlab.com>2011-01-27 15:14:18 -0800
committerKyle Ambroff <ambroff@lindenlab.com>2011-01-27 15:14:18 -0800
commit5161b500c97878179cc4f8c9a0df717a25c5cb14 (patch)
tree1e95b17c64f050a8179935a0ad69393f3d044a5b /indra/newview
parenta4de39381ffcfeb455c3860ace7e7da7f756f774 (diff)
Prevent crashiness from DisableRendering setting.
When DisableRendering is set, bypass all of the new rendering code that would have crashed otherwise, since the GL manager isn't initialized. Many of these blocks will be removed once I get LLWindowHeadless working with the viewer. --HG-- branch : headless
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llviewermessage.cpp11
-rw-r--r--indra/newview/llviewerwindow.cpp8
-rw-r--r--indra/newview/llwearable.cpp7
-rw-r--r--indra/newview/pipeline.cpp126
4 files changed, 146 insertions, 6 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 6fc85a3944..b921c79973 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -3936,7 +3936,16 @@ void send_agent_update(BOOL force_send, BOOL send_reliable)
// LBUTTON and ML_LBUTTON so that using the camera (alt-key) doesn't
// trigger a control event.
U32 control_flags = gAgent.getControlFlags();
- MASK key_mask = gKeyboard->currentMask(TRUE);
+
+ // KWA FIXME: We should wire this up to the event system so we can
+ // send keyboard events via lleventhost. For now if we are headless,
+ // just don't ask for input.
+ MASK key_mask = MASK_NONE;
+ if (!gNoRender)
+ {
+ key_mask = gKeyboard->currentMask(TRUE);
+ }
+
if (key_mask & MASK_ALT || key_mask & MASK_CONTROL)
{
control_flags &= ~( AGENT_CONTROL_LBUTTON_DOWN |
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 166b110412..7b41ac9287 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2573,15 +2573,15 @@ void LLViewerWindow::updateUI()
LLView::sMouseHandlerMessage.clear();
- S32 x = mCurrentMousePoint.mX;
- S32 y = mCurrentMousePoint.mY;
- MASK mask = gKeyboard->currentMask(TRUE);
-
if (gNoRender)
{
return;
}
+ S32 x = mCurrentMousePoint.mX;
+ S32 y = mCurrentMousePoint.mY;
+ MASK mask = gKeyboard->currentMask(TRUE);
+
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_RAYCAST))
{
gDebugRaycastFaceHit = -1;
diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp
index d1c0990f90..ddb6b4697f 100644
--- a/indra/newview/llwearable.cpp
+++ b/indra/newview/llwearable.cpp
@@ -981,6 +981,13 @@ BOOL LLWearable::isOnTop() const
void LLWearable::createLayers(S32 te)
{
+ // KWA FIXME: this is wrong. We should still be setting up these layers.
+ // why the hell isn't it working?
+ if (gNoRender)
+ {
+ return;
+ }
+
LLTexLayerSet *layer_set = gAgentAvatarp->getLayerSet((ETextureIndex)te);
if (layer_set)
{
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 59b526059b..15f3156622 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -419,6 +419,12 @@ LLPipeline::~LLPipeline()
void LLPipeline::cleanup()
{
+ // KWA FIXME reevaluate once MESA llwindow is working when headless
+ if (gNoRender)
+ {
+ return;
+ }
+
assertInitialized();
mGroupQ1.clear() ;
@@ -515,6 +521,12 @@ static LLFastTimer::DeclareTimer FTM_RESIZE_SCREEN_TEXTURE("Resize Screen Textur
void LLPipeline::resizeScreenTexture()
{
+ // KWA FIXME reevaluate once MESA llwindow is working when headless
+ if (gNoRender)
+ {
+ return;
+ }
+
LLFastTimer ft(FTM_RESIZE_SCREEN_TEXTURE);
if (gPipeline.canUseVertexShaders() && assertInitialized())
{
@@ -640,6 +652,12 @@ void LLPipeline::updateRenderDeferred()
void LLPipeline::releaseGLBuffers()
{
+ // KWA FIXME reevaluate once MESA llwindow is working when headless
+ if (gNoRender)
+ {
+ return;
+ }
+
assertInitialized();
if (mNoiseMap)
@@ -694,6 +712,12 @@ void LLPipeline::releaseGLBuffers()
void LLPipeline::createGLBuffers()
{
+ // KWA FIXME reevaluate once MESA llwindow is working when headless
+ if (gNoRender)
+ {
+ return;
+ }
+
LLMemType mt_cb(LLMemType::MTYPE_PIPELINE_CREATE_BUFFERS);
assertInitialized();
@@ -816,6 +840,12 @@ void LLPipeline::createGLBuffers()
void LLPipeline::restoreGL()
{
+ // KWA FIXME reevaluate once MESA llwindow is working when headless
+ if (gNoRender)
+ {
+ return;
+ }
+
LLMemType mt_cb(LLMemType::MTYPE_PIPELINE_RESTORE_GL);
assertInitialized();
@@ -842,6 +872,12 @@ void LLPipeline::restoreGL()
BOOL LLPipeline::canUseVertexShaders()
{
+ // KWA FIXME reevaluate once MESA llwindow is working when headless
+ if (gNoRender)
+ {
+ return FALSE;
+ }
+
if (sDisableShaders ||
!gGLManager.mHasVertexShader ||
!gGLManager.mHasFragmentShader ||
@@ -908,6 +944,12 @@ S32 LLPipeline::getMaxLightingDetail() const
S32 LLPipeline::setLightingDetail(S32 level)
{
+ // KWA FIXME reevaluate once MESA llwindow is working when headless
+ if (gNoRender)
+ {
+ return 0;
+ }
+
LLMemType mt_ld(LLMemType::MTYPE_PIPELINE_LIGHTING_DETAIL);
assertInitialized();
@@ -973,6 +1015,12 @@ public:
// Called when a texture changes # of channels (causes faces to move to alpha pool)
void LLPipeline::dirtyPoolObjectTextures(const std::set<LLViewerFetchedTexture*>& textures)
{
+ // KWA FIXME reevaluate once MESA llwindow is working when headless
+ if (gNoRender)
+ {
+ return;
+ }
+
assertInitialized();
// *TODO: This is inefficient and causes frame spikes; need a better way to do this
@@ -1005,6 +1053,12 @@ void LLPipeline::dirtyPoolObjectTextures(const std::set<LLViewerFetchedTexture*>
LLDrawPool *LLPipeline::findPool(const U32 type, LLViewerTexture *tex0)
{
+ // KWA FIXME reevaluate once MESA llwindow is working when headless
+ if (gNoRender)
+ {
+ return NULL;
+ }
+
assertInitialized();
LLDrawPool *poolp = NULL;
@@ -1132,6 +1186,11 @@ U32 LLPipeline::getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* ima
void LLPipeline::addPool(LLDrawPool *new_poolp)
{
+ if (gNoRender)
+ {
+ return;
+ }
+
LLMemType mt_a(LLMemType::MTYPE_PIPELINE_ADD_POOL);
assertInitialized();
mPools.insert(new_poolp);
@@ -1159,6 +1218,12 @@ void LLPipeline::allocDrawable(LLViewerObject *vobj)
void LLPipeline::unlinkDrawable(LLDrawable *drawable)
{
+ // KWA FIXME reevaluate once MESA llwindow is working when headless
+ if (gNoRender)
+ {
+ return;
+ }
+
LLFastTimer t(FTM_PIPELINE);
assertInitialized();
@@ -1308,6 +1373,12 @@ void LLPipeline::createObject(LLViewerObject* vobj)
void LLPipeline::resetFrameStats()
{
+ // KWA FIXME reevaluate once MESA llwindow is working when headless
+ if (gNoRender)
+ {
+ return;
+ }
+
assertInitialized();
LLViewerStats::getInstance()->mTrianglesDrawnStat.addValue(mTrianglesDrawn/1000.f);
@@ -2175,6 +2246,12 @@ void LLPipeline::markRebuild(LLSpatialGroup* group, BOOL priority)
void LLPipeline::markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags flag, BOOL priority)
{
+ // KWA FIXME reevaluate once MESA llwindow is working when headless
+ if (gNoRender)
+ {
+ return;
+ }
+
LLMemType mt(LLMemType::MTYPE_PIPELINE_MARK_REBUILD);
if (drawablep && !drawablep->isDead() && assertInitialized())
@@ -3807,6 +3884,12 @@ void LLPipeline::renderDebug()
void LLPipeline::rebuildPools()
{
+ // KWA FIXME reevaluate once MESA llwindow is working when headless
+ if (gNoRender)
+ {
+ return;
+ }
+
LLMemType mt(LLMemType::MTYPE_PIPELINE_REBUILD_POOLS);
assertInitialized();
@@ -3847,6 +3930,12 @@ void LLPipeline::rebuildPools()
void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
{
+ // KWA FIXME reevaluate once MESA llwindow is working when headless
+ if (gNoRender)
+ {
+ return;
+ }
+
LLMemType mt(LLMemType::MTYPE_PIPELINE_QUICK_LOOKUP);
assertInitialized();
@@ -4341,6 +4430,11 @@ void LLPipeline::calcNearbyLights(LLCamera& camera)
void LLPipeline::setupHWLights(LLDrawPool* pool)
{
+ if (gNoRender)
+ {
+ return;
+ }
+
assertInitialized();
// Ambient
@@ -4521,6 +4615,12 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
void LLPipeline::enableLights(U32 mask)
{
+ // KWA FIXME reevaluate once MESA llwindow is working when headless
+ if (gNoRender)
+ {
+ return;
+ }
+
assertInitialized();
if (mLightingDetail == 0)
@@ -4621,6 +4721,12 @@ void LLPipeline::enableLightsAvatarEdit(const LLColor4& color)
void LLPipeline::enableLightsFullbright(const LLColor4& color)
{
+ // KWA FIXME reevaluate once MESA llwindow is working when headless
+ if (gNoRender)
+ {
+ return;
+ }
+
assertInitialized();
U32 mask = 0x1000; // Non-0 mask, set ambient
enableLights(mask);
@@ -5381,6 +5487,12 @@ static LLFastTimer::DeclareTimer FTM_RENDER_BLOOM("Bloom");
void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
{
+ // KWA FIXME reevaluate once MESA llwindow is working when headless
+ if (gNoRender)
+ {
+ return;
+ }
+
LLMemType mt_ru(LLMemType::MTYPE_PIPELINE_RENDER_BLOOM);
if (!(gPipeline.canUseVertexShaders() &&
sRenderGlow))
@@ -7036,7 +7148,13 @@ inline float sgn(float a)
}
void LLPipeline::generateWaterReflection(LLCamera& camera_in)
-{
+{
+ // KWA FIXME reevaluate once MESA llwindow is working when headless
+ if (gNoRender)
+ {
+ return;
+ }
+
if (LLPipeline::sWaterReflections && assertInitialized() && LLDrawPoolWater::sNeedsReflectionUpdate)
{
BOOL skip_avatar_update = FALSE;
@@ -8617,6 +8735,12 @@ void LLPipeline::renderGroups(LLRenderPass* pass, U32 type, U32 mask, BOOL textu
void LLPipeline::generateImpostor(LLVOAvatar* avatar)
{
+ // KWA FIXME reevaluate once MESA llwindow is working when headless
+ if (gNoRender)
+ {
+ return;
+ }
+
LLMemType mt_gi(LLMemType::MTYPE_PIPELINE_GENERATE_IMPOSTOR);
LLGLState::checkStates();
LLGLState::checkTextureChannels();