All submissions to this site are governed by the Second Life Viewer Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.

Review Board 1.6.11

Welcome to the Second Life Viewer Code Review tool.
See the documentation on our wiki for how to use this site.

STORM-1001: Viewer needlessly hits the "ObjectMedia" cap with thousands of requests

Review Request #162 - Created Feb. 22, 2011 and submitted

Kitty Barnett Reviewers
viewer
STORM-1001
None viewer-development
S32 LLTextureEntry::setMediaTexGen(U8 media) would appear to be the root cause of the bug:

The header file suggests that:

// The Media Tex Gen values are bits in a bit field:
// +----------+
// | .....TTM | M = Media Flags (web page), T = LLTextureEntry::eTexGen, . = unused
// | 76543210 |
// +----------+
const S32 TEM_MEDIA_MASK		= 0x01;
const S32 TEM_TEX_GEN_MASK		= 0x06;

and while LLTextureEntry::setTexGen() and LLTextureEntry::setMediaFlags() each properly mask off the supplied parameter with their respective bit mask, setMediaTexGen() will always return TEM_CHANGE_MEDIA even if only texgen has changed while the media flag hasn't (causing LLVOVolume::processUpdateMessage() to queue a request to the cap when it shouldn't).

Changing it to:

S32 LLTextureEntry::setMediaTexGen(U8 media)
{
	S32 result = setTexGen(media & TEM_TEX_GEN_MASK);
	result |= setMediaFlags(media & TEM_MEDIA_MASK);
	return result;
}

appears to resolve the issue completely (the cap isn't hit unless an object nearby has media on it, or changes its URL)

 
Posted (Feb. 26, 2011, 2:12 p.m.)

   

  
indra/llprimitive/lltextureentry.cpp (Diff revision 1)
 
 
 
 
 
 
 
 
 
 
 
Is this creation/destruction of mMediaEntry taken care off elsewhere already?
Posted (March 1, 2011, 10:22 p.m.)

   

  
indra/llprimitive/lltextureentry.cpp (Diff revision 1)
 
 
Looks like you need to add creation/deletion of mMediaEntry if the TEM_MEDIA_MASK bit flipped.
  1. That is covered in LLTextureEntry::setMediaFlags.
Ship it!
Posted (March 2, 2011, 10:37 a.m.)
This change looks good to me. It looks cleaner and more correct.
Ship it!
Posted (March 7, 2011, 9:55 p.m.)
Satisfied with Kelly's answer to my comment. I don't have anything against that fix now.