diff options
22 files changed, 390 insertions, 89 deletions
| diff --git a/indra/llcommon/workqueue.cpp b/indra/llcommon/workqueue.cpp index 6066e74fb5..dace95aaf2 100644 --- a/indra/llcommon/workqueue.cpp +++ b/indra/llcommon/workqueue.cpp @@ -17,6 +17,7 @@  // std headers  // external library headers  // other Linden headers +#include "llapp.h"  #include "llcoros.h"  #include LLCOROS_MUTEX_HEADER  #include "llerror.h" @@ -102,19 +103,95 @@ std::string LL::WorkQueueBase::makeName(const std::string& name)      return STRINGIZE("WorkQueue" << num);  } +namespace +{ +#if LL_WINDOWS + +    static const U32 STATUS_MSC_EXCEPTION = 0xE06D7363; // compiler specific + +    U32 exception_filter(U32 code, struct _EXCEPTION_POINTERS* exception_infop) +    { +        if (LLApp::instance()->reportCrashToBugsplat((void*)exception_infop)) +        { +            // Handled +            return EXCEPTION_CONTINUE_SEARCH; +        } +        else if (code == STATUS_MSC_EXCEPTION) +        { +            // C++ exception, go on +            return EXCEPTION_CONTINUE_SEARCH; +        } +        else +        { +            // handle it, convert to std::exception +            return EXCEPTION_EXECUTE_HANDLER; +        } + +        return EXCEPTION_CONTINUE_SEARCH; +    } + +    void cpphandle(const LL::WorkQueueBase::Work& work) +    { +        // SE and C++ can not coexists, thus two handlers +        try +        { +            work(); +        } +        catch (const LLContinueError&) +        { +            // Any uncaught exception derived from LLContinueError will be caught +            // here and logged. This coroutine will terminate but the rest of the +            // viewer will carry on. +            LOG_UNHANDLED_EXCEPTION(STRINGIZE("LLContinue in work queue")); +        } +    } + +    void sehandle(const LL::WorkQueueBase::Work& work) +    { +        __try +        { +            // handle stop and continue exceptions first +            cpphandle(work); +        } +        __except (exception_filter(GetExceptionCode(), GetExceptionInformation())) +        { +            // convert to C++ styled exception +            char integer_string[512]; +            sprintf(integer_string, "SEH, code: %lu\n", GetExceptionCode()); +            throw std::exception(integer_string); +        } +    } +#endif // LL_WINDOWS +} // anonymous namespace +  void LL::WorkQueueBase::callWork(const Work& work)  {      LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD; + +#ifdef LL_WINDOWS +    // can not use __try directly, toplevel requires unwinding, thus use of a wrapper +    sehandle(work); +#else // LL_WINDOWS      try      {          work();      } -    catch (...) +    catch (LLContinueError&)      { -        // No matter what goes wrong with any individual work item, the worker -        // thread must go on! Log our own instance name with the exception.          LOG_UNHANDLED_EXCEPTION(getKey());      } +    catch (...) +    { +        // Stash any other kind of uncaught exception to be rethrown by main thread. +        LL_WARNS("LLCoros") << "Capturing uncaught exception in WorkQueueBase " +            << getKey() << LL_ENDL; + +        LL::WorkQueue::ptr_t main_queue = LL::WorkQueue::getInstance("mainloop"); +        main_queue->post( +            // Bind the current exception rethrow it in main loop. +            [exc = std::current_exception()]() { std::rethrow_exception(exc); }); +    } +#endif // else LL_WINDOWS  }  void LL::WorkQueueBase::error(const std::string& msg) diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp index 2de59c1b6a..10fd56a68e 100644 --- a/indra/llmessage/llassetstorage.cpp +++ b/indra/llmessage/llassetstorage.cpp @@ -585,7 +585,8 @@ void LLAssetStorage::getAssetData(const LLUUID uuid,  // static  void LLAssetStorage::removeAndCallbackPendingDownloads(const LLUUID& file_id, LLAssetType::EType file_type,                                                         const LLUUID& callback_id, LLAssetType::EType callback_type, -                                                       S32 result_code, LLExtStat ext_status) +                                                       S32 result_code, LLExtStat ext_status, +                                                       S32 bytes_fetched)  {      // find and callback ALL pending requests for this UUID      // SJB: We process the callbacks in reverse order, I do not know if this is important, @@ -598,6 +599,10 @@ void LLAssetStorage::removeAndCallbackPendingDownloads(const LLUUID& file_id, LL          LLAssetRequest* tmp = *curiter;          if ((tmp->getUUID() == file_id) && (tmp->getType()== file_type))          { +            if (bytes_fetched > 0) +            { +                tmp->mBytesFetched = bytes_fetched; +            }              requests.push_front(tmp);              iter = gAssetStorage->mPendingDownloads.erase(curiter);          } @@ -664,6 +669,7 @@ void LLAssetStorage::downloadCompleteCallback(          callback_type = req->getType();      } +    S32 bytes_fetched = 0;      if (LL_ERR_NOERR == result)      {          // we might have gotten a zero-size file @@ -677,21 +683,11 @@ void LLAssetStorage::downloadCompleteCallback(          }          else          { -#if 1 -            for (request_list_t::iterator iter = gAssetStorage->mPendingDownloads.begin(); -                 iter != gAssetStorage->mPendingDownloads.end(); ++iter  ) -            { -                LLAssetRequest* dlreq = *iter; -                if ((dlreq->getUUID() == file_id) && (dlreq->getType()== file_type)) -                { -                    dlreq->mBytesFetched = vfile.getSize(); -                } -            } -#endif +            bytes_fetched = vfile.getSize();          }      } -    removeAndCallbackPendingDownloads(file_id, file_type, callback_id, callback_type, result, ext_status); +    removeAndCallbackPendingDownloads(file_id, file_type, callback_id, callback_type, result, ext_status, bytes_fetched);  }  void LLAssetStorage::getEstateAsset( diff --git a/indra/llmessage/llassetstorage.h b/indra/llmessage/llassetstorage.h index 88fa572092..6d6526757d 100644 --- a/indra/llmessage/llassetstorage.h +++ b/indra/llmessage/llassetstorage.h @@ -324,7 +324,8 @@ public:      static void removeAndCallbackPendingDownloads(const LLUUID& file_id, LLAssetType::EType file_type,                                                    const LLUUID& callback_id, LLAssetType::EType callback_type, -                                                  S32 result_code, LLExtStat ext_status); +                                                  S32 result_code, LLExtStat ext_status, +                                                  S32 bytes_fetched);      // download process callbacks      static void downloadCompleteCallback( diff --git a/indra/llrender/llcubemaparray.cpp b/indra/llrender/llcubemaparray.cpp index 9c3069e848..fb35e002df 100644 --- a/indra/llrender/llcubemaparray.cpp +++ b/indra/llrender/llcubemaparray.cpp @@ -105,6 +105,36 @@ LLCubeMapArray::LLCubeMapArray()  } +LLCubeMapArray::LLCubeMapArray(LLCubeMapArray& lhs, U32 width, U32 count) : mTextureStage(0) +{ +    mWidth = width; +    mCount = count; + +    // Allocate a new cubemap array with the same criteria as the incoming cubemap array +    allocate(mWidth, lhs.mImage->getComponents(), count, lhs.mImage->getUseMipMaps(), lhs.mHDR); + +    // Copy each cubemap from the incoming array to the new array +    U32 min_count = std::min(count, lhs.mCount); +    for (U32 i = 0; i < min_count * 6; ++i) +    { +        U32 src_resolution = lhs.mWidth; +        U32 dst_resolution = mWidth; +        { +            GLint components = GL_RGB; +            if (mImage->getComponents() == 4) +                components = GL_RGBA; +            GLint format = GL_RGB; + +            // Handle different resolutions by scaling the image +            LLPointer<LLImageRaw> src_image = new LLImageRaw(lhs.mWidth, lhs.mWidth, lhs.mImage->getComponents()); +            glGetTexImage(GL_TEXTURE_CUBE_MAP_ARRAY, 0, components, GL_UNSIGNED_BYTE, src_image->getData()); + +            LLPointer<LLImageRaw> scaled_image = src_image->scaled(mWidth, mWidth); +            glTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, 0, 0, 0, i, mWidth, mWidth, 1, components, GL_UNSIGNED_BYTE, scaled_image->getData()); +        } +    } +} +  LLCubeMapArray::~LLCubeMapArray()  {  } @@ -115,6 +145,8 @@ void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count, bool us      mWidth = resolution;      mCount = count; +    mHDR = hdr; +      LLImageGL::generateTextures(1, &texname);      mImage = new LLImageGL(resolution, resolution, components, use_mips); diff --git a/indra/llrender/llcubemaparray.h b/indra/llrender/llcubemaparray.h index bfc72a321d..6b4288cb23 100644 --- a/indra/llrender/llcubemaparray.h +++ b/indra/llrender/llcubemaparray.h @@ -36,6 +36,7 @@ class LLCubeMapArray : public LLRefCount  {  public:      LLCubeMapArray(); +    LLCubeMapArray(LLCubeMapArray& lhs, U32 width, U32 count);      static GLenum sTargets[6]; @@ -73,4 +74,5 @@ protected:      U32 mWidth = 0;      U32 mCount = 0;      S32 mTextureStage; +    bool mHDR;  }; diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 7749f03d38..c97e014e46 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -280,6 +280,10 @@ void callResetKeys()  bool callUnicodeCallback(wchar_t character, unsigned int mask)  { +    if (!gWindowImplementation) +    { +        return false; +    }      NativeKeyEventData eventData;      memset(&eventData, 0, sizeof(NativeKeyEventData)); @@ -301,7 +305,7 @@ bool callUnicodeCallback(wchar_t character, unsigned int mask)  void callFocus()  { -    if (gWindowImplementation) +    if (gWindowImplementation && gWindowImplementation->getCallbacks())      {          gWindowImplementation->getCallbacks()->handleFocus(gWindowImplementation);      } @@ -309,7 +313,7 @@ void callFocus()  void callFocusLost()  { -    if (gWindowImplementation) +    if (gWindowImplementation && gWindowImplementation->getCallbacks())      {          gWindowImplementation->getCallbacks()->handleFocusLost(gWindowImplementation);      } @@ -317,6 +321,10 @@ void callFocusLost()  void callRightMouseDown(float *pos, MASK mask)  { +    if (!gWindowImplementation) +    { +        return; +    }      if (gWindowImplementation->allowsLanguageInput())      {          gWindowImplementation->interruptLanguageTextInput(); @@ -330,6 +338,10 @@ void callRightMouseDown(float *pos, MASK mask)  void callRightMouseUp(float *pos, MASK mask)  { +    if (!gWindowImplementation) +    { +        return; +    }      if (gWindowImplementation->allowsLanguageInput())      {          gWindowImplementation->interruptLanguageTextInput(); @@ -343,6 +355,10 @@ void callRightMouseUp(float *pos, MASK mask)  void callLeftMouseDown(float *pos, MASK mask)  { +    if (!gWindowImplementation) +    { +        return; +    }      if (gWindowImplementation->allowsLanguageInput())      {          gWindowImplementation->interruptLanguageTextInput(); @@ -356,6 +372,10 @@ void callLeftMouseDown(float *pos, MASK mask)  void callLeftMouseUp(float *pos, MASK mask)  { +    if (!gWindowImplementation) +    { +        return; +    }      if (gWindowImplementation->allowsLanguageInput())      {          gWindowImplementation->interruptLanguageTextInput(); @@ -370,6 +390,10 @@ void callLeftMouseUp(float *pos, MASK mask)  void callDoubleClick(float *pos, MASK mask)  { +    if (!gWindowImplementation) +    { +        return; +    }      if (gWindowImplementation->allowsLanguageInput())      {          gWindowImplementation->interruptLanguageTextInput(); @@ -383,7 +407,7 @@ void callDoubleClick(float *pos, MASK mask)  void callResize(unsigned int width, unsigned int height)  { -    if (gWindowImplementation != NULL) +    if (gWindowImplementation && gWindowImplementation->getCallbacks())      {          gWindowImplementation->getCallbacks()->handleResize(gWindowImplementation, width, height);      } @@ -391,6 +415,10 @@ void callResize(unsigned int width, unsigned int height)  void callMouseMoved(float *pos, MASK mask)  { +    if (!gWindowImplementation) +    { +        return; +    }      LLCoordGL       outCoords;      outCoords.mX = ll_round(pos[0]);      outCoords.mY = ll_round(pos[1]); @@ -404,6 +432,10 @@ void callMouseMoved(float *pos, MASK mask)  void callMouseDragged(float *pos, MASK mask)  { +    if (!gWindowImplementation) +    { +        return; +    }      LLCoordGL       outCoords;      outCoords.mX = ll_round(pos[0]);      outCoords.mY = ll_round(pos[1]); @@ -425,6 +457,10 @@ void callScrollMoved(float deltaX, float deltaY)  void callMouseExit()  { +    if (!gWindowImplementation) +    { +        return; +    }      gWindowImplementation->getCallbacks()->handleMouseLeave(gWindowImplementation);  } @@ -476,11 +512,19 @@ void callWindowDidChangeScreen()  void callDeltaUpdate(float *delta, MASK mask)  { +    if (!gWindowImplementation) +    { +        return; +    }      gWindowImplementation->updateMouseDeltas(delta);  }  void callOtherMouseDown(float *pos, MASK mask, int button)  { +    if (!gWindowImplementation) +    { +        return; +    }      LLCoordGL       outCoords;      outCoords.mX = ll_round(pos[0]);      outCoords.mY = ll_round(pos[1]); @@ -501,6 +545,10 @@ void callOtherMouseDown(float *pos, MASK mask, int button)  void callOtherMouseUp(float *pos, MASK mask, int button)  { +    if (!gWindowImplementation) +    { +        return; +    }      LLCoordGL outCoords;      outCoords.mX = ll_round(pos[0]);      outCoords.mY = ll_round(pos[1]); @@ -525,27 +573,43 @@ void callModifier(MASK mask)  void callHandleDragEntered(std::string url)  { +    if (!gWindowImplementation) +    { +        return; +    }      gWindowImplementation->handleDragNDrop(url, LLWindowCallbacks::DNDA_START_TRACKING);  }  void callHandleDragExited(std::string url)  { +    if (!gWindowImplementation) +    { +        return; +    }      gWindowImplementation->handleDragNDrop(url, LLWindowCallbacks::DNDA_STOP_TRACKING);  }  void callHandleDragUpdated(std::string url)  { +    if (!gWindowImplementation) +    { +        return; +    }      gWindowImplementation->handleDragNDrop(url, LLWindowCallbacks::DNDA_TRACK);  }  void callHandleDragDropped(std::string url)  { +    if (!gWindowImplementation) +    { +        return; +    }      gWindowImplementation->handleDragNDrop(url, LLWindowCallbacks::DNDA_DROPPED);  }  void callQuitHandler()  { -    if (gWindowImplementation) +    if (gWindowImplementation && gWindowImplementation->getCallbacks())      {          if(gWindowImplementation->getCallbacks()->handleCloseRequest(gWindowImplementation))          { @@ -556,7 +620,7 @@ void callQuitHandler()  void getPreeditSelectionRange(int *position, int *length)  { -    if (gWindowImplementation->getPreeditor()) +    if (gWindowImplementation && gWindowImplementation->getPreeditor())      {          gWindowImplementation->getPreeditor()->getSelectionRange(position, length);      } @@ -564,7 +628,7 @@ void getPreeditSelectionRange(int *position, int *length)  void getPreeditMarkedRange(int *position, int *length)  { -    if (gWindowImplementation->getPreeditor()) +    if (gWindowImplementation && gWindowImplementation->getPreeditor())      {          gWindowImplementation->getPreeditor()->getPreeditRange(position, length);      } @@ -572,7 +636,7 @@ void getPreeditMarkedRange(int *position, int *length)  void setPreeditMarkedRange(int position, int length)  { -    if (gWindowImplementation->getPreeditor()) +    if (gWindowImplementation && gWindowImplementation->getPreeditor())      {          gWindowImplementation->getPreeditor()->markAsPreedit(position, length);      } @@ -581,7 +645,7 @@ void setPreeditMarkedRange(int position, int length)  bool handleUnicodeCharacter(wchar_t c)  {      bool success = false; -    if (gWindowImplementation->getPreeditor()) +    if (gWindowImplementation && gWindowImplementation->getPreeditor())      {          success = gWindowImplementation->getPreeditor()->handleUnicodeCharHere(c);      } @@ -591,7 +655,7 @@ bool handleUnicodeCharacter(wchar_t c)  void resetPreedit()  { -    if (gWindowImplementation->getPreeditor()) +    if (gWindowImplementation && gWindowImplementation->getPreeditor())      {          gWindowImplementation->getPreeditor()->resetPreedit();      } @@ -601,7 +665,7 @@ void resetPreedit()  // This largely mirrors the old implementation, only sans the carbon parameters.  void setMarkedText(unsigned short *unitext, unsigned int *selectedRange, unsigned int *replacementRange, long text_len, attributedStringInfo segments)  { -    if (gWindowImplementation->getPreeditor()) +    if (gWindowImplementation && gWindowImplementation->getPreeditor())      {          LLPreeditor *preeditor = gWindowImplementation->getPreeditor();          preeditor->resetPreedit(); @@ -624,7 +688,7 @@ void setMarkedText(unsigned short *unitext, unsigned int *selectedRange, unsigne  void getPreeditLocation(float *location, unsigned int length)  { -    if (gWindowImplementation->getPreeditor()) +    if (gWindowImplementation && gWindowImplementation->getPreeditor())      {          LLPreeditor *preeditor = gWindowImplementation->getPreeditor();          LLCoordGL coord; diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 5eeca51212..9388d55c27 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9153,6 +9153,17 @@      <key>Value</key>      <integer>1</integer>    </map> +    <key>RenderReflectionProbeDynamicAllocation</key> +    <map> +        <key>Comment</key> +        <string>Enable dynamic allocation of reflection probes. -1 means no dynamic allocation. Sets a buffer to allocate when a dynamic allocation occurs otherwise.</string> +        <key>Persist</key> +        <integer>1</integer> +        <key>Type</key> +        <string>S32</string> +        <key>Value</key> +        <integer>-1</integer> +    </map>      <key>RenderReflectionProbeCount</key>      <map>          <key>Comment</key> diff --git a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl index 8c3851fdbb..366335b4f6 100644 --- a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl @@ -26,6 +26,7 @@  // class3/environment/waterF.glsl  #define WATER_MINIMAL 1 +#define SHORELINE_FADE 1  out vec4 frag_color; @@ -266,7 +267,7 @@ void main()      // Calculate some distance fade in the water to better assist with refraction blending and reducing the refraction texture's "disconnect".  #ifdef SHORELINE_FADE -    fade = max(0.0,min(1.0, (pos.z - refPos.z) / 10.0)) +    fade = max(0.0,min(1.0, (pos.z - refPos.z) / 10.0));  #else      fade = 1.0 * water_mask;  #endif diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index 443a7ae914..c0009d24ee 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -86,6 +86,7 @@ RenderTonemapType			1   1  RenderTonemapMix			1   1  RenderDisableVintageMode           1   1  RenderMaxTextureResolution         1   2048 +RenderReflectionProbeCount  1   256  //  // Low Graphics Settings @@ -128,6 +129,7 @@ RenderTonemapType			1   1  RenderTonemapMix			1   0.7  RenderDisableVintageMode           1   0  RenderMaxTextureResolution         1   512 +RenderReflectionProbeCount  1   1  //  // Medium Low Graphics Settings @@ -170,6 +172,7 @@ RenderTonemapType			1   1  RenderTonemapMix			1   0.7  RenderDisableVintageMode           1   0  RenderMaxTextureResolution         1   1024 +RenderReflectionProbeCount  1   32  //  // Medium Graphics Settings (standard) @@ -211,6 +214,7 @@ RenderExposure				1   1  RenderTonemapType			1   1  RenderTonemapMix			1   0.7  RenderMaxTextureResolution  1   2048 +RenderReflectionProbeCount  1   64  //  // Medium High Graphics Settings @@ -252,6 +256,7 @@ RenderExposure				1   1  RenderTonemapType			1   1  RenderTonemapMix			1   0.7  RenderMaxTextureResolution  1   2048 +RenderReflectionProbeCount  1   64  //  // High Graphics Settings (SSAO + sun shadows) @@ -293,6 +298,7 @@ RenderExposure				1   1  RenderTonemapType			1   1  RenderTonemapMix			1   0.7  RenderMaxTextureResolution  1   2048 +RenderReflectionProbeCount  1   128  //  // High Ultra Graphics Settings (deferred + SSAO + all shadows) @@ -334,6 +340,7 @@ RenderExposure				1   1  RenderTonemapType			1   1  RenderTonemapMix			1   0.7  RenderMaxTextureResolution  1   2048 +RenderReflectionProbeCount  1   256  //  // Ultra graphics (REALLY PURTY!) @@ -375,6 +382,7 @@ RenderExposure				1   1  RenderTonemapType			1   1  RenderTonemapMix			1   0.7  RenderMaxTextureResolution  1   2048 +RenderReflectionProbeCount  1   256  //  // Class Unknown Hardware (unknown) @@ -408,6 +416,7 @@ RenderReflectionProbeDetail	0	-1  RenderMirrors				0	0  RenderDisableVintageMode           1   0  RenderMaxTextureResolution         1   2048 +RenderReflectionProbeCount  0   0  list Intel  RenderAnisotropic			1	0 @@ -429,6 +438,7 @@ RenderMirrors				0	0  RenderGLMultiThreadedTextures 0 0  RenderGLMultiThreadedMedia 0 0  RenderDisableVintageMode           1   0 +RenderReflectionProbeCount  0   0  list TexUnit16orLess  RenderTerrainPBRDetail      1   -1 diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index f3c3c4fcd9..01407d5ffd 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -86,6 +86,7 @@ RenderTonemapMix			1   1  RenderDisableVintageMode           1   1  RenderDownScaleMethod       1   0  RenderMaxTextureResolution         1   2048 +RenderReflectionProbeCount  1   256  //  // Low Graphics Settings @@ -128,6 +129,7 @@ RenderTonemapType			1   1  RenderTonemapMix			1   0.7  RenderDisableVintageMode           1   0  RenderMaxTextureResolution         1   512 +RenderReflectionProbeCount  1   1  // @@ -171,6 +173,7 @@ RenderTonemapType			1   1  RenderTonemapMix			1   0.7  RenderDisableVintageMode           1   0  RenderMaxTextureResolution         1   1024 +RenderReflectionProbeCount  1   32  //  // Medium Graphics Settings (standard) @@ -212,6 +215,7 @@ RenderExposure				1   1  RenderTonemapType			1   1  RenderTonemapMix			1   0.7  RenderMaxTextureResolution  1   2048 +RenderReflectionProbeCount  1   64  //  // Medium High Graphics Settings @@ -253,6 +257,7 @@ RenderExposure				1   1  RenderTonemapType			1   1  RenderTonemapMix			1   0.7  RenderMaxTextureResolution  1   2048 +RenderReflectionProbeCount  1   64  //  // High Graphics Settings (SSAO + sun shadows) @@ -294,6 +299,7 @@ RenderExposure				1   1  RenderTonemapType			1   1  RenderTonemapMix			1   0.7  RenderMaxTextureResolution  1   2048 +RenderReflectionProbeCount  1   128  //  // High Ultra Graphics Settings (SSAO + all shadows) @@ -335,6 +341,7 @@ RenderExposure				1   1  RenderTonemapType			1   1  RenderTonemapMix			1   0.7  RenderMaxTextureResolution  1   2048 +RenderReflectionProbeCount  1   256  //  // Ultra graphics (REALLY PURTY!) @@ -376,6 +383,7 @@ RenderExposure				1   1  RenderTonemapType			1   1  RenderTonemapMix			1   0.7  RenderMaxTextureResolution  1   2048 +RenderReflectionProbeCount  1   256  //  // Class Unknown Hardware (unknown) @@ -408,6 +416,7 @@ RenderShadowDetail			0	0  RenderMirrors				0	0  RenderDisableVintageMode           1   0  RenderMaxTextureResolution         1   2048 +RenderReflectionProbeCount  0   0  list TexUnit8orLess  RenderDeferredSSAO			0	0 @@ -448,6 +457,7 @@ RenderReflectionProbeDetail	0	0  RenderReflectionsEnabled    0   0  RenderMirrors				0	0  RenderDisableVintageMode           1   0 +RenderReflectionProbeCount  0   0  list VaryingVectors16orLess  RenderTerrainPBRPlanarSampleCount 1   1 diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 6e2f4ef670..169fea320a 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -155,10 +155,10 @@ namespace              sBugSplatSender->setAttribute(WCSTR(L"OS"), WCSTR(LLOSInfo::instance().getOSStringSimple())); // In case we ever stop using email for this              sBugSplatSender->setAttribute(WCSTR(L"AppState"), WCSTR(LLStartUp::getStartupStateString())); -            sBugSplatSender->setAttribute(WCSTR(L"GL Vendor"), WCSTR(gGLManager.mGLVendor)); -            sBugSplatSender->setAttribute(WCSTR(L"GL Version"), WCSTR(gGLManager.mGLVersionString)); -            sBugSplatSender->setAttribute(WCSTR(L"GPU Version"), WCSTR(gGLManager.mDriverVersionVendorString)); -            sBugSplatSender->setAttribute(WCSTR(L"GL Renderer"), WCSTR(gGLManager.mGLRenderer)); +            sBugSplatSender->setAttribute(WCSTR(L"GLVendor"), WCSTR(gGLManager.mGLVendor)); +            sBugSplatSender->setAttribute(WCSTR(L"GLVersion"), WCSTR(gGLManager.mGLVersionString)); +            sBugSplatSender->setAttribute(WCSTR(L"GPUVersion"), WCSTR(gGLManager.mDriverVersionVendorString)); +            sBugSplatSender->setAttribute(WCSTR(L"GLRenderer"), WCSTR(gGLManager.mGLRenderer));              sBugSplatSender->setAttribute(WCSTR(L"VRAM"), WCSTR(STRINGIZE(gGLManager.mVRAM)));              sBugSplatSender->setAttribute(WCSTR(L"RAM"), WCSTR(STRINGIZE(gSysMemory.getPhysicalMemoryKB().value()))); diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 85f902db8d..fb4db9a216 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -2221,7 +2221,7 @@ bool LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius)      {          LL_PROFILE_ZONE_NAMED_CATEGORY_FACE("calcPixelArea - rigged");          //override with joint volume face joint bounding boxes -        LLVOAvatar* avatar = mVObjp->getAvatar(); +        LLVOAvatar* avatar = mVObjp.notNull() ? mVObjp->getAvatar() : nullptr;          bool hasRiggedExtents = false;          if (avatar && avatar->mDrawable) diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 47f02ebc70..4ada9c445c 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -3075,10 +3075,7 @@ void LLPanelFace::onCommitHideWater()      }      else      { -        // reset texture to default plywood -        LLSelectMgr::getInstance()->selectionSetImage(DEFAULT_OBJECT_TEXTURE); -        // reset texture repeats, that might be altered by invisiprim script from wiki -        LLSelectMgr::getInstance()->selectionTexScaleAutofit(2.f); +        LLSelectMgr::getInstance()->clearWaterExclusion();      }  } diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index 9c95dc8e4b..fae6acec3c 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -224,48 +224,54 @@ void LLReflectionMapManager::update()      static LLCachedControl<S32> sDetail(gSavedSettings, "RenderReflectionProbeDetail", -1);      static LLCachedControl<S32> sLevel(gSavedSettings, "RenderReflectionProbeLevel", 3); +    static LLCachedControl<U32> sReflectionProbeCount(gSavedSettings, "RenderReflectionProbeCount", 256U); +    static LLCachedControl<S32> sProbeDynamicAllocation(gSavedSettings, "RenderReflectionProbeDynamicAllocation", -1); +    mResetFade = llmin((F32)(mResetFade + gFrameIntervalSeconds * 2.f), 1.f); -    // Once every 20 frames, update the dynamic probe count. -    if (gFrameCount % 20)      {          U32 probe_count_temp = mDynamicProbeCount; -        if (sLevel == 0) -        { -            mDynamicProbeCount = 1; -        } -        else if (sLevel == 1) +        if (sProbeDynamicAllocation > -1)          { -            mDynamicProbeCount = (U32)mProbes.size(); +            if (sLevel == 0) +            { +                mDynamicProbeCount = 1; +            } +            else if (sLevel == 1) +            { +                mDynamicProbeCount = (U32)mProbes.size(); +            } +            else if (sLevel == 2) +            { +                mDynamicProbeCount = llmax((U32)mProbes.size(), 128); +            } +            else +            { +                mDynamicProbeCount = 256; +            } -        } -        else if (sLevel == 2) -        { -            mDynamicProbeCount = llmax((U32)mProbes.size(), 128); +            if (sProbeDynamicAllocation > 1) +            { +                // Round mDynamicProbeCount to the nearest increment of 16 +                mDynamicProbeCount = ((mDynamicProbeCount + sProbeDynamicAllocation / 2) / sProbeDynamicAllocation) * 16; +                mDynamicProbeCount = llclamp(mDynamicProbeCount, 1, sReflectionProbeCount); +            } +            else +            { +                mDynamicProbeCount = llclamp(mDynamicProbeCount + sProbeDynamicAllocation, 1, sReflectionProbeCount); +            }          }          else          { -            mDynamicProbeCount = 256; +            mDynamicProbeCount = sReflectionProbeCount;          } -        // Round mDynamicProbeCount to the nearest increment of 32 -        mDynamicProbeCount = ((mDynamicProbeCount + 16) / 32) * 32; -        mDynamicProbeCount = llclamp(mDynamicProbeCount, 1, LL_MAX_REFLECTION_PROBE_COUNT); +        mDynamicProbeCount = llmin(mDynamicProbeCount, LL_MAX_REFLECTION_PROBE_COUNT); -        if (mDynamicProbeCount < probe_count_temp * 1.1 && mDynamicProbeCount > probe_count_temp * 0.9) -            mDynamicProbeCount = probe_count_temp; -        else -            mGlobalFadeTarget = 0.f; +        if (mDynamicProbeCount != probe_count_temp) +            mResetFade = 1.f;      } -    if (mGlobalFadeTarget < mResetFade) -        mResetFade = llmax(mGlobalFadeTarget, mResetFade - (F32)gFrameIntervalSeconds * 2); -    else -        mResetFade = llmin(mGlobalFadeTarget, mResetFade + (F32)gFrameIntervalSeconds * 2); - -    if (mResetFade == mGlobalFadeTarget) -    { -        initReflectionMaps(); -    } +    initReflectionMaps();      static LLCachedControl<bool> render_hdr(gSavedSettings, "RenderHDREnabled", true); @@ -356,6 +362,7 @@ void LLReflectionMapManager::update()              probe->mCubeArray = nullptr;              probe->mCubeIndex = -1;              probe->mComplete = false; +            probe->mFadeIn = 0;          }      } @@ -1428,8 +1435,6 @@ void LLReflectionMapManager::initReflectionMaps()          }          gEXRImage = nullptr; -        mGlobalFadeTarget = 1.f; -        mResetFade = -0.125f;          mReset = false;          mReflectionProbeCount = mDynamicProbeCount;          mProbeResolution = probe_resolution; @@ -1439,15 +1444,25 @@ void LLReflectionMapManager::initReflectionMaps()              mTexture->getWidth() != mProbeResolution ||              mReflectionProbeCount + 2 != mTexture->getCount())          { -            mTexture = new LLCubeMapArray(); +            if (mTexture) +            { +                mTexture = new LLCubeMapArray(*mTexture, mProbeResolution, mReflectionProbeCount + 2); -            static LLCachedControl<bool> render_hdr(gSavedSettings, "RenderHDREnabled", true); +                mIrradianceMaps = new LLCubeMapArray(*mIrradianceMaps, LL_IRRADIANCE_MAP_RESOLUTION, mReflectionProbeCount); +            } +            else +            { +                mTexture = new LLCubeMapArray(); + +                static LLCachedControl<bool> render_hdr(gSavedSettings, "RenderHDREnabled", true); -            // store mReflectionProbeCount+2 cube maps, final two cube maps are used for render target and radiance map generation source) -            mTexture->allocate(mProbeResolution, 3, mReflectionProbeCount + 2, true, render_hdr); +                // store mReflectionProbeCount+2 cube maps, final two cube maps are used for render target and radiance map generation +                // source) +                mTexture->allocate(mProbeResolution, 3, mReflectionProbeCount + 2, true, render_hdr); -            mIrradianceMaps = new LLCubeMapArray(); -            mIrradianceMaps->allocate(LL_IRRADIANCE_MAP_RESOLUTION, 3, mReflectionProbeCount, false, render_hdr); +                mIrradianceMaps = new LLCubeMapArray(); +                mIrradianceMaps->allocate(LL_IRRADIANCE_MAP_RESOLUTION, 3, mReflectionProbeCount, false, render_hdr); +            }          }          // reset probe state @@ -1467,6 +1482,7 @@ void LLReflectionMapManager::initReflectionMaps()              probe->mCubeArray = nullptr;              probe->mCubeIndex = -1;              probe->mNeighbors.clear(); +            probe->mFadeIn = 0;          }          mCubeFree.clear(); diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 01eb76c1a3..6ef202cf28 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -1995,7 +1995,7 @@ bool LLSelectMgr::selectionSetGLTFMaterial(const LLUUID& mat_id)                      asset_id = BLANK_MATERIAL_ASSET_ID;                  }              } - +            objectp->clearTEWaterExclusion(te);              // Blank out most override data on the object and send to server              objectp->setRenderMaterialID(te, asset_id); @@ -2477,6 +2477,7 @@ void LLSelectMgr::selectionSetMedia(U8 media_type, const LLSD &media_data)                      }                      else {                          // Add/update media +                        object->clearTEWaterExclusion(te);                          object->setTEMediaFlags(te, mMediaFlags);                          LLVOVolume *vo = dynamic_cast<LLVOVolume*>(object);                          llassert(NULL != vo); @@ -7728,6 +7729,14 @@ void LLSelectMgr::setAgentHUDZoom(F32 target_zoom, F32 current_zoom)      gAgentCamera.mHUDCurZoom = current_zoom;  } +void LLSelectMgr::clearWaterExclusion() +{ +    // reset texture to default plywood +    LLSelectMgr::getInstance()->selectionSetImage(DEFAULT_OBJECT_TEXTURE); +    // reset texture repeats, that might be altered by invisiprim script from wiki +    LLSelectMgr::getInstance()->selectionTexScaleAutofit(2.f); +} +  /////////////////////////////////////////////////////////////////////////////  // Object selection iterator helpers  ///////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index b70ec3dbea..0dbdc133e3 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -836,6 +836,7 @@ public:      void getAgentHUDZoom(F32 &target_zoom, F32 ¤t_zoom) const;      void updatePointAt(); +    void clearWaterExclusion();      // Internal list maintenance functions. TODO: Make these private!      void remove(std::vector<LLViewerObject*>& objects); diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp index 5ab9f76e47..255cfc998a 100644 --- a/indra/newview/llviewerassetstorage.cpp +++ b/indra/newview/llviewerassetstorage.cpp @@ -402,10 +402,10 @@ void LLViewerAssetStorage::queueRequestHttp(          manager->enqueueCoprocedure(              VIEWER_ASSET_STORAGE_CORO_POOL,              "LLViewerAssetStorage::assetRequestCoro", -            [this, req, uuid, atype, callback, user_data] +            [this, uuid, atype, callback, user_data]              (LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t&, const LLUUID&)              { -                assetRequestCoro(req, uuid, atype, callback, user_data); +                assetRequestCoro(uuid, atype, callback, user_data);              });      }  } @@ -440,7 +440,6 @@ struct LLScopedIncrement  };  void LLViewerAssetStorage::assetRequestCoro( -    LLViewerAssetRequest *req,      const LLUUID uuid,      LLAssetType::EType atype,      LLGetAssetCallback callback, @@ -464,7 +463,7 @@ void LLViewerAssetStorage::assetRequestCoro(          LL_WARNS_ONCE("ViewerAsset") << "Asset request fails: no region set" << LL_ENDL;          result_code = LL_ERR_ASSET_REQUEST_FAILED;          ext_status = LLExtStat::NONE; -        removeAndCallbackPendingDownloads(uuid, atype, uuid, atype, result_code, ext_status); +        removeAndCallbackPendingDownloads(uuid, atype, uuid, atype, result_code, ext_status, 0);          return;      }      else if (!gAgent.getRegion()->capabilitiesReceived()) @@ -495,7 +494,7 @@ void LLViewerAssetStorage::assetRequestCoro(          LL_WARNS_ONCE("ViewerAsset") << "asset request fails: caps received but no viewer asset cap found" << LL_ENDL;          result_code = LL_ERR_ASSET_REQUEST_FAILED;          ext_status = LLExtStat::NONE; -        removeAndCallbackPendingDownloads(uuid, atype, uuid, atype, result_code, ext_status); +        removeAndCallbackPendingDownloads(uuid, atype, uuid, atype, result_code, ext_status, 0);          return;      }      std::string url = getAssetURL(mViewerAssetUrl, uuid,atype); @@ -517,6 +516,7 @@ void LLViewerAssetStorage::assetRequestCoro(      mCountCompleted++; +    S32 bytes_fetched = 0;      LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];      LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);      if (!status) @@ -554,7 +554,7 @@ void LLViewerAssetStorage::assetRequestCoro(              LLUUID temp_id;              temp_id.generate();              LLFileSystem vf(temp_id, atype, LLFileSystem::WRITE); -            req->mBytesFetched = size; +            bytes_fetched = size;              if (!vf.write(raw.data(),size))              {                  // TODO asset-http: handle error @@ -583,7 +583,7 @@ void LLViewerAssetStorage::assetRequestCoro(      }      // Clean up pending downloads and trigger callbacks -    removeAndCallbackPendingDownloads(uuid, atype, uuid, atype, result_code, ext_status); +    removeAndCallbackPendingDownloads(uuid, atype, uuid, atype, result_code, ext_status, bytes_fetched);  }  std::string LLViewerAssetStorage::getAssetURL(const std::string& cap_url, const LLUUID& uuid, LLAssetType::EType atype) diff --git a/indra/newview/llviewerassetstorage.h b/indra/newview/llviewerassetstorage.h index fdb8af7457..42dd9d1dd8 100644 --- a/indra/newview/llviewerassetstorage.h +++ b/indra/newview/llviewerassetstorage.h @@ -82,8 +82,7 @@ protected:      void capsRecvForRegion(const LLUUID& region_id, std::string pumpname); -    void assetRequestCoro(LLViewerAssetRequest *req, -                          const LLUUID uuid, +    void assetRequestCoro(const LLUUID uuid,                            LLAssetType::EType atype,                            LLGetAssetCallback callback,                            void *user_data); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 3d88cc5f39..c5e81dd179 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -7682,6 +7682,31 @@ void LLViewerObject::setGLTFAsset(const LLUUID& id)      updateVolume(volume_params);  } +void LLViewerObject::clearTEWaterExclusion(const U8 te) +{ +    if (permModify()) +    { +        LLViewerTexture* image = getTEImage(te); +        if (image && (IMG_ALPHA_GRAD == image->getID())) +        { +            // reset texture to default plywood +            setTEImage(te, LLViewerTextureManager::getFetchedTexture(DEFAULT_OBJECT_TEXTURE, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); + +            // reset texture repeats, that might be altered by invisiprim script from wiki +            U32 s_axis, t_axis; +            if (!LLPrimitive::getTESTAxes(te, &s_axis, &t_axis)) +            { +                return; +            } +            F32 DEFAULT_REPEATS = 2.f; +            F32 new_s = getScale().mV[s_axis] * DEFAULT_REPEATS; +            F32 new_t = getScale().mV[t_axis] * DEFAULT_REPEATS; + +            setTEScale(te, new_s, new_t); +            sendTEUpdate(); +        } +    } +}  class ObjectPhysicsProperties : public LLHTTPNode  { diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 63458e60ea..2b52ea2076 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -405,6 +405,8 @@ public:      LLViewerTexture     *getTENormalMap(const U8 te) const;      LLViewerTexture     *getTESpecularMap(const U8 te) const; +    void clearTEWaterExclusion(const U8 te); +      bool                        isImageAlphaBlended(const U8 te) const;      void fitFaceTexture(const U8 face); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index e560968119..9214350aad 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1450,10 +1450,13 @@ void LLViewerWindow::handleMouseLeave(LLWindow *window)  bool LLViewerWindow::handleCloseRequest(LLWindow *window)  { -    // User has indicated they want to close, but we may need to ask -    // about modified documents. -    LLAppViewer::instance()->userQuit(); -    // Don't quit immediately +    if (!LLApp::isExiting()) +    { +        // User has indicated they want to close, but we may need to ask +        // about modified documents. +        LLAppViewer::instance()->userQuit(); +        // Don't quit immediately +    }      return false;  } diff --git a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml index 9db5502387..d6cb3928cc 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml @@ -858,6 +858,51 @@        value="3"/>    </combo_box> +    <text +      type="string" +      length="1" +      follows="left|top" +      height="16" +      layout="topleft" +      left="420" +      name="ReflectionProbeCount" +      text_readonly_color="LabelDisabledColor" +      top_delta="22" +      width="128"> +        Max Reflection Probes: +    </text> + +    <combo_box +     control_name="RenderReflectionProbeCount" +     height="18" +     layout="topleft" +     label="Max. Reflection Probes:" +     left_delta="130" +     top_delta="0" +     name="ProbeCount" +     width="150"> +        <combo_box.item +          label="None" +          name="1" +          value="1"/> +        <combo_box.item +          label="Low" +          name="32" +          value="32"/> +        <combo_box.item +          label="Medium" +          name="64" +          value="64"/> +        <combo_box.item +          label="High" +          name="128" +          value="128"/> +        <combo_box.item +          label="Ultra" +          name="256" +          value="256"/> +    </combo_box> +    <slider      control_name="RenderExposure"      decimal_digits="1" | 
