Satiate Issue 474 by showing a more sensible number for ARC by default.
http://code.google.com/p/singularity-viewer/issues/detail?id=474 Adds LiruSensibleARC debug setting, defaults to true. Code ported from Imprudence.
This commit is contained in:
@@ -682,6 +682,18 @@
|
|||||||
<key>Value</key>
|
<key>Value</key>
|
||||||
<integer>0</integer>
|
<integer>0</integer>
|
||||||
</map>
|
</map>
|
||||||
|
<key>LiruSensibleARC</key>
|
||||||
|
<map>
|
||||||
|
<key>Comment</key>
|
||||||
|
<string>Use the old-style way to calculate Avatar Render Cost.
|
||||||
|
Found in Advanced->Rendering->Info Displays</string>
|
||||||
|
<key>Persist</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
<key>Type</key>
|
||||||
|
<string>Boolean</string>
|
||||||
|
<key>Value</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
</map>
|
||||||
<key>ResetFocusOnSelfClick</key>
|
<key>ResetFocusOnSelfClick</key>
|
||||||
<map>
|
<map>
|
||||||
<key>Comment</key>
|
<key>Comment</key>
|
||||||
|
|||||||
@@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
#include "llaudioengine.h"
|
#include "llaudioengine.h"
|
||||||
#include "noise.h"
|
#include "noise.h"
|
||||||
#include "llsdserialize.h"
|
|
||||||
#include "raytrace.h"
|
#include "raytrace.h"
|
||||||
|
|
||||||
#include "llagent.h" // Get state values from here
|
#include "llagent.h" // Get state values from here
|
||||||
@@ -101,6 +100,7 @@
|
|||||||
#include "llanimstatelabels.h"
|
#include "llanimstatelabels.h"
|
||||||
#include "lltrans.h"
|
#include "lltrans.h"
|
||||||
#include "llappearancemgr.h"
|
#include "llappearancemgr.h"
|
||||||
|
|
||||||
#include "llgesturemgr.h" //needed to trigger the voice gesticulations
|
#include "llgesturemgr.h" //needed to trigger the voice gesticulations
|
||||||
#include "llvoiceclient.h"
|
#include "llvoiceclient.h"
|
||||||
#include "llvoicevisualizer.h" // Ventrella
|
#include "llvoicevisualizer.h" // Ventrella
|
||||||
@@ -6938,7 +6938,7 @@ U32 LLVOAvatar::getNumAttachments() const
|
|||||||
iter != mAttachmentPoints.end();
|
iter != mAttachmentPoints.end();
|
||||||
++iter)
|
++iter)
|
||||||
{
|
{
|
||||||
LLViewerJointAttachment *attachment_pt = (*iter).second;
|
const LLViewerJointAttachment *attachment_pt = (*iter).second;
|
||||||
num_attachments += attachment_pt->getNumObjects();
|
num_attachments += attachment_pt->getNumObjects();
|
||||||
}
|
}
|
||||||
return num_attachments;
|
return num_attachments;
|
||||||
@@ -9511,132 +9511,177 @@ void LLVOAvatar::getImpostorValues(LLVector4a* extents, LLVector3& angle, F32& d
|
|||||||
|
|
||||||
void LLVOAvatar::idleUpdateRenderCost()
|
void LLVOAvatar::idleUpdateRenderCost()
|
||||||
{
|
{
|
||||||
static const U32 ARC_BODY_PART_COST = 200;
|
|
||||||
static const U32 ARC_LIMIT = 20000;
|
|
||||||
|
|
||||||
static std::set<LLUUID> all_textures;
|
|
||||||
|
|
||||||
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_ATTACHMENT_BYTES))
|
|
||||||
{ //set debug text to attachment geometry bytes here so render cost will override
|
|
||||||
setDebugText(llformat("%.1f KB, %.2f m^2", mAttachmentGeometryBytes/1024.f, mAttachmentSurfaceArea));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHAME))
|
if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHAME))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
U32 cost = 0;
|
F32 red, green;
|
||||||
LLVOVolume::texture_cost_t textures;
|
|
||||||
|
|
||||||
for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++)
|
static LLCachedControl<bool> UseOldARC(gSavedSettings, "LiruSensibleARC", true);
|
||||||
|
if(UseOldARC)
|
||||||
{
|
{
|
||||||
const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index);
|
U32 shame = 1;
|
||||||
ETextureIndex tex_index = baked_dict->mTextureIndex;
|
|
||||||
if ((tex_index != TEX_SKIRT_BAKED) || (isWearingWearableType(LLWearableType::WT_SKIRT)))
|
|
||||||
{
|
|
||||||
if (isTextureVisible(tex_index))
|
|
||||||
{
|
|
||||||
cost +=ARC_BODY_PART_COST;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
std::set<LLUUID> textures;
|
||||||
|
|
||||||
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
|
attachment_map_t::const_iterator iter;
|
||||||
iter != mAttachmentPoints.end();
|
for (iter = mAttachmentPoints.begin();
|
||||||
++iter)
|
iter != mAttachmentPoints.end();
|
||||||
{
|
++iter)
|
||||||
LLViewerJointAttachment* attachment = iter->second;
|
|
||||||
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
|
|
||||||
attachment_iter != attachment->mAttachedObjects.end();
|
|
||||||
++attachment_iter)
|
|
||||||
{
|
{
|
||||||
const LLViewerObject* attached_object = (*attachment_iter);
|
LLViewerJointAttachment* attachment = iter->second;
|
||||||
if (attached_object && !attached_object->isHUDAttachment())
|
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
|
||||||
|
attachment_iter != attachment->mAttachedObjects.end();
|
||||||
|
++attachment_iter)
|
||||||
{
|
{
|
||||||
textures.clear();
|
const LLViewerObject* object = (*attachment_iter);
|
||||||
const LLDrawable* drawable = attached_object->mDrawable;
|
if (object && !object->isHUDAttachment())
|
||||||
if (drawable)
|
|
||||||
{
|
{
|
||||||
const LLVOVolume* volume = drawable->getVOVolume();
|
LLDrawable* drawable = object->mDrawable;
|
||||||
if (volume)
|
if (drawable)
|
||||||
{
|
{
|
||||||
cost += volume->getRenderCost(textures);
|
shame += 10;
|
||||||
|
LLVOVolume* volume = drawable->getVOVolume();
|
||||||
const_child_list_t children = volume->getChildren();
|
if (volume)
|
||||||
for (const_child_list_t::const_iterator child_iter = children.begin();
|
|
||||||
child_iter != children.end();
|
|
||||||
++child_iter)
|
|
||||||
{
|
{
|
||||||
LLViewerObject* child_obj = *child_iter;
|
shame += calc_shame(volume, textures);
|
||||||
LLVOVolume *child = dynamic_cast<LLVOVolume*>( child_obj );
|
|
||||||
if (child)
|
|
||||||
{
|
|
||||||
cost += child->getRenderCost(textures);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter)
|
|
||||||
{
|
|
||||||
// add the cost of each individual texture in the linkset
|
|
||||||
cost += iter->second;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shame += textures.size() * 5;
|
||||||
|
|
||||||
|
setDebugText(llformat("%d", shame));
|
||||||
|
green = 1.f-llclamp(((F32) shame-1024.f)/1024.f, 0.f, 1.f);
|
||||||
|
red = llmin((F32) shame/1024.f, 1.f);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
|
||||||
|
|
||||||
// Diagnostic output to identify all avatar-related textures.
|
|
||||||
// Does not affect rendering cost calculation.
|
|
||||||
// Could be wrapped in a debug option if output becomes problematic.
|
|
||||||
if (isSelf())
|
|
||||||
{
|
{
|
||||||
// print any attachment textures we didn't already know about.
|
static const U32 ARC_BODY_PART_COST = 200;
|
||||||
for (LLVOVolume::texture_cost_t::iterator it = textures.begin(); it != textures.end(); ++it)
|
static const U32 ARC_LIMIT = 20000;
|
||||||
|
|
||||||
|
static std::set<LLUUID> all_textures;
|
||||||
|
|
||||||
|
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_ATTACHMENT_BYTES))
|
||||||
|
{ //set debug text to attachment geometry bytes here so render cost will override
|
||||||
|
setDebugText(llformat("%.1f KB, %.2f m^2", mAttachmentGeometryBytes/1024.f, mAttachmentSurfaceArea));
|
||||||
|
}
|
||||||
|
|
||||||
|
U32 cost = 0;
|
||||||
|
LLVOVolume::texture_cost_t textures;
|
||||||
|
|
||||||
|
for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++)
|
||||||
{
|
{
|
||||||
LLUUID image_id = it->first;
|
const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index);
|
||||||
if( image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR)
|
ETextureIndex tex_index = baked_dict->mTextureIndex;
|
||||||
continue;
|
if ((tex_index != TEX_SKIRT_BAKED) || (isWearingWearableType(LLWearableType::WT_SKIRT)))
|
||||||
if (all_textures.find(image_id) == all_textures.end())
|
|
||||||
{
|
{
|
||||||
// attachment texture not previously seen.
|
if (isTextureVisible(tex_index))
|
||||||
llinfos << "attachment_texture: " << image_id.asString() << llendl;
|
{
|
||||||
all_textures.insert(image_id);
|
cost +=ARC_BODY_PART_COST;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// print any avatar textures we didn't already know about
|
|
||||||
for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin();
|
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
|
||||||
iter != LLVOAvatarDictionary::getInstance()->getTextures().end();
|
iter != mAttachmentPoints.end();
|
||||||
++iter)
|
++iter)
|
||||||
{
|
{
|
||||||
const LLVOAvatarDictionary::TextureEntry *texture_dict = iter->second;
|
LLViewerJointAttachment* attachment = iter->second;
|
||||||
// TODO: MULTI-WEARABLE: handle multiple textures for self
|
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
|
||||||
const LLViewerTexture* te_image = getImage(iter->first,0);
|
attachment_iter != attachment->mAttachedObjects.end();
|
||||||
if (!te_image)
|
++attachment_iter)
|
||||||
continue;
|
|
||||||
LLUUID image_id = te_image->getID();
|
|
||||||
if( image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR)
|
|
||||||
continue;
|
|
||||||
if (all_textures.find(image_id) == all_textures.end())
|
|
||||||
{
|
{
|
||||||
llinfos << "local_texture: " << texture_dict->mName << ": " << image_id << llendl;
|
const LLViewerObject* attached_object = (*attachment_iter);
|
||||||
all_textures.insert(image_id);
|
if (attached_object && !attached_object->isHUDAttachment())
|
||||||
|
{
|
||||||
|
textures.clear();
|
||||||
|
const LLDrawable* drawable = attached_object->mDrawable;
|
||||||
|
if (drawable)
|
||||||
|
{
|
||||||
|
const LLVOVolume* volume = drawable->getVOVolume();
|
||||||
|
if (volume)
|
||||||
|
{
|
||||||
|
cost += volume->getRenderCost(textures);
|
||||||
|
|
||||||
|
const_child_list_t children = volume->getChildren();
|
||||||
|
for (const_child_list_t::const_iterator child_iter = children.begin();
|
||||||
|
child_iter != children.end();
|
||||||
|
++child_iter)
|
||||||
|
{
|
||||||
|
LLViewerObject* child_obj = *child_iter;
|
||||||
|
LLVOVolume *child = dynamic_cast<LLVOVolume*>( child_obj );
|
||||||
|
if (child)
|
||||||
|
{
|
||||||
|
cost += child->getRenderCost(textures);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter)
|
||||||
|
{
|
||||||
|
// add the cost of each individual texture in the linkset
|
||||||
|
cost += iter->second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Diagnostic output to identify all avatar-related textures.
|
||||||
|
// Does not affect rendering cost calculation.
|
||||||
|
// Could be wrapped in a debug option if output becomes problematic.
|
||||||
|
if (isSelf())
|
||||||
|
{
|
||||||
|
// print any attachment textures we didn't already know about.
|
||||||
|
for (LLVOVolume::texture_cost_t::iterator it = textures.begin(); it != textures.end(); ++it)
|
||||||
|
{
|
||||||
|
LLUUID image_id = it->first;
|
||||||
|
if( image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR)
|
||||||
|
continue;
|
||||||
|
if (all_textures.find(image_id) == all_textures.end())
|
||||||
|
{
|
||||||
|
// attachment texture not previously seen.
|
||||||
|
llinfos << "attachment_texture: " << image_id.asString() << llendl;
|
||||||
|
all_textures.insert(image_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// print any avatar textures we didn't already know about
|
||||||
|
for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin();
|
||||||
|
iter != LLVOAvatarDictionary::getInstance()->getTextures().end();
|
||||||
|
++iter)
|
||||||
|
{
|
||||||
|
const LLVOAvatarDictionary::TextureEntry *texture_dict = iter->second;
|
||||||
|
// TODO: MULTI-WEARABLE: handle multiple textures for self
|
||||||
|
const LLViewerTexture* te_image = getImage(iter->first,0);
|
||||||
|
if (!te_image)
|
||||||
|
continue;
|
||||||
|
LLUUID image_id = te_image->getID();
|
||||||
|
if( image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR)
|
||||||
|
continue;
|
||||||
|
if (all_textures.find(image_id) == all_textures.end())
|
||||||
|
{
|
||||||
|
llinfos << "local_texture: " << texture_dict->mName << ": " << image_id << llendl;
|
||||||
|
all_textures.insert(image_id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus());
|
||||||
|
setDebugText(llformat("%s %d", viz_string.c_str(), cost));
|
||||||
|
mVisualComplexity = cost;
|
||||||
|
green = 1.f-llclamp(((F32) cost-(F32)ARC_LIMIT)/(F32)ARC_LIMIT, 0.f, 1.f);
|
||||||
|
red = llmin((F32) cost/(F32)ARC_LIMIT, 1.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus());
|
|
||||||
setDebugText(llformat("%s %d", viz_string.c_str(), cost));
|
|
||||||
mVisualComplexity = cost;
|
|
||||||
F32 green = 1.f-llclamp(((F32) cost-(F32)ARC_LIMIT)/(F32)ARC_LIMIT, 0.f, 1.f);
|
|
||||||
F32 red = llmin((F32) cost/(F32)ARC_LIMIT, 1.f);
|
|
||||||
mText->setColor(LLColor4(red,green,0,1));
|
mText->setColor(LLColor4(red,green,0,1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user