diff options
author | cosmic-linden <111533034+cosmic-linden@users.noreply.github.com> | 2024-01-26 13:19:32 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-26 13:19:32 -0800 |
commit | c8547ad8a588fca0a22b2194ad1b18b66153f32d (patch) | |
tree | 7cab4bcc0ecc15ae9bd7fc619be308cee2c665c0 /indra/newview/llgltfmaterialpreviewmgr.cpp | |
parent | 85bf567010d54b64b3144397bff7c3c0448d85da (diff) | |
parent | 18669f3be7d61815203eddbfb866d551aba9bc69 (diff) |
Merge pull request #670 from secondlife/SL-20606
SL-20606 post-merge follow-up
Diffstat (limited to 'indra/newview/llgltfmaterialpreviewmgr.cpp')
-rw-r--r-- | indra/newview/llgltfmaterialpreviewmgr.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
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; } |