summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lldrawpoolbump.cpp23
-rw-r--r--indra/newview/lldrawpoolbump.h5
-rw-r--r--indra/newview/llviewercontrol.cpp4
-rw-r--r--indra/newview/llviewerdisplay.cpp1
-rw-r--r--indra/newview/llvovolume.cpp5
-rw-r--r--indra/newview/pipeline.cpp7
-rw-r--r--indra/newview/pipeline.h1
7 files changed, 37 insertions, 9 deletions
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index ac8bd4dc41..1fae8e518c 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -94,6 +94,12 @@ void LLStandardBumpmap::shutdown()
// static
void LLStandardBumpmap::restoreGL()
{
+ addstandard();
+}
+
+// static
+void LLStandardBumpmap::addstandard()
+{
llassert( LLStandardBumpmap::sStandardBumpmapCount == 0 );
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount++] = LLStandardBumpmap("None"); // BE_NO_BUMP
gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount++] = LLStandardBumpmap("Brightness"); // BE_BRIGHTNESS
@@ -156,7 +162,7 @@ void LLStandardBumpmap::restoreGL()
}
// static
-void LLStandardBumpmap::destroyGL()
+void LLStandardBumpmap::clear()
{
for( U32 i = 0; i < LLStandardBumpmap::sStandardBumpmapCount; i++ )
{
@@ -166,6 +172,12 @@ void LLStandardBumpmap::destroyGL()
sStandardBumpmapCount = 0;
}
+// static
+void LLStandardBumpmap::destroyGL()
+{
+ clear();
+}
+
////////////////////////////////////////////////////////////////
@@ -1085,8 +1097,8 @@ void LLBumpImageList::generateNormalMapFromAlpha(LLImageRaw* src, LLImageRaw* nr
LLVector3 right = LLVector3(norm_scale, 0, (F32) src_data[(j*resX+rX)*src_cmp+src_cmp-1]-cH);
LLVector3 left = LLVector3(-norm_scale, 0, (F32) src_data[(j*resX+lX)*src_cmp+src_cmp-1]-cH);
- LLVector3 up = LLVector3(0, -norm_scale, (F32) src_data[(rY*resX+i)*src_cmp+src_cmp-1]-cH);
- LLVector3 down = LLVector3(0, norm_scale, (F32) src_data[(lY*resX+i)*src_cmp+src_cmp-1]-cH);
+ LLVector3 up = LLVector3(0, -norm_scale, (F32) src_data[(lY*resX+i)*src_cmp+src_cmp-1]-cH);
+ LLVector3 down = LLVector3(0, norm_scale, (F32) src_data[(rY*resX+i)*src_cmp+src_cmp-1]-cH);
LLVector3 norm = right%down + down%left + left%up + up%right;
@@ -1196,11 +1208,8 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
F32 twice_one_over_range = 2.f / (maximum - minimum);
S32 i;
- bool bump_polarity_negative = LLPipeline::sRenderDeferred ?
- (BE_BRIGHTNESS == bump_code) : (BE_DARKNESS == bump_code); // deferred mode likes its normal map values inverted
-
const F32 ARTIFICIAL_SCALE = 2.f; // Advantage: exaggerates the effect in midrange. Disadvantage: clamps at the extremes.
- if (bump_polarity_negative)
+ if (BE_DARKNESS == bump_code)
{
for( i = minimum; i <= maximum; i++ )
{
diff --git a/indra/newview/lldrawpoolbump.h b/indra/newview/lldrawpoolbump.h
index ceb72309d8..d634b7329e 100644
--- a/indra/newview/lldrawpoolbump.h
+++ b/indra/newview/lldrawpoolbump.h
@@ -124,9 +124,12 @@ public:
static U32 sStandardBumpmapCount; // Number of valid values in gStandardBumpmapList[]
+ static void clear();
+ static void addstandard();
+
static void init();
static void shutdown();
- static void restoreGL();
+ static void restoreGL();
static void destroyGL();
};
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index f76c53a77a..481c96dae3 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -119,8 +119,10 @@ static bool handleTerrainDetailChanged(const LLSD& newvalue)
static bool handleSetShaderChanged(const LLSD& newvalue)
{
- // changing shader level may invalidate existing cached ad-hoc bump maps, as the shader type determines the format of the bump map it expectes - clear the bump cache
+ // changing shader level may invalidate existing cached bump maps, as the shader type determines the format of the bump map it expects - clear the bump cache
gBumpImageList.clear();
+ LLStandardBumpmap::clear();
+ LLStandardBumpmap::addstandard();
LLViewerShaderMgr::instance()->setShaders();
return true;
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 3cd7af6433..1490f8153c 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -732,6 +732,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
{
LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
LLMemType mt_ss(LLMemType::MTYPE_DISPLAY_STATE_SORT);
+ gPipeline.sAllowRebuildPriorityGroup = TRUE ;
gPipeline.stateSort(*LLViewerCamera::getInstance(), result);
stop_glerror();
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index c470099594..cea964a100 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1939,6 +1939,11 @@ void LLVOVolume::syncMediaData(S32 texture_index, const LLSD &media_data, bool m
}
LLTextureEntry *te = getTE(texture_index);
+ if(!te)
+ {
+ return ;
+ }
+
LL_DEBUGS("MediaOnAPrim") << "BEFORE: texture_index = " << texture_index
<< " hasMedia = " << te->hasMedia() << " : "
<< ((NULL == te->getMediaData()) ? "NULL MEDIA DATA" : ll_pretty_print_sd(te->getMediaData()->asLLSD())) << llendl;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index f54f29927a..91c3805d3b 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -290,6 +290,7 @@ BOOL LLPipeline::sRenderFrameTest = FALSE;
BOOL LLPipeline::sRenderAttachedLights = TRUE;
BOOL LLPipeline::sRenderAttachedParticles = TRUE;
BOOL LLPipeline::sRenderDeferred = FALSE;
+BOOL LLPipeline::sAllowRebuildPriorityGroup = FALSE ;
S32 LLPipeline::sVisibleLightCount = 0;
F32 LLPipeline::sMinRenderSize = 0.f;
@@ -1810,6 +1811,12 @@ void LLPipeline::updateGL()
void LLPipeline::rebuildPriorityGroups()
{
+ if(!sAllowRebuildPriorityGroup)
+ {
+ return ;
+ }
+ sAllowRebuildPriorityGroup = FALSE ;
+
LLTimer update_timer;
LLMemType mt(LLMemType::MTYPE_PIPELINE);
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index d8bac8b601..c9384f5ba2 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -489,6 +489,7 @@ public:
static BOOL sRenderAttachedLights;
static BOOL sRenderAttachedParticles;
static BOOL sRenderDeferred;
+ static BOOL sAllowRebuildPriorityGroup;
static S32 sVisibleLightCount;
static F32 sMinRenderSize;