From 34e79c8f4e251200496651f9ae2b5126a6f7faa3 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 11 Mar 2022 10:21:08 -0600 Subject: SL-17005 WIP Simplify what feeds texture loading bias to only pay attention to available memory according to OS and GL driver, not (broken) internal accounting (breaks intel GPUs, compatibility pass incoming). --- indra/newview/llviewertexture.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewertexture.h') diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index b953d7006b..0640efe6df 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -188,10 +188,11 @@ private: virtual void switchToCachedImage(); - static bool isMemoryForTextureLow() ; static bool isMemoryForTextureSuficientlyFree(); static void getGPUMemoryForTextures(S32Megabytes &gpu, S32Megabytes &physical); +public: + static bool isMemoryForTextureLow(); protected: LLUUID mID; S32 mTextureListType; // along with mID identifies where to search for this texture in TextureList @@ -226,11 +227,6 @@ public: static LLFrameTimer sEvaluationTimer; static F32 sDesiredDiscardBias; static F32 sDesiredDiscardScale; - static S32Bytes sBoundTextureMemory; - static S32Bytes sTotalTextureMemory; - static S32Megabytes sMaxBoundTextureMemory; - static S32Megabytes sMaxTotalTextureMem; - static S32Bytes sMaxDesiredTextureMem ; static S8 sCameraMovingDiscardBias; static F32 sCameraMovingBias; static S32 sMaxSculptRez ; -- cgit v1.2.3 From b6841d75c2f259c84d5ab6b012bd2ae37d985451 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 15 Apr 2022 19:02:07 -0500 Subject: SL-17219 WIP - Texture pipeline overhaul --- indra/newview/llviewertexture.h | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'indra/newview/llviewertexture.h') diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 0640efe6df..ece6794592 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -194,14 +194,14 @@ private: public: static bool isMemoryForTextureLow(); protected: + friend class LLViewerTextureList; LLUUID mID; S32 mTextureListType; // along with mID identifies where to search for this texture in TextureList F32 mSelectedTime; // time texture was last selected mutable F32 mMaxVirtualSize; // The largest virtual size of the image, in pixels - how much data to we need? - mutable S32 mMaxVirtualSizeResetCounter ; + mutable S32 mMaxVirtualSizeResetCounter; mutable S32 mMaxVirtualSizeResetInterval; - mutable F32 mAdditionalDecodePriority; // priority add to mDecodePriority. LLFrameTimer mLastReferencedTimer; ll_face_list_t mFaceList[LLRender::NUM_TEXTURE_CHANNELS]; //reverse pointer pointing to the faces using this image as texture @@ -281,7 +281,6 @@ public: LLViewerFetchedTexture(const std::string& url, FTType f_type, const LLUUID& id, BOOL usemipmaps = TRUE); public: - static F32 maxDecodePriority(); struct Compare { @@ -290,9 +289,10 @@ public: { const LLViewerFetchedTexture* lhsp = (const LLViewerFetchedTexture*)lhs; const LLViewerFetchedTexture* rhsp = (const LLViewerFetchedTexture*)rhs; + // greater priority is "less" - const F32 lpriority = lhsp->getDecodePriority(); - const F32 rpriority = rhsp->getDecodePriority(); + const F32 lpriority = lhsp->mMaxVirtualSize; + const F32 rpriority = rhsp->mMaxVirtualSize; if (lpriority > rpriority) // higher priority return true; if (lpriority < rpriority) @@ -331,7 +331,6 @@ public: void destroyTexture() ; virtual void processTextureStats() ; - F32 calcDecodePriority() ; BOOL needsAux() const { return mNeedsAux; } @@ -339,15 +338,6 @@ public: void setTargetHost(LLHost host) { mTargetHost = host; } LLHost getTargetHost() const { return mTargetHost; } - // Set the decode priority for this image... - // DON'T CALL THIS UNLESS YOU KNOW WHAT YOU'RE DOING, it can mess up - // the priority list, and cause horrible things to happen. - void setDecodePriority(F32 priority = -1.0f); - F32 getDecodePriority() const { return mDecodePriority; }; - F32 getAdditionalDecodePriority() const { return mAdditionalDecodePriority; }; - - void setAdditionalDecodePriority(F32 priority) ; - void updateVirtualSize() ; S32 getDesiredDiscardLevel() { return mDesiredDiscardLevel; } @@ -367,6 +357,10 @@ public: // more data. /*virtual*/ void setKnownDrawSize(S32 width, S32 height); + // Set the debug text of all Viewer Objects associated with this texture + // to the specified text + void setDebugText(const std::string& text); + void setIsMissingAsset(BOOL is_missing = true); /*virtual*/ BOOL isMissingAsset() const { return mIsMissingAsset; } @@ -468,11 +462,11 @@ protected: S32 mRequestedDiscardLevel; F32 mRequestedDownloadPriority; S32 mFetchState; + S32 mLastFetchState = -1; // DEBUG U32 mFetchPriority; F32 mDownloadProgress; F32 mFetchDeltaTime; F32 mRequestDeltaTime; - F32 mDecodePriority; // The priority for decoding this image. S32 mMinDiscardLevel; S8 mDesiredDiscardLevel; // The discard level we'd LIKE to have - if we have it and there's space S8 mMinDesiredDiscardLevel; // The minimum discard level we'd like to have @@ -530,6 +524,7 @@ protected: BOOL mIsFetched ; //is loaded from remote or from cache, not generated locally. public: + static F32 sMaxVirtualSize; //maximum possible value of mMaxVirtualSize static LLPointer sMissingAssetImagep; // Texture to show for an image asset that is not in the database static LLPointer sWhiteImagep; // Texture to show NOTHING (whiteness) static LLPointer sDefaultImagep; // "Default" texture for error cases, the only case of fetched texture which is generated in local. -- cgit v1.2.3 From 3e9dcba813a8263635e06b8e49c4aa5c54742139 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 24 May 2022 17:03:11 -0500 Subject: SL-17486 Fix for many texture types failing to load. --- indra/newview/llviewertexture.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewertexture.h') diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index ece6794592..49d030bcb8 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -199,7 +199,7 @@ protected: S32 mTextureListType; // along with mID identifies where to search for this texture in TextureList F32 mSelectedTime; // time texture was last selected - mutable F32 mMaxVirtualSize; // The largest virtual size of the image, in pixels - how much data to we need? + mutable F32 mMaxVirtualSize = 0.f; // The largest virtual size of the image, in pixels - how much data to we need? mutable S32 mMaxVirtualSizeResetCounter; mutable S32 mMaxVirtualSizeResetInterval; LLFrameTimer mLastReferencedTimer; @@ -490,7 +490,7 @@ protected: F32 mLastCallBackActiveTime; LLPointer mRawImage; - S32 mRawDiscardLevel; + S32 mRawDiscardLevel = -1; // Used ONLY for cloth meshes right now. Make SURE you know what you're // doing if you use it for anything else! - djs -- cgit v1.2.3 From dfa71e2bb59e81de93f626fada6975ae46b01bb6 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 31 May 2022 11:57:15 -0500 Subject: SL-17490 Only update a subset of textures each frame and remove dead debug code. --- indra/newview/llviewertexture.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llviewertexture.h') diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 49d030bcb8..a5e5c37c22 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -763,7 +763,6 @@ private: void reset() ; - F32 mTotalFetchingTime ; F32 mTotalGrayTime ; F32 mTotalStablizingTime ; F32 mStartTimeLoadingSculpties ; -- cgit v1.2.3 From 5259fa811c11892ef150f853c9de5a8927fa68a6 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 6 Jun 2022 21:12:48 -0500 Subject: SL-17486 Force desired discard level to 0 for high boosted textures (fix for fuzzy terrain textures etc). --- indra/newview/llviewertexture.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewertexture.h') diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index a5e5c37c22..f3bc9061a2 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -134,7 +134,7 @@ public: /*virtual*/ bool isActiveFetching(); /*virtual*/ const LLUUID& getID() const { return mID; } - void setBoostLevel(S32 level); + virtual void setBoostLevel(S32 level); S32 getBoostLevel() { return mBoostLevel; } void setTextureListType(S32 tex_type) { mTextureListType = tex_type; } S32 getTextureListType() { return mTextureListType; } @@ -343,6 +343,7 @@ public: S32 getDesiredDiscardLevel() { return mDesiredDiscardLevel; } void setMinDiscardLevel(S32 discard) { mMinDesiredDiscardLevel = llmin(mMinDesiredDiscardLevel,(S8)discard); } + void setBoostLevel(S32 level) override; bool updateFetch(); bool setDebugFetching(S32 debug_level); bool isInDebug() const { return mInDebug; } -- cgit v1.2.3 From 91a9665e35a3bfeb5a2bc81586a23e70bb2c7596 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Mon, 13 Jun 2022 14:00:13 -0700 Subject: SL-17485 - Make mac compiler happier. --- indra/newview/llviewertexture.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/newview/llviewertexture.h') diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index f3bc9061a2..8c41c4a6bc 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -302,10 +302,10 @@ public: }; public: - /*virtual*/ S8 getType() const ; + /*virtual*/ S8 getType() const override; FTType getFTType() const; - /*virtual*/ void forceImmediateUpdate() ; - /*virtual*/ void dump() ; + /*virtual*/ void forceImmediateUpdate() override; + /*virtual*/ void dump() override; // Set callbacks to get called when the image gets updated with higher // resolution versions. @@ -356,14 +356,14 @@ public: // Override the computation of discard levels if we know the exact output // size of the image. Used for UI textures to not decode, even if we have // more data. - /*virtual*/ void setKnownDrawSize(S32 width, S32 height); + /*virtual*/ void setKnownDrawSize(S32 width, S32 height) override; // Set the debug text of all Viewer Objects associated with this texture // to the specified text void setDebugText(const std::string& text); void setIsMissingAsset(BOOL is_missing = true); - /*virtual*/ BOOL isMissingAsset() const { return mIsMissingAsset; } + /*virtual*/ BOOL isMissingAsset() const override { return mIsMissingAsset; } // returns dimensions of original image for local files (before power of two scaling) // and returns 0 for all asset system images @@ -406,7 +406,7 @@ public: BOOL isRawImageValid()const { return mIsRawImageValid ; } void forceToSaveRawImage(S32 desired_discard = 0, F32 kept_time = 0.f) ; void forceToRefetchTexture(S32 desired_discard = 0, F32 kept_time = 60.f); - /*virtual*/ void setCachedRawImage(S32 discard_level, LLImageRaw* imageraw) ; + /*virtual*/ void setCachedRawImage(S32 discard_level, LLImageRaw* imageraw) override; void destroySavedRawImage() ; LLImageRaw* getSavedRawImage() ; BOOL hasSavedRawImage() const ; @@ -422,10 +422,10 @@ public: void setInFastCacheList(bool in_list) { mInFastCacheList = in_list; } bool isInFastCacheList() { return mInFastCacheList; } - /*virtual*/bool isActiveFetching(); //is actively in fetching by the fetching pipeline. + /*virtual*/bool isActiveFetching() override; //is actively in fetching by the fetching pipeline. protected: - /*virtual*/ void switchToCachedImage(); + /*virtual*/ void switchToCachedImage() override; S32 getCurrentDiscardLevelForFetching() ; private: -- cgit v1.2.3 From 18b0aa03717cd8209b6c239457bcf69f0d39ecf7 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 16 Jun 2022 16:16:53 -0500 Subject: SL-17619 Add support for embedded textures to GLTF importer --- indra/newview/llviewertexture.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llviewertexture.h') diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index b953d7006b..53cf911102 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -668,6 +668,8 @@ public: static LLPointer getLocalTexture(const LLImageRaw* raw, BOOL usemipmaps) ; static LLPointer getLocalTexture(const U32 width, const U32 height, const U8 components, BOOL usemipmaps, BOOL generate_gl_tex = TRUE) ; + static LLViewerFetchedTexture* getFetchedTexture(const LLImageRaw* raw, FTType type, bool usemipmaps); + static LLViewerFetchedTexture* getFetchedTexture(const LLUUID &image_id, FTType f_type = FTT_DEFAULT, BOOL usemipmap = TRUE, -- cgit v1.2.3 From 71ae65ae175a33c7f60442f62b0ef59415528bf5 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Mon, 29 Aug 2022 14:06:48 -0700 Subject: SL-17703: PBR: Fix missing ORM to use 1,0,0 --- indra/newview/llviewertexture.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llviewertexture.h') diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 53cf911102..89ded4ded7 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -252,6 +252,7 @@ public: static LLPointer sNullImagep; // Null texture for non-textured objects. static LLPointer sBlackImagep; // Texture to show NOTHING (pure black) static LLPointer sCheckerBoardImagep; // Texture to show NOTHING (pure black) + static LLPointer sDefaultPBRORMImagep; // PBR: When ORM is missing use 1,0,0 }; -- cgit v1.2.3 From e81b149c4a24a8ade827e34fa600207cfa86fc7f Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Mon, 29 Aug 2022 17:34:49 -0700 Subject: Revert "SL-17703: PBR: Fix missing ORM to use 1,0,0" If ORM is blank the roughness and metal are multiplied into a default white ORM texture. This reverts commit 71ae65ae175a33c7f60442f62b0ef59415528bf5. --- indra/newview/llviewertexture.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llviewertexture.h') diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 89ded4ded7..53cf911102 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -252,7 +252,6 @@ public: static LLPointer sNullImagep; // Null texture for non-textured objects. static LLPointer sBlackImagep; // Texture to show NOTHING (pure black) static LLPointer sCheckerBoardImagep; // Texture to show NOTHING (pure black) - static LLPointer sDefaultPBRORMImagep; // PBR: When ORM is missing use 1,0,0 }; -- cgit v1.2.3 From 8eaee1f033d9dac892e749cc65416e149021d8f6 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Tue, 30 Aug 2022 20:35:15 -0700 Subject: SL-17703: PBR: Fix albedo being in wrong color space, add support for debug default_irradiance.png --- indra/newview/llviewertexture.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llviewertexture.h') diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 5893f549d0..3cfdf0b6f1 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -531,6 +531,7 @@ public: static LLPointer sDefaultImagep; // "Default" texture for error cases, the only case of fetched texture which is generated in local. static LLPointer sSmokeImagep; // Old "Default" translucent texture static LLPointer sFlatNormalImagep; // Flat normal map denoting no bumpiness on a surface + static LLPointer sDefaultIrradiancePBRp; // PBR: irradiance }; // -- cgit v1.2.3 From c9f893b1003b2d9db01362430dbbfa59a91d4fd7 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 31 Aug 2022 11:36:00 -0500 Subject: SL-18065 WIP -- Adjust max virtual size to keep debug floater readable. Make assert on shutdown less frequent (still not gone, likely race condition). Fix unrelated assertion in reflection probes. --- indra/newview/llviewertexture.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llviewertexture.h') diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 5893f549d0..a57886ff6f 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -218,7 +218,6 @@ protected: LL::WorkQueue::weak_t mMainQueue; LL::WorkQueue::weak_t mImageQueue; - static F32 sTexelPixelRatio; public: static const U32 sCurrentFileVersion; static S32 sImageCount; -- cgit v1.2.3 From 78feca373ea35bfac5ae63095e354257e0d1a1ec Mon Sep 17 00:00:00 2001 From: akleshchev <117672381+akleshchev@users.noreply.github.com> Date: Tue, 29 Nov 2022 21:42:43 +0200 Subject: SL-12069 Backed out changeset: 544a91982eba (#13) Originally a fix for MAINT-4773/SL-5842 (transparent alpha being white). Reverting due to a critical flaw of the fix replacing material (sometimes server side included). And ignoring user and script input in some cases that makes scripts misbehave. Viewer should Not modify existing content of own volition. --- indra/newview/llviewertexture.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'indra/newview/llviewertexture.h') diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 312e2ca365..5fa5d893e7 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -177,10 +177,7 @@ protected: void cleanup() ; void init(bool firstinit) ; void reorganizeFaceList() ; - void reorganizeVolumeList() ; - - void notifyAboutMissingAsset(); - void notifyAboutCreatingTexture(); + void reorganizeVolumeList(); private: friend class LLBumpImageList; -- cgit v1.2.3 From 20c578b7ae512e7c8128eb78f9dc4080fd556a91 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 13 Dec 2022 11:40:14 -0600 Subject: SL-18808 Fix for highlight transparent texture missing. --- indra/newview/llviewertexture.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewertexture.h') diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 5fa5d893e7..facf05e52f 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -525,9 +525,12 @@ public: static LLPointer sMissingAssetImagep; // Texture to show for an image asset that is not in the database static LLPointer sWhiteImagep; // Texture to show NOTHING (whiteness) static LLPointer sDefaultImagep; // "Default" texture for error cases, the only case of fetched texture which is generated in local. - static LLPointer sSmokeImagep; // Old "Default" translucent texture static LLPointer sFlatNormalImagep; // Flat normal map denoting no bumpiness on a surface static LLPointer sDefaultIrradiancePBRp; // PBR: irradiance + + // not sure why, but something is iffy about the loading of this particular texture, use the accessor instead of accessing directly + static LLPointer sSmokeImagep; // Old "Default" translucent texture + static LLViewerFetchedTexture* getSmokeImage(); }; // -- cgit v1.2.3 From 25ede8638209fac8dde5b71bece4bc1dfa30ea16 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 10 Mar 2023 10:52:35 -0600 Subject: SL-19172 Texture streaming tune up. Incidental decruft. --- indra/newview/llviewertexture.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/newview/llviewertexture.h') diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index facf05e52f..1370f4debe 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -195,7 +195,6 @@ protected: LLUUID mID; S32 mTextureListType; // along with mID identifies where to search for this texture in TextureList - F32 mSelectedTime; // time texture was last selected mutable F32 mMaxVirtualSize = 0.f; // The largest virtual size of the image, in pixels - how much data to we need? mutable S32 mMaxVirtualSizeResetCounter; mutable S32 mMaxVirtualSizeResetInterval; @@ -223,8 +222,6 @@ public: static LLFrameTimer sEvaluationTimer; static F32 sDesiredDiscardBias; static F32 sDesiredDiscardScale; - static S8 sCameraMovingDiscardBias; - static F32 sCameraMovingBias; static S32 sMaxSculptRez ; static U32 sMinLargeImageSize ; static U32 sMaxSmallImageSize ; -- cgit v1.2.3 From 50ec54831de88926ca13c9a72d89006ceda6c355 Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Thu, 1 Jun 2023 19:49:23 -0500 Subject: DRTVWR-559 Revert skies to be very close to release and disable tone mapping when probe ambiance is zero. Hack for desaturating legacy materials has been removed for performance and quality reasons. Adds a new setting for auto adjusting legacy skies. This is the PBR "opt out" button. If disabled, legacy skies will disable tonemapping, automatic probe ambiance, and HDR/exposure. If enabled, legacy skies will behave as if probe ambiance and HDR scale are 1.0, and ambient will be cut in half. HDR scale will act as a sky brightener, but will automatically adjust dynamic exposure so the sky will be properly exposed. If you want relatively even exposure all the time, set HDR Scale to 1.0. If you want a high range of exposures between indoor/dark areas and outdoor/bright areas, increase HDR Scale. Also tuned up SSAO (thanks Rye!). Reviewed with Brad. --- indra/newview/llviewertexture.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llviewertexture.h') diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 34118c86cd..35fb0a2237 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -186,7 +186,6 @@ private: virtual void switchToCachedImage(); - static bool isMemoryForTextureSuficientlyFree(); static void getGPUMemoryForTextures(S32Megabytes &gpu, S32Megabytes &physical); public: -- cgit v1.2.3