update NACL Graphics crasher protection code. (work done by Chalice of NACL - 26104; 1799bdb6549e)

Tank_Master 2013-03-20 10:11:16 -07:00
parent c785c831af
commit 7fab30cab4
3 changed files with 23 additions and 7 deletions

View File

@ -2862,6 +2862,12 @@ inline LLVector3 sculpt_xy_to_vector(U32 x, U32 y, U16 sculpt_width, U16 sculpt_
return sculpt_index_to_vector(index, sculpt_data);
}
// NaCl - Graphics crasher protection
void LLVolume::calcSurfaceArea()
{
mSurfaceArea = sculptGetSurfaceArea();
}
// NaCl End
F32 LLVolume::sculptGetSurfaceArea()
{

View File

@ -1045,13 +1045,16 @@ public:
void sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, S32 sculpt_level);
F32 sculptGetSurfaceArea(); // ZK LBG
// NaCl - Graphics crasher protection
void calcSurfaceArea(); // ZK LBG
// NaCl End
void copyVolumeFaces(const LLVolume* volume);
void cacheOptimize();
private:
void sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, U8 sculpt_type);
F32 sculptGetSurfaceArea();
void sculptGeneratePlaceholder();
void sculptCalcMeshResolution(U16 width, U16 height, U8 type, S32& s, S32& t);

View File

@ -216,8 +216,10 @@ private:
LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
: LLViewerObject(id, pcode, regionp),
// NaCl - Graphics crasher protection
mVolumeImpl(NULL),
mVolumeSurfaceArea(-1.0)
// NaCl End
{
mTexAnimMode = 0;
mRelativeXform.setIdentity();
@ -1066,6 +1068,9 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &params_in, const S32 detail, bo
}
updateSculptTexture();
// NaCl - Graphics crasher protection
getVolume()->calcSurfaceArea();
// NaCl End
if (isSculpted())
{
@ -1695,10 +1700,10 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable)
LLFastTimer t(FTM_GEN_FLEX);
res = mVolumeImpl->doUpdateGeometry(drawable);
}
// NaCl - Graphics crasher protection
if( enableVolumeSAPProtection() )
mVolumeSurfaceArea = getVolume()->sculptGetSurfaceArea();
mVolumeSurfaceArea = getVolume()->getSurfaceArea();
// NaCl End
updateFaceFlags();
return res;
}
@ -1803,10 +1808,10 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable)
LLFastTimer t(FTM_GEN_TRIANGLES);
genBBoxes(FALSE);
}
// NaCl - Graphics crasher protection
if( enableVolumeSAPProtection() )
mVolumeSurfaceArea = getVolume()->sculptGetSurfaceArea();
mVolumeSurfaceArea = getVolume()->getSurfaceArea();
// NaCl End
// Update face flags
updateFaceFlags();
@ -4381,6 +4386,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
// AO: Z's protection auto-derender code
if (enableVolumeSAPProtection())
{
// NaCl - Graphics crasher protection
static LLCachedControl<F32> volume_sa_thresh(gSavedSettings,"RenderVolumeSAThreshold");
static LLCachedControl<F32> sculpt_sa_thresh(gSavedSettings, "RenderSculptSAThreshold");
static LLCachedControl<F32> volume_sa_max_frame(gSavedSettings, "RenderVolumeSAFrameMax");
@ -4394,6 +4400,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
continue;
}
}
// NaCl End
}
// </AO>