diff options
| author | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2024-01-29 12:19:09 -0800 | 
|---|---|---|
| committer | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2024-01-29 12:19:09 -0800 | 
| commit | 80ce790d2e952c7fb41cea69071fc026ac82f691 (patch) | |
| tree | 6594383d3938fe00680e489fdd71eb166afcf925 /indra | |
| parent | 4e90bd3cc0a4c1021cf8e688e008a0f0418d8364 (diff) | |
| parent | c8547ad8a588fca0a22b2194ad1b18b66153f32d (diff) | |
Merge branch 'release/materials_featurette' into materials_featurette/mirrors
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llfetchedgltfmaterial.h | 2 | ||||
| -rw-r--r-- | indra/newview/llgltfmaterialpreviewmgr.cpp | 11 | ||||
| -rw-r--r-- | indra/newview/lltexturectrl.cpp | 4 | ||||
| -rw-r--r-- | indra/newview/pipeline.cpp | 9 | ||||
| -rw-r--r-- | indra/newview/pipeline.h | 1 | 
5 files changed, 15 insertions, 12 deletions
| diff --git a/indra/newview/llfetchedgltfmaterial.h b/indra/newview/llfetchedgltfmaterial.h index 3fa4619d8c..42c835a416 100644 --- a/indra/newview/llfetchedgltfmaterial.h +++ b/indra/newview/llfetchedgltfmaterial.h @@ -40,6 +40,8 @@ public:      virtual ~LLFetchedGLTFMaterial();      LLFetchedGLTFMaterial& operator=(const LLFetchedGLTFMaterial& rhs); +    // LLGLTFMaterial::operator== is defined, but LLFetchedGLTFMaterial::operator== is not. +    bool operator==(const LLGLTFMaterial& rhs) const = delete;      // If this material is loaded, fire the given function      void onMaterialComplete(std::function<void()> material_complete); diff --git a/indra/newview/llgltfmaterialpreviewmgr.cpp b/indra/newview/llgltfmaterialpreviewmgr.cpp index a8ea3429f4..53d9d7d0ba 100644 --- a/indra/newview/llgltfmaterialpreviewmgr.cpp +++ b/indra/newview/llgltfmaterialpreviewmgr.cpp @@ -34,6 +34,7 @@  #include "llenvironment.h"  #include "llselectmgr.h"  #include "llviewercamera.h" +#include "llviewercontrol.h"  #include "llviewerobject.h"  #include "llviewershadermgr.h"  #include "llviewertexturelist.h" @@ -95,7 +96,7 @@ namespace  {      void fetch_texture_for_ui(LLPointer<LLViewerFetchedTexture>& img, const LLUUID& id)      { -        if (id.notNull()) +        if (!img && id.notNull())          {              if (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(id))              { @@ -129,6 +130,8 @@ namespace      LLGLTFPreviewTexture::MaterialLoadLevels get_material_load_levels(LLFetchedGLTFMaterial& material)      { +        llassert(!material.isFetching()); +          using MaterialTextures = LLPointer<LLViewerFetchedTexture>*[LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT];          MaterialTextures textures; @@ -334,7 +337,7 @@ void set_preview_sphere_material(PreviewSphere& preview_sphere, LLPointer<LLFetc          info->mGLTFMaterial = material;          LLVertexBuffer* buf = info->mVertexBuffer.get();          LLStrider<LLColor4U> colors; -        const S32 count = info->mEnd - info->mStart; +        const S32 count = info->mEnd - info->mStart + 1;          buf->getColorStrider(colors, info->mStart, count);          for (S32 i = 0; i < count; ++i)          { @@ -419,7 +422,8 @@ BOOL LLGLTFPreviewTexture::render()      LLVector3 light_dir3(1.0f, 1.0f, 1.0f);      light_dir3.normalize();      const LLVector4 light_dir = LLVector4(light_dir3, 0); -    SetTemporarily<S32> sun_light_only(&LLPipeline::RenderLocalLightCount, 0); +    const S32 old_local_light_count = gSavedSettings.get<S32>("RenderLocalLightCount"); +    gSavedSettings.set<S32>("RenderLocalLightCount", 0);      gPipeline.mReflectionMapManager.forceDefaultProbeAndUpdateUniforms(); @@ -524,6 +528,7 @@ BOOL LLGLTFPreviewTexture::render()      // Clean up      gPipeline.setupHWLights();      gPipeline.mReflectionMapManager.forceDefaultProbeAndUpdateUniforms(false); +    gSavedSettings.set<S32>("RenderLocalLightCount", old_local_light_count);      return TRUE;  } diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 916c0194c2..febda177e2 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -666,7 +666,7 @@ void LLFloaterTexturePicker::draw()              {                  mGLTFMaterial = (LLFetchedGLTFMaterial*) gGLTFMaterialList.getMaterial(mImageAssetID);                  llassert(mGLTFMaterial == nullptr || dynamic_cast<LLFetchedGLTFMaterial*>(gGLTFMaterialList.getMaterial(mImageAssetID)) != nullptr); -                if (mGLTFPreview.isNull() || mGLTFMaterial.isNull() || (old_material.notNull() && (*old_material.get() != *mGLTFMaterial.get()))) +                if (mGLTFPreview.isNull() || mGLTFMaterial.isNull() || (old_material.notNull() && (old_material.get() != mGLTFMaterial.get())))                  {                      // Only update the preview if needed, since gGLTFMaterialPreviewMgr does not cache the preview.                      if (mGLTFMaterial.isNull()) @@ -2206,7 +2206,7 @@ void LLTextureCtrl::draw()              if (mInventoryPickType == PICK_MATERIAL)              {                  mGLTFMaterial = gGLTFMaterialList.getMaterial(mImageAssetID); -                if (mGLTFPreview.isNull() || mGLTFMaterial.isNull() || (old_material.notNull() && (*old_material.get() != *mGLTFMaterial.get()))) +                if (mGLTFPreview.isNull() || mGLTFMaterial.isNull() || (old_material.notNull() && (old_material.get() != mGLTFMaterial.get())))                  {                      // Only update the preview if needed, since gGLTFMaterialPreviewMgr does not cache the preview.                      if (mGLTFMaterial.isNull()) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 94f2dc4a2a..d81bcef259 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -163,7 +163,6 @@ F32 LLPipeline::CameraFocusTransitionTime;  F32 LLPipeline::CameraFNumber;  F32 LLPipeline::CameraFocalLength;  F32 LLPipeline::CameraFieldOfView; -S32 LLPipeline::RenderLocalLightCount;  F32 LLPipeline::RenderShadowNoise;  F32 LLPipeline::RenderShadowBlurSize;  F32 LLPipeline::RenderSSAOScale; @@ -525,7 +524,6 @@ void LLPipeline::init()  	connectRefreshCachedSettingsSafe("CameraFNumber");  	connectRefreshCachedSettingsSafe("CameraFocalLength");  	connectRefreshCachedSettingsSafe("CameraFieldOfView"); -	connectRefreshCachedSettingsSafe("RenderLocalLightCount");  	connectRefreshCachedSettingsSafe("RenderShadowNoise");  	connectRefreshCachedSettingsSafe("RenderShadowBlurSize");  	connectRefreshCachedSettingsSafe("RenderSSAOScale"); @@ -1025,7 +1023,6 @@ void LLPipeline::refreshCachedSettings()  	CameraFNumber = gSavedSettings.getF32("CameraFNumber");  	CameraFocalLength = gSavedSettings.getF32("CameraFocalLength");  	CameraFieldOfView = gSavedSettings.getF32("CameraFieldOfView"); -	RenderLocalLightCount = gSavedSettings.getS32("RenderLocalLightCount");  	RenderShadowNoise = gSavedSettings.getF32("RenderShadowNoise");  	RenderShadowBlurSize = gSavedSettings.getF32("RenderShadowBlurSize");  	RenderSSAOScale = gSavedSettings.getF32("RenderSSAOScale"); @@ -5262,7 +5259,7 @@ void LLPipeline::calcNearbyLights(LLCamera& camera)  		return;  	} -    const S32 local_light_count = LLPipeline::RenderLocalLightCount; +    static LLCachedControl<S32> local_light_count(gSavedSettings, "RenderLocalLightCount", 256);  	if (local_light_count >= 1)  	{ @@ -5531,7 +5528,7 @@ void LLPipeline::setupHWLights()  	mLightMovingMask = 0; -    const S32 local_light_count = LLPipeline::RenderLocalLightCount; +    static LLCachedControl<S32> local_light_count(gSavedSettings, "RenderLocalLightCount", 256);  	if (local_light_count >= 1)  	{ @@ -7965,7 +7962,7 @@ void LLPipeline::renderDeferredLighting()              unbindDeferredShader(gDeferredSoftenProgram);          } -        const S32 local_light_count = LLPipeline::RenderLocalLightCount; +        static LLCachedControl<S32> local_light_count(gSavedSettings, "RenderLocalLightCount", 256);          if (local_light_count > 0)          { diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 21c1d9a25d..5ace90b000 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -1015,7 +1015,6 @@ public:  	static F32 CameraFNumber;  	static F32 CameraFocalLength;  	static F32 CameraFieldOfView; -	static S32 RenderLocalLightCount;  	static F32 RenderShadowNoise;  	static F32 RenderShadowBlurSize;  	static F32 RenderSSAOScale; | 
