summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llrender/llimagegl.cpp24
-rw-r--r--indra/llrender/llimagegl.h8
-rw-r--r--indra/newview/llfloaterenvironmentadjust.cpp2
-rw-r--r--indra/newview/llfloatertools.cpp3
-rw-r--r--indra/newview/llmaterialeditor.cpp27
-rw-r--r--indra/newview/llmaterialeditor.h1
-rw-r--r--indra/newview/llpaneleditsky.cpp2
-rw-r--r--indra/newview/llpanelface.cpp6
-rw-r--r--indra/newview/lltexturectrl.cpp12
-rw-r--r--indra/newview/llviewertexture.cpp5
-rw-r--r--indra/newview/skins/default/xui/en/floater_adjust_environment.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml2
12 files changed, 47 insertions, 47 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index b77f98d65e..c6fd824c4e 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -58,7 +58,7 @@ U32 wpo2(U32 i);
// texture memory accounting (for OS X)
static LLMutex sTexMemMutex;
-static std::unordered_map<U32, U32> sTextureAllocs;
+static std::unordered_map<U32, U64> sTextureAllocs;
static U64 sTextureBytes = 0;
// track a texture alloc on the currently bound texture.
@@ -67,7 +67,7 @@ static void alloc_tex_image(U32 width, U32 height, U32 pixformat)
{
U32 texUnit = gGL.getCurrentTexUnitIndex();
U32 texName = gGL.getTexUnit(texUnit)->getCurrTexture();
- S32 size = LLImageGL::dataFormatBytes(pixformat, width, height);
+ U64 size = LLImageGL::dataFormatBytes(pixformat, width, height);
llassert(size >= 0);
@@ -296,7 +296,7 @@ S32 LLImageGL::dataFormatBits(S32 dataformat)
}
//static
-S32 LLImageGL::dataFormatBytes(S32 dataformat, S32 width, S32 height)
+S64 LLImageGL::dataFormatBytes(S32 dataformat, S32 width, S32 height)
{
switch (dataformat)
{
@@ -312,8 +312,8 @@ S32 LLImageGL::dataFormatBytes(S32 dataformat, S32 width, S32 height)
default:
break;
}
- S32 bytes ((width*height*dataFormatBits(dataformat)+7)>>3);
- S32 aligned = (bytes+3)&~3;
+ S64 bytes (((S64)width * (S64)height * (S64)dataFormatBits(dataformat)+7)>>3);
+ S64 aligned = (bytes+3)&~3;
return aligned;
}
@@ -518,7 +518,7 @@ void LLImageGL::init(BOOL usemipmaps)
// so that it is obvious by visual inspection if we forgot to
// init a field.
- mTextureMemory = (S32Bytes)0;
+ mTextureMemory = S64Bytes(0);
mLastBindTime = 0.f;
mPickMask = NULL;
@@ -1744,7 +1744,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_
}
- mTextureMemory = (S32Bytes)getMipBytes(mCurrentDiscardLevel);
+ mTextureMemory = (S64Bytes)getMipBytes(mCurrentDiscardLevel);
mTexelsInGLTexture = getWidth() * getHeight();
// mark this as bound at this point, so we don't throw it out immediately
@@ -1938,9 +1938,9 @@ void LLImageGL::destroyGLTexture()
if (mTexName != 0)
{
- if(mTextureMemory != S32Bytes(0))
+ if(mTextureMemory != S64Bytes(0))
{
- mTextureMemory = (S32Bytes)0;
+ mTextureMemory = (S64Bytes)0;
}
LLImageGL::deleteTextures(1, &mTexName);
@@ -2036,7 +2036,7 @@ S32 LLImageGL::getWidth(S32 discard_level) const
return width;
}
-S32 LLImageGL::getBytes(S32 discard_level) const
+S64 LLImageGL::getBytes(S32 discard_level) const
{
if (discard_level < 0)
{
@@ -2049,7 +2049,7 @@ S32 LLImageGL::getBytes(S32 discard_level) const
return dataFormatBytes(mFormatPrimary, w, h);
}
-S32 LLImageGL::getMipBytes(S32 discard_level) const
+S64 LLImageGL::getMipBytes(S32 discard_level) const
{
if (discard_level < 0)
{
@@ -2057,7 +2057,7 @@ S32 LLImageGL::getMipBytes(S32 discard_level) const
}
S32 w = mWidth>>discard_level;
S32 h = mHeight>>discard_level;
- S32 res = dataFormatBytes(mFormatPrimary, w, h);
+ S64 res = dataFormatBytes(mFormatPrimary, w, h);
if (mUseMipMaps)
{
while (w > 1 && h > 1)
diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h
index 243aeaea25..a9a6b93cb3 100644
--- a/indra/llrender/llimagegl.h
+++ b/indra/llrender/llimagegl.h
@@ -65,7 +65,7 @@ public:
// Size calculation
static S32 dataFormatBits(S32 dataformat);
- static S32 dataFormatBytes(S32 dataformat, S32 width, S32 height);
+ static S64 dataFormatBytes(S32 dataformat, S32 width, S32 height);
static S32 dataFormatComponents(S32 dataformat);
BOOL updateBindStats() const ;
@@ -145,8 +145,8 @@ public:
S32 getWidth(S32 discard_level = -1) const;
S32 getHeight(S32 discard_level = -1) const;
U8 getComponents() const { return mComponents; }
- S32 getBytes(S32 discard_level = -1) const;
- S32 getMipBytes(S32 discard_level = -1) const;
+ S64 getBytes(S32 discard_level = -1) const;
+ S64 getMipBytes(S32 discard_level = -1) const;
BOOL getBoundRecently() const;
BOOL isJustBound() const;
BOOL getHasExplicitFormat() const { return mHasExplicitFormat; }
@@ -208,7 +208,7 @@ public:
public:
// Various GL/Rendering options
- S32Bytes mTextureMemory;
+ S64Bytes mTextureMemory;
mutable F32 mLastBindTime; // last time this was bound, by discard level
private:
diff --git a/indra/newview/llfloaterenvironmentadjust.cpp b/indra/newview/llfloaterenvironmentadjust.cpp
index 18be4fffda..f3133ecb37 100644
--- a/indra/newview/llfloaterenvironmentadjust.cpp
+++ b/indra/newview/llfloaterenvironmentadjust.cpp
@@ -495,10 +495,12 @@ void LLFloaterEnvironmentAdjust::updateGammaLabel()
if (ambiance != 0.f)
{
childSetValue("scene_gamma_label", getString("hdr_string"));
+ getChild<LLUICtrl>(FIELD_SKY_SCENE_GAMMA)->setToolTip(getString("hdr_tooltip"));
}
else
{
childSetValue("scene_gamma_label", getString("brightness_string"));
+ getChild<LLUICtrl>(FIELD_SKY_SCENE_GAMMA)->setToolTip(std::string());
}
}
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index b6acba6558..5fb4fb9b07 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -925,6 +925,9 @@ void LLFloaterTools::onClose(bool app_quitting)
// hide the advanced object weights floater
LLFloaterReg::hideInstance("object_weights");
+ // hide gltf material editor
+ LLFloaterReg::hideInstance("live_material_editor");
+
// prepare content for next call
mPanelContents->clearContents();
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp
index a0c3fd9a28..0897ed14c6 100644
--- a/indra/newview/llmaterialeditor.cpp
+++ b/indra/newview/llmaterialeditor.cpp
@@ -412,9 +412,6 @@ BOOL LLMaterialEditor::postBuild()
if (mIsOverride)
{
- // Material override change success callback
- LLGLTFMaterialList::addSelectionUpdateCallback(&LLMaterialEditor::updateLive);
-
// Live editing needs a recovery mechanism on cancel
mBaseColorTextureCtrl->setOnCancelCallback(boost::bind(&LLMaterialEditor::onCancelCtrl, this, _1, _2, MATERIAL_BASE_COLOR_TEX_DIRTY));
mMetallicTextureCtrl->setOnCancelCallback(boost::bind(&LLMaterialEditor::onCancelCtrl, this, _1, _2, MATERIAL_METALLIC_ROUGHTNESS_TEX_DIRTY));
@@ -542,12 +539,6 @@ void LLMaterialEditor::draw()
{
if (mIsOverride)
{
- bool selection_empty = LLSelectMgr::getInstance()->getSelection()->isEmpty();
- if (selection_empty && mHasSelection)
- {
- mSelectionNeedsUpdate = true;
- }
-
if (mSelectionNeedsUpdate)
{
mSelectionNeedsUpdate = false;
@@ -1790,22 +1781,6 @@ void LLMaterialEditor::updateLive()
mOverrideInProgress = false;
}
-void LLMaterialEditor::updateLive(const LLUUID &object_id, S32 te)
-{
- if (mOverrideObjectId != object_id
- || mOverrideObjectTE != te)
- {
- // Ignore if waiting for override,
- // if not waiting, mark selection dirty
- mSelectionNeedsUpdate |= !mOverrideInProgress;
- return;
- }
-
- // update for currently displayed object and face
- mSelectionNeedsUpdate = true;
- mOverrideInProgress = false;
-}
-
void LLMaterialEditor::loadLive()
{
LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance("live_material_editor");
@@ -2816,7 +2791,7 @@ public:
// something went wrong update selection
LLMaterialEditor::updateLive();
}
- // else we will get updateLive(obj, id) from applied overrides
+ // else we will get updateLive() from panel face
}
bool getResult() { return mSuccess; }
diff --git a/indra/newview/llmaterialeditor.h b/indra/newview/llmaterialeditor.h
index b29db706f8..1c40fcc348 100644
--- a/indra/newview/llmaterialeditor.h
+++ b/indra/newview/llmaterialeditor.h
@@ -110,7 +110,6 @@ class LLMaterialEditor : public LLPreview, public LLVOInventoryListener
void onSelectionChanged(); // live overrides selection changes
static void updateLive();
- static void updateLive(const LLUUID &object_id, S32 te);
static void loadLive();
static bool canModifyObjectsMaterial();
diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp
index 0a7a4763be..839f25761a 100644
--- a/indra/newview/llpaneleditsky.cpp
+++ b/indra/newview/llpaneleditsky.cpp
@@ -342,10 +342,12 @@ void LLPanelSettingsSkyAtmosTab::updateGammaLabel(bool auto_adjust)
if (ambiance != 0.f)
{
childSetValue("scene_gamma_label", getString("hdr_string"));
+ getChild<LLUICtrl>(FIELD_SKY_SCENE_GAMMA)->setToolTip(getString("hdr_tooltip"));
}
else
{
childSetValue("scene_gamma_label", getString("brightness_string"));
+ getChild<LLUICtrl>(FIELD_SKY_SCENE_GAMMA)->setToolTip(std::string());
}
}
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index dce92260a0..51aa2f4891 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -515,6 +515,7 @@ void LLPanelFace::draw()
if (sMaterialOverrideSelection.update())
{
setMaterialOverridesFromSelection();
+ LLMaterialEditor::updateLive();
}
}
@@ -1056,6 +1057,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
LLSelectedTEMaterial::getSpecularID(specmap_id, identical_spec);
static S32 selected_te = -1;
+ static LLUUID prev_obj_id;
if ((LLToolFace::getInstance() == LLToolMgr::getInstance()->getCurrentTool()) &&
!LLSelectMgr::getInstance()->getSelection()->isMultipleTESelected())
{
@@ -1070,7 +1072,8 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
}
}
- if (new_selection != selected_te)
+ if ((new_selection != selected_te)
+ || (prev_obj_id != objectp->getID()))
{
bool te_has_media = objectp->getTE(new_selection) && objectp->getTE(new_selection)->hasMedia();
bool te_has_pbr = objectp->getRenderMaterialID(new_selection).notNull();
@@ -1088,6 +1091,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
mComboMatMedia->selectNthItem(MATMEDIA_MATERIAL);
}
selected_te = new_selection;
+ prev_obj_id = objectp->getID();
}
}
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index 7e399a6808..bbacec843b 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -2101,8 +2101,16 @@ BOOL LLTextureCtrl::doDrop(LLInventoryItem* item)
return mDropCallback(this, item);
}
- // no callback installed, so just set the image ids and carry on.
- setImageAssetID( item->getAssetUUID() );
+ // no callback installed, so just set the image ids and carry on.
+ LLUUID asset_id = item->getAssetUUID();
+
+ if (mInventoryPickType == LLTextureCtrl::PICK_MATERIAL && asset_id.isNull())
+ {
+ // If an inventory material has a null asset, consider it a valid blank material(gltf)
+ asset_id = LLGLTFMaterialList::BLANK_MATERIAL_ASSET_ID;
+ }
+
+ setImageAssetID(asset_id);
mImageItemID = item->getUUID();
return TRUE;
}
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 9fc092d4b9..9336d99555 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -534,9 +534,12 @@ void LLViewerTexture::updateClass()
static LLCachedControl<U32> max_vram_budget(gSavedSettings, "RenderMaxVRAMBudget", 0);
+ F64 texture_bytes_alloc = LLImageGL::getTextureBytesAllocated() / 1024.0 / 512.0;
+ F64 vertex_bytes_alloc = LLVertexBuffer::getBytesAllocated() / 1024.0 / 512.0;
+
// get an estimate of how much video memory we're using
// NOTE: our metrics miss about half the vram we use, so this biases high but turns out to typically be within 5% of the real number
- F32 used = (LLImageGL::getTextureBytesAllocated() + LLVertexBuffer::getBytesAllocated()) / 1024 / 512;
+ F32 used = (F32)ll_round(texture_bytes_alloc + vertex_bytes_alloc);
F32 budget = max_vram_budget == 0 ? gGLManager.mVRAM : max_vram_budget;
diff --git a/indra/newview/skins/default/xui/en/floater_adjust_environment.xml b/indra/newview/skins/default/xui/en/floater_adjust_environment.xml
index 518a83f846..91a1dffcb5 100644
--- a/indra/newview/skins/default/xui/en/floater_adjust_environment.xml
+++ b/indra/newview/skins/default/xui/en/floater_adjust_environment.xml
@@ -12,6 +12,7 @@
can_resize="false">
<string name="hdr_string">HDR Scale:</string>
<string name="brightness_string">Brightness:</string>
+ <string name="hdr_tooltip">Intensity of lightning effects such as realistically bright skies and dynamic exposure. 1.0 is the default, 0 is off, values between 0 and 1 are mixing Ambient with HDR.</string>
<layout_stack name="outer_stack"
width="845"
height="275"
@@ -263,6 +264,7 @@
min_val="0"
max_val="10"
name="probe_ambiance"
+ tool_tip="Intensity of environment based indirect lighting. At zero HDR scale becomes Brightness"
top_pad="5"
width="185"
can_edit_text="true"/>
diff --git a/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml b/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml
index 2d79bc74ab..da82c95c83 100644
--- a/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml
+++ b/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml
@@ -9,6 +9,7 @@
top="0">
<string name="hdr_string">HDR Scale:</string>
<string name="brightness_string">Brightness:</string>
+ <string name="hdr_tooltip">Intensity of lightning effects such as realistically bright skies and dynamic exposure. 1.0 is the default, 0 is off, values between 0 and 1 are mixing Ambient with HDR.</string>
<layout_stack
name="main_ls"
follows="all"
@@ -332,6 +333,7 @@
min_val="0"
max_val="10"
name="probe_ambiance"
+ tool_tip="Intensity of environment based indirect lighting. At zero HDR scale becomes Brightness"
top_delta="20"
width="219"
can_edit_text="true"/>