From b391e7f93f008b6f3c30c9bfb9ac0cd93de1a6c2 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 22 Apr 2021 00:28:45 +0300 Subject: SL-14977 Extended AltGr to cover oem symbols Typing '}' via 'altgr+=' into a script makes the viewer to derender particles --- indra/llwindow/llwindowwin32.h | 3 +++ indra/newview/llviewerwindow.cpp | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index ee0df570e9..dc576687e5 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -119,6 +119,9 @@ public: /*virtual*/ void* getDirectInput8(); /*virtual*/ bool getInputDevices(U32 device_type_filter, void * di8_devices_callback, void* userdata); + + U32 getRawWParam() { return mRawWParam; } + protected: LLWindowWin32(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags, diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 9c1aa772d8..2396f23e16 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -216,6 +216,7 @@ #if LL_WINDOWS #include // For Unicode conversion methods +#include "llwindowwin32.h" // For AltGr handling #endif // @@ -2766,9 +2767,11 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) // of character handling. // Alt Gr can be additionally modified by Shift const MASK alt_gr = MASK_CONTROL | MASK_ALT; + LLWindowWin32 *window = static_cast(mWindow); + U32 raw_key = window->getRawWParam(); if ((mask & alt_gr) != 0 - && key >= 0x30 - && key <= 0x5A + && ((raw_key >= 0x30 && raw_key <= 0x5A) //0-9, plus normal chartacters + || (raw_key >= 0xBA && raw_key <= 0xE4)) // Misc/OEM characters that can be covered by AltGr, ex: -, =, ~ && (GetKeyState(VK_RMENU) & 0x8000) != 0 && (GetKeyState(VK_RCONTROL) & 0x8000) == 0) // ensure right control is not pressed, only left one { -- cgit v1.2.3 From 8b3f4b56f93bfae8251e79c9210836437d2e945b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 26 Apr 2021 23:55:45 +0300 Subject: SL-14664 Increase range of supported cursors on prim's media --- indra/media_plugins/cef/media_plugin_cef.cpp | 77 ++++++++++++++++++++++++---- indra/newview/llviewermedia.cpp | 63 ++++++++++++++++++----- 2 files changed, 119 insertions(+), 21 deletions(-) diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 0bb62d79ff..6ac5ce6dd9 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -386,18 +386,77 @@ void MediaPluginCEF::onCursorChangedCallback(dullahan::ECursorType type) case dullahan::CT_POINTER: name = "arrow"; break; + case dullahan::CT_CROSS: + name = "cross"; + break; + case dullahan::CT_HAND: + name = "hand"; + break; case dullahan::CT_IBEAM: name = "ibeam"; break; - case dullahan::CT_NORTHSOUTHRESIZE: - name = "splitv"; - break; - case dullahan::CT_EASTWESTRESIZE: - name = "splith"; - break; - case dullahan::CT_HAND: - name = "hand"; - break; + case dullahan::CT_WAIT: + name = "wait"; + break; + //case dullahan::CT_HELP: + case dullahan::CT_ROWRESIZE: + case dullahan::CT_NORTHRESIZE: + case dullahan::CT_SOUTHRESIZE: + case dullahan::CT_NORTHSOUTHRESIZE: + name = "split_ns"; + break; + case dullahan::CT_COLUMNRESIZE: + case dullahan::CT_EASTRESIZE: + case dullahan::CT_WESTRESIZE: + case dullahan::CT_EASTWESTRESIZE: + name = "split_we"; + break; + case dullahan::CT_NORTHEASTRESIZE: + case dullahan::CT_SOUTHWESTRESIZE: + case dullahan::CT_NORTHEASTSOUTHWESTRESIZE: + name = "split_nesw"; + break; + case dullahan::CT_SOUTHEASTRESIZE: + case dullahan::CT_NORTHWESTRESIZE: + case dullahan::CT_NORTHWESTSOUTHEASTRESIZE: + name = "split_nwse"; + break; + //case dullahan::CT_MIDDLEPANNING: + //case dullahan::CT_EASTPANNING: + //case dullahan::CT_NORTHPANNING: + //case dullahan::CT_NORTHEASTPANNING: + //case dullahan::CT_NORTHWESTPANNING: + //case dullahan::CT_SOUTHPANNING: + //case dullahan::CT_SOUTHEASTPANNING: + //case dullahan::CT_SOUTHWESTPANNING: + //case dullahan::CT_WESTPANNING: + //case dullahan::CT_MOVE: + //case dullahan::CT_VERTICALTEXT: + //case dullahan::CT_CELL: + //case dullahan::CT_CONTEXTMENU: + //case dullahan::CT_ALIAS: + case dullahan::CT_PROGRESS: + name = "working"; + break; + case dullahan::CT_COPY: + name = "arrow_copy"; + break; + case dullahan::CT_NONE: + name = "cursor_no"; + break; + case dullahan::CT_NODROP: + case dullahan::CT_NOTALLOWED: + name = "cursor_no_locked"; + break; + case dullahan::CT_ZOOMIN: + case dullahan::CT_ZOOMOUT: + name = "tool_zoomin"; + break; + case dullahan::CT_GRAB: + name = "tool_grab"; + break; + //case dullahan::CT_GRABING: + //case dullahan::CT_CUSTOM: default: LL_WARNS() << "Unknown cursor ID: " << (int)type << LL_ENDL; diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 9ed2df2759..8cf9f4a85c 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -3194,18 +3194,57 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla std::string cursor = plugin->getCursorName(); - if(cursor == "arrow") - mLastSetCursor = UI_CURSOR_ARROW; - else if(cursor == "ibeam") - mLastSetCursor = UI_CURSOR_IBEAM; - else if(cursor == "splith") - mLastSetCursor = UI_CURSOR_SIZEWE; - else if(cursor == "splitv") - mLastSetCursor = UI_CURSOR_SIZENS; - else if(cursor == "hand") - mLastSetCursor = UI_CURSOR_HAND; - else // for anything else, default to the arrow - mLastSetCursor = UI_CURSOR_ARROW; + static const std::map cursor_name_to_enum + { + {std::string("arrow"), UI_CURSOR_ARROW}, + {std::string("wait"), UI_CURSOR_WAIT}, + {std::string("hand"), UI_CURSOR_HAND}, + {std::string("ibeam"), UI_CURSOR_IBEAM}, + {std::string("cross"), UI_CURSOR_CROSS}, + {std::string("split_nwse"), UI_CURSOR_SIZENWSE}, + {std::string("split_nesw"), UI_CURSOR_SIZENESW}, + {std::string("split_we"), UI_CURSOR_SIZEWE}, + {std::string("split_ns"), UI_CURSOR_SIZENS}, + {std::string("cursor_no"), UI_CURSOR_NO}, + {std::string("working"), UI_CURSOR_WORKING}, + {std::string("tool_grab"), UI_CURSOR_TOOLGRAB}, + {std::string("tool_land"), UI_CURSOR_TOOLLAND}, + {std::string("tool_focus"), UI_CURSOR_TOOLFOCUS}, + {std::string("tool_create"), UI_CURSOR_TOOLCREATE}, + {std::string("arrow_drag"), UI_CURSOR_ARROWDRAG}, + {std::string("arrow_copy"), UI_CURSOR_ARROWCOPY}, + {std::string("arrow_drag_multi"), UI_CURSOR_ARROWDRAGMULTI}, + {std::string("arrow_copy_multi"), UI_CURSOR_ARROWCOPYMULTI}, + {std::string("cursor_no_locked"), UI_CURSOR_NOLOCKED}, + {std::string("arrow_locked"), UI_CURSOR_ARROWLOCKED}, + {std::string("grab_locked"), UI_CURSOR_GRABLOCKED}, + {std::string("tool_translate"), UI_CURSOR_TOOLTRANSLATE}, + {std::string("tool_rotate"), UI_CURSOR_TOOLROTATE}, + {std::string("tool_scale"), UI_CURSOR_TOOLSCALE}, + {std::string("tool_camera"), UI_CURSOR_TOOLCAMERA}, + {std::string("tool_pan"), UI_CURSOR_TOOLPAN}, + {std::string("tool_zoomin"), UI_CURSOR_TOOLZOOMIN}, + {std::string("tool_pick_object3"), UI_CURSOR_TOOLPICKOBJECT3}, + {std::string("tool_play"), UI_CURSOR_TOOLPLAY}, + {std::string("tool_pause"), UI_CURSOR_TOOLPAUSE}, + {std::string("tool_media_open"), UI_CURSOR_TOOLMEDIAOPEN}, + {std::string("tool_pipette"), UI_CURSOR_PIPETTE}, + {std::string("tool_sit"), UI_CURSOR_TOOLSIT}, + {std::string("tool_buy"), UI_CURSOR_TOOLBUY}, + {std::string("tool_open"), UI_CURSOR_TOOLOPEN}, + {std::string("tool_pathfinding"), UI_CURSOR_TOOLPATHFINDING}, + }; + + std::map::const_iterator iter = cursor_name_to_enum.find(cursor); + if (iter != cursor_name_to_enum.end()) + { + mLastSetCursor = iter->second; + } + else + { + // for anything else, default to the arrow + mLastSetCursor = UI_CURSOR_ARROW; + } } break; -- cgit v1.2.3 From c0fafd7973e862a669985e451cfb35c0a42d8e1d Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 27 Apr 2021 19:46:34 +0300 Subject: SL-15079 Fix odd group chat messages For god mode isInGroup was returning 'true' regardles of session id being group or agent id --- indra/newview/llimview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 9afb6ca58b..768088f07f 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1698,7 +1698,7 @@ LLUUID LLIMMgr::computeSessionID( } } - if (gAgent.isInGroup(session_id) && (session_id != other_participant_id)) + if (gAgent.isInGroup(session_id, TRUE) && (session_id != other_participant_id)) { LL_WARNS() << "Group session id different from group id: IM type = " << dialog << ", session id = " << session_id << ", group id = " << other_participant_id << LL_ENDL; } -- cgit v1.2.3 From e5136cd19b38d45854d9fc69ca05b6a4c89b0394 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 27 Apr 2021 20:51:23 +0300 Subject: SL-14664 Added 'alias' --- indra/media_plugins/cef/media_plugin_cef.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 6ac5ce6dd9..7f3c159caa 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -434,7 +434,9 @@ void MediaPluginCEF::onCursorChangedCallback(dullahan::ECursorType type) //case dullahan::CT_VERTICALTEXT: //case dullahan::CT_CELL: //case dullahan::CT_CONTEXTMENU: - //case dullahan::CT_ALIAS: + case dullahan::CT_ALIAS: + name = "tool_media_open"; + break; case dullahan::CT_PROGRESS: name = "working"; break; -- cgit v1.2.3 From 5cde118ec848cc9053a3a502daeecb417c8cfc18 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 27 Apr 2021 22:52:00 +0300 Subject: SL-14664 Added zoomout and sizeall Remade code to use getCursorFromString --- indra/llwindow/llcursortypes.cpp | 2 + indra/llwindow/llcursortypes.h | 2 + indra/llwindow/llwindowmacosx.cpp | 2 + indra/llwindow/llwindowsdl.cpp | 2 + indra/llwindow/llwindowwin32.cpp | 6 ++- indra/media_plugins/cef/media_plugin_cef.cpp | 42 ++++++++-------- indra/newview/cursors_mac/UI_CURSOR_SIZEALL.tif | Bin 0 -> 624 bytes .../newview/cursors_mac/UI_CURSOR_TOOLZOOMOUT.tif | Bin 0 -> 576 bytes indra/newview/llviewermedia.cpp | 53 +-------------------- indra/newview/res-sdl/lltoolzoomout.BMP | Bin 2102 -> 630 bytes indra/newview/res-sdl/sizeall.BMP | Bin 0 -> 630 bytes indra/newview/res/lltoolzoomout.cur | Bin 326 -> 326 bytes 12 files changed, 36 insertions(+), 73 deletions(-) create mode 100644 indra/newview/cursors_mac/UI_CURSOR_SIZEALL.tif create mode 100644 indra/newview/cursors_mac/UI_CURSOR_TOOLZOOMOUT.tif create mode 100644 indra/newview/res-sdl/sizeall.BMP diff --git a/indra/llwindow/llcursortypes.cpp b/indra/llwindow/llcursortypes.cpp index ec60097195..3079cc2419 100644 --- a/indra/llwindow/llcursortypes.cpp +++ b/indra/llwindow/llcursortypes.cpp @@ -42,6 +42,7 @@ ECursorType getCursorFromString(const std::string& cursor_string) cursor_string_table["UI_CURSOR_SIZENESW"] = UI_CURSOR_SIZENESW; cursor_string_table["UI_CURSOR_SIZEWE"] = UI_CURSOR_SIZEWE; cursor_string_table["UI_CURSOR_SIZENS"] = UI_CURSOR_SIZENS; + cursor_string_table["UI_CURSOR_SIZEALL"] = UI_CURSOR_SIZEALL; cursor_string_table["UI_CURSOR_NO"] = UI_CURSOR_NO; cursor_string_table["UI_CURSOR_WORKING"] = UI_CURSOR_WORKING; cursor_string_table["UI_CURSOR_TOOLGRAB"] = UI_CURSOR_TOOLGRAB; @@ -61,6 +62,7 @@ ECursorType getCursorFromString(const std::string& cursor_string) cursor_string_table["UI_CURSOR_TOOLCAMERA"] = UI_CURSOR_TOOLCAMERA; cursor_string_table["UI_CURSOR_TOOLPAN"] = UI_CURSOR_TOOLPAN; cursor_string_table["UI_CURSOR_TOOLZOOMIN"] = UI_CURSOR_TOOLZOOMIN; + cursor_string_table["UI_CURSOR_TOOLZOOMOUT"] = UI_CURSOR_TOOLZOOMOUT; cursor_string_table["UI_CURSOR_TOOLPICKOBJECT3"] = UI_CURSOR_TOOLPICKOBJECT3; cursor_string_table["UI_CURSOR_TOOLPLAY"] = UI_CURSOR_TOOLPLAY; cursor_string_table["UI_CURSOR_TOOLPAUSE"] = UI_CURSOR_TOOLPAUSE; diff --git a/indra/llwindow/llcursortypes.h b/indra/llwindow/llcursortypes.h index cb6d6636a0..d03b18e275 100644 --- a/indra/llwindow/llcursortypes.h +++ b/indra/llwindow/llcursortypes.h @@ -38,6 +38,7 @@ enum ECursorType { UI_CURSOR_SIZENESW, UI_CURSOR_SIZEWE, UI_CURSOR_SIZENS, + UI_CURSOR_SIZEALL, UI_CURSOR_NO, UI_CURSOR_WORKING, UI_CURSOR_TOOLGRAB, @@ -57,6 +58,7 @@ enum ECursorType { UI_CURSOR_TOOLCAMERA, UI_CURSOR_TOOLPAN, UI_CURSOR_TOOLZOOMIN, + UI_CURSOR_TOOLZOOMOUT, UI_CURSOR_TOOLPICKOBJECT3, UI_CURSOR_TOOLPLAY, UI_CURSOR_TOOLPAUSE, diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 2604a23c85..e288ccb842 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1422,6 +1422,7 @@ const char* cursorIDToName(int id) case UI_CURSOR_SIZENESW: return "UI_CURSOR_SIZENESW"; case UI_CURSOR_SIZEWE: return "UI_CURSOR_SIZEWE"; case UI_CURSOR_SIZENS: return "UI_CURSOR_SIZENS"; + case UI_CURSOR_SIZEALL: return "UI_CURSOR_SIZEALL"; case UI_CURSOR_NO: return "UI_CURSOR_NO"; case UI_CURSOR_WORKING: return "UI_CURSOR_WORKING"; case UI_CURSOR_TOOLGRAB: return "UI_CURSOR_TOOLGRAB"; @@ -1441,6 +1442,7 @@ const char* cursorIDToName(int id) case UI_CURSOR_TOOLCAMERA: return "UI_CURSOR_TOOLCAMERA"; case UI_CURSOR_TOOLPAN: return "UI_CURSOR_TOOLPAN"; case UI_CURSOR_TOOLZOOMIN: return "UI_CURSOR_TOOLZOOMIN"; + case UI_CURSOR_TOOLZOOMOUT: return "UI_CURSOR_TOOLZOOMOUT"; case UI_CURSOR_TOOLPICKOBJECT3: return "UI_CURSOR_TOOLPICKOBJECT3"; case UI_CURSOR_TOOLPLAY: return "UI_CURSOR_TOOLPLAY"; case UI_CURSOR_TOOLPAUSE: return "UI_CURSOR_TOOLPAUSE"; diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index c20e639fc7..ef81c82685 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -2114,6 +2114,7 @@ void LLWindowSDL::initCursors() mSDLCursors[UI_CURSOR_SIZENESW] = makeSDLCursorFromBMP("sizenesw.BMP",17,17); mSDLCursors[UI_CURSOR_SIZEWE] = makeSDLCursorFromBMP("sizewe.BMP",16,14); mSDLCursors[UI_CURSOR_SIZENS] = makeSDLCursorFromBMP("sizens.BMP",17,16); + mSDLCursors[UI_CURSOR_SIZEALL] = makeSDLCursorFromBMP("sizeall.BMP", 17, 17); mSDLCursors[UI_CURSOR_NO] = makeSDLCursorFromBMP("llno.BMP",8,8); mSDLCursors[UI_CURSOR_WORKING] = makeSDLCursorFromBMP("working.BMP",12,15); mSDLCursors[UI_CURSOR_TOOLGRAB] = makeSDLCursorFromBMP("lltoolgrab.BMP",2,13); @@ -2133,6 +2134,7 @@ void LLWindowSDL::initCursors() mSDLCursors[UI_CURSOR_TOOLCAMERA] = makeSDLCursorFromBMP("lltoolcamera.BMP",7,5); mSDLCursors[UI_CURSOR_TOOLPAN] = makeSDLCursorFromBMP("lltoolpan.BMP",7,5); mSDLCursors[UI_CURSOR_TOOLZOOMIN] = makeSDLCursorFromBMP("lltoolzoomin.BMP",7,5); + mSDLCursors[UI_CURSOR_TOOLZOOMOUT] = makeSDLCursorFromBMP("lltoolzoomout.BMP", 7, 5); mSDLCursors[UI_CURSOR_TOOLPICKOBJECT3] = makeSDLCursorFromBMP("toolpickobject3.BMP",0,0); mSDLCursors[UI_CURSOR_TOOLPLAY] = makeSDLCursorFromBMP("toolplay.BMP",0,0); mSDLCursors[UI_CURSOR_TOOLPAUSE] = makeSDLCursorFromBMP("toolpause.BMP",0,0); diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index e8abb9f31a..38f537b251 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -1814,8 +1814,9 @@ void LLWindowWin32::initCursors() mCursor[ UI_CURSOR_CROSS ] = LoadCursor(NULL, IDC_CROSS); mCursor[ UI_CURSOR_SIZENWSE ] = LoadCursor(NULL, IDC_SIZENWSE); mCursor[ UI_CURSOR_SIZENESW ] = LoadCursor(NULL, IDC_SIZENESW); - mCursor[ UI_CURSOR_SIZEWE ] = LoadCursor(NULL, IDC_SIZEWE); - mCursor[ UI_CURSOR_SIZENS ] = LoadCursor(NULL, IDC_SIZENS); + mCursor[ UI_CURSOR_SIZEWE ] = LoadCursor(NULL, IDC_SIZEWE); + mCursor[ UI_CURSOR_SIZENS ] = LoadCursor(NULL, IDC_SIZENS); + mCursor[ UI_CURSOR_SIZEALL ] = LoadCursor(NULL, IDC_SIZEALL); mCursor[ UI_CURSOR_NO ] = LoadCursor(NULL, IDC_NO); mCursor[ UI_CURSOR_WORKING ] = LoadCursor(NULL, IDC_APPSTARTING); @@ -1837,6 +1838,7 @@ void LLWindowWin32::initCursors() mCursor[ UI_CURSOR_TOOLCAMERA ] = LoadCursor(module, TEXT("TOOLCAMERA")); mCursor[ UI_CURSOR_TOOLPAN ] = LoadCursor(module, TEXT("TOOLPAN")); mCursor[ UI_CURSOR_TOOLZOOMIN ] = LoadCursor(module, TEXT("TOOLZOOMIN")); + mCursor[ UI_CURSOR_TOOLZOOMOUT ] = LoadCursor(module, TEXT("TOOLZOOMOUT")); mCursor[ UI_CURSOR_TOOLPICKOBJECT3 ] = LoadCursor(module, TEXT("TOOLPICKOBJECT3")); mCursor[ UI_CURSOR_PIPETTE ] = LoadCursor(module, TEXT("TOOLPIPETTE")); mCursor[ UI_CURSOR_TOOLSIT ] = LoadCursor(module, TEXT("TOOLSIT")); diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 7f3c159caa..d5bfd7eda0 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -383,43 +383,46 @@ void MediaPluginCEF::onCursorChangedCallback(dullahan::ECursorType type) switch (type) { - case dullahan::CT_POINTER: - name = "arrow"; - break; + case dullahan::CT_POINTER: + name = "UI_CURSOR_ARROW"; + break; case dullahan::CT_CROSS: - name = "cross"; + name = "UI_CURSOR_CROSS"; break; case dullahan::CT_HAND: - name = "hand"; + name = "UI_CURSOR_HAND"; break; case dullahan::CT_IBEAM: - name = "ibeam"; + name = "UI_CURSOR_IBEAM"; break; case dullahan::CT_WAIT: - name = "wait"; + name = "UI_CURSOR_WAIT"; break; //case dullahan::CT_HELP: case dullahan::CT_ROWRESIZE: case dullahan::CT_NORTHRESIZE: case dullahan::CT_SOUTHRESIZE: case dullahan::CT_NORTHSOUTHRESIZE: - name = "split_ns"; + name = "UI_CURSOR_SIZENS"; break; case dullahan::CT_COLUMNRESIZE: case dullahan::CT_EASTRESIZE: case dullahan::CT_WESTRESIZE: case dullahan::CT_EASTWESTRESIZE: - name = "split_we"; + name = "UI_CURSOR_SIZEWE"; break; case dullahan::CT_NORTHEASTRESIZE: case dullahan::CT_SOUTHWESTRESIZE: case dullahan::CT_NORTHEASTSOUTHWESTRESIZE: - name = "split_nesw"; + name = "UI_CURSOR_SIZENESW"; break; case dullahan::CT_SOUTHEASTRESIZE: case dullahan::CT_NORTHWESTRESIZE: case dullahan::CT_NORTHWESTSOUTHEASTRESIZE: - name = "split_nwse"; + name = "UI_CURSOR_SIZENWSE"; + break; + case dullahan::CT_MOVE: + name = "UI_CURSOR_SIZEALL"; break; //case dullahan::CT_MIDDLEPANNING: //case dullahan::CT_EASTPANNING: @@ -430,32 +433,33 @@ void MediaPluginCEF::onCursorChangedCallback(dullahan::ECursorType type) //case dullahan::CT_SOUTHEASTPANNING: //case dullahan::CT_SOUTHWESTPANNING: //case dullahan::CT_WESTPANNING: - //case dullahan::CT_MOVE: //case dullahan::CT_VERTICALTEXT: //case dullahan::CT_CELL: //case dullahan::CT_CONTEXTMENU: case dullahan::CT_ALIAS: - name = "tool_media_open"; + name = "UI_CURSOR_TOOLMEDIAOPEN"; break; case dullahan::CT_PROGRESS: - name = "working"; + name = "UI_CURSOR_WORKING"; break; case dullahan::CT_COPY: - name = "arrow_copy"; + name = "UI_CURSOR_ARROWCOPY"; break; case dullahan::CT_NONE: - name = "cursor_no"; + name = "UI_CURSOR_NO"; break; case dullahan::CT_NODROP: case dullahan::CT_NOTALLOWED: - name = "cursor_no_locked"; + name = "UI_CURSOR_NOLOCKED"; break; case dullahan::CT_ZOOMIN: + name = "UI_CURSOR_TOOLZOOMIN"; + break; case dullahan::CT_ZOOMOUT: - name = "tool_zoomin"; + name = "UI_CURSOR_TOOLZOOMOUT"; break; case dullahan::CT_GRAB: - name = "tool_grab"; + name = "UI_CURSOR_TOOLGRAB"; break; //case dullahan::CT_GRABING: //case dullahan::CT_CUSTOM: diff --git a/indra/newview/cursors_mac/UI_CURSOR_SIZEALL.tif b/indra/newview/cursors_mac/UI_CURSOR_SIZEALL.tif new file mode 100644 index 0000000000..85fec76fca Binary files /dev/null and b/indra/newview/cursors_mac/UI_CURSOR_SIZEALL.tif differ diff --git a/indra/newview/cursors_mac/UI_CURSOR_TOOLZOOMOUT.tif b/indra/newview/cursors_mac/UI_CURSOR_TOOLZOOMOUT.tif new file mode 100644 index 0000000000..d64a7f2b68 Binary files /dev/null and b/indra/newview/cursors_mac/UI_CURSOR_TOOLZOOMOUT.tif differ diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 8cf9f4a85c..661a520394 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -3193,58 +3193,7 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CURSOR_CHANGED, new cursor is " << plugin->getCursorName() << LL_ENDL; std::string cursor = plugin->getCursorName(); - - static const std::map cursor_name_to_enum - { - {std::string("arrow"), UI_CURSOR_ARROW}, - {std::string("wait"), UI_CURSOR_WAIT}, - {std::string("hand"), UI_CURSOR_HAND}, - {std::string("ibeam"), UI_CURSOR_IBEAM}, - {std::string("cross"), UI_CURSOR_CROSS}, - {std::string("split_nwse"), UI_CURSOR_SIZENWSE}, - {std::string("split_nesw"), UI_CURSOR_SIZENESW}, - {std::string("split_we"), UI_CURSOR_SIZEWE}, - {std::string("split_ns"), UI_CURSOR_SIZENS}, - {std::string("cursor_no"), UI_CURSOR_NO}, - {std::string("working"), UI_CURSOR_WORKING}, - {std::string("tool_grab"), UI_CURSOR_TOOLGRAB}, - {std::string("tool_land"), UI_CURSOR_TOOLLAND}, - {std::string("tool_focus"), UI_CURSOR_TOOLFOCUS}, - {std::string("tool_create"), UI_CURSOR_TOOLCREATE}, - {std::string("arrow_drag"), UI_CURSOR_ARROWDRAG}, - {std::string("arrow_copy"), UI_CURSOR_ARROWCOPY}, - {std::string("arrow_drag_multi"), UI_CURSOR_ARROWDRAGMULTI}, - {std::string("arrow_copy_multi"), UI_CURSOR_ARROWCOPYMULTI}, - {std::string("cursor_no_locked"), UI_CURSOR_NOLOCKED}, - {std::string("arrow_locked"), UI_CURSOR_ARROWLOCKED}, - {std::string("grab_locked"), UI_CURSOR_GRABLOCKED}, - {std::string("tool_translate"), UI_CURSOR_TOOLTRANSLATE}, - {std::string("tool_rotate"), UI_CURSOR_TOOLROTATE}, - {std::string("tool_scale"), UI_CURSOR_TOOLSCALE}, - {std::string("tool_camera"), UI_CURSOR_TOOLCAMERA}, - {std::string("tool_pan"), UI_CURSOR_TOOLPAN}, - {std::string("tool_zoomin"), UI_CURSOR_TOOLZOOMIN}, - {std::string("tool_pick_object3"), UI_CURSOR_TOOLPICKOBJECT3}, - {std::string("tool_play"), UI_CURSOR_TOOLPLAY}, - {std::string("tool_pause"), UI_CURSOR_TOOLPAUSE}, - {std::string("tool_media_open"), UI_CURSOR_TOOLMEDIAOPEN}, - {std::string("tool_pipette"), UI_CURSOR_PIPETTE}, - {std::string("tool_sit"), UI_CURSOR_TOOLSIT}, - {std::string("tool_buy"), UI_CURSOR_TOOLBUY}, - {std::string("tool_open"), UI_CURSOR_TOOLOPEN}, - {std::string("tool_pathfinding"), UI_CURSOR_TOOLPATHFINDING}, - }; - - std::map::const_iterator iter = cursor_name_to_enum.find(cursor); - if (iter != cursor_name_to_enum.end()) - { - mLastSetCursor = iter->second; - } - else - { - // for anything else, default to the arrow - mLastSetCursor = UI_CURSOR_ARROW; - } + mLastSetCursor = getCursorFromString(cursor); } break; diff --git a/indra/newview/res-sdl/lltoolzoomout.BMP b/indra/newview/res-sdl/lltoolzoomout.BMP index 7f958383ab..5bdf96f80d 100644 Binary files a/indra/newview/res-sdl/lltoolzoomout.BMP and b/indra/newview/res-sdl/lltoolzoomout.BMP differ diff --git a/indra/newview/res-sdl/sizeall.BMP b/indra/newview/res-sdl/sizeall.BMP new file mode 100644 index 0000000000..03d9bf4654 Binary files /dev/null and b/indra/newview/res-sdl/sizeall.BMP differ diff --git a/indra/newview/res/lltoolzoomout.cur b/indra/newview/res/lltoolzoomout.cur index b33e68d1a6..21e0ee9702 100644 Binary files a/indra/newview/res/lltoolzoomout.cur and b/indra/newview/res/lltoolzoomout.cur differ -- cgit v1.2.3 From 250212d614982041ad553428f76733f6ddd4e224 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 29 Apr 2021 00:09:00 +0300 Subject: SL-15183 Crash at LLModel::matchMaterialOrder --- indra/llprimitive/llmodel.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 702a1b5238..1b34068ece 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -1262,6 +1262,14 @@ bool LLModel::matchMaterialOrder(LLModel* ref, int& refFaceCnt, int& modelFaceCn LL_INFOS("MESHSKININFO")<<"Material of model is not a subset of reference."< ref->mMaterialList.size()) + { + LL_INFOS("MESHSKININFO") << "Material of model has more materials than a reference." << LL_ENDL; + // We passed isMaterialListSubset, so materials are a subset, but subset isn't supposed to be + // larger than original and if we keep going, reordering will cause a crash + return false; + } std::map index_map; -- cgit v1.2.3 From e2b08317e8bf612cdb077ece58af188910a58473 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 29 Apr 2021 13:35:28 +0300 Subject: SL-15188 Crash at SecondLifeViewer!LLUUID::isNull(1007) Crash at getNormalID().isNull() --- indra/newview/llface.cpp | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 4a802ad9aa..f1b64a5899 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1074,6 +1074,13 @@ bool LLFace::calcAlignedPlanarTE(const LLFace* align_to, LLVector2* res_st_offs F32 map_rot = 0.f, map_scaleS = 0.f, map_scaleT = 0.f, map_offsS = 0.f, map_offsT = 0.f; + LLMaterial* mat = orig_tep->getMaterialParams(); + if (!mat && map != LLRender::DIFFUSE_MAP) + { + LL_WARNS_ONCE("llface") << "Face is set to use specular or normal map but has no material, defaulting to diffuse" << LL_ENDL; + map = LLRender::DIFFUSE_MAP; + } + switch (map) { case LLRender::DIFFUSE_MAP: @@ -1084,26 +1091,26 @@ bool LLFace::calcAlignedPlanarTE(const LLFace* align_to, LLVector2* res_st_offs map_offsT = orig_tep->mOffsetT; break; case LLRender::NORMAL_MAP: - if (orig_tep->getMaterialParams()->getNormalID().isNull()) + if (mat->getNormalID().isNull()) { return false; } - map_rot = orig_tep->getMaterialParams()->getNormalRotation(); - map_scaleS = orig_tep->getMaterialParams()->getNormalRepeatX(); - map_scaleT = orig_tep->getMaterialParams()->getNormalRepeatY(); - map_offsS = orig_tep->getMaterialParams()->getNormalOffsetX(); - map_offsT = orig_tep->getMaterialParams()->getNormalOffsetY(); + map_rot = mat->getNormalRotation(); + map_scaleS = mat->getNormalRepeatX(); + map_scaleT = mat->getNormalRepeatY(); + map_offsS = mat->getNormalOffsetX(); + map_offsT = mat->getNormalOffsetY(); break; case LLRender::SPECULAR_MAP: - if (orig_tep->getMaterialParams()->getSpecularID().isNull()) + if (mat->getSpecularID().isNull()) { return false; } - map_rot = orig_tep->getMaterialParams()->getSpecularRotation(); - map_scaleS = orig_tep->getMaterialParams()->getSpecularRepeatX(); - map_scaleT = orig_tep->getMaterialParams()->getSpecularRepeatY(); - map_offsS = orig_tep->getMaterialParams()->getSpecularOffsetX(); - map_offsT = orig_tep->getMaterialParams()->getSpecularOffsetY(); + map_rot = mat->getSpecularRotation(); + map_scaleS = mat->getSpecularRepeatX(); + map_scaleT = mat->getSpecularRepeatY(); + map_offsS = mat->getSpecularOffsetX(); + map_offsT = mat->getSpecularOffsetY(); break; default: /*make compiler happy*/ break; -- cgit v1.2.3 From 39503419163aff0cb1cd305de924f4edc68833b0 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 29 Apr 2021 17:37:26 +0300 Subject: SL-15177 Added LLTextureFetchTester to log texture fetching state timers --- indra/llcommon/llmetricperformancetester.cpp | 1 - indra/newview/app_settings/settings.xml | 11 ++ indra/newview/lltexturefetch.cpp | 185 +++++++++++++++++---- indra/newview/lltexturefetch.h | 26 +++ .../default/xui/en/floater_scene_load_stats.xml | 136 ++++++--------- 5 files changed, 242 insertions(+), 117 deletions(-) diff --git a/indra/llcommon/llmetricperformancetester.cpp b/indra/llcommon/llmetricperformancetester.cpp index f8a93baf45..100eb57555 100644 --- a/indra/llcommon/llmetricperformancetester.cpp +++ b/indra/llcommon/llmetricperformancetester.cpp @@ -189,7 +189,6 @@ LLMetricPerformanceTesterBasic::~LLMetricPerformanceTesterBasic() void LLMetricPerformanceTesterBasic::preOutputTestResults(LLSD* sd) { incrementCurrentCount() ; - (*sd)[getCurrentLabelName()]["Name"] = mName ; } void LLMetricPerformanceTesterBasic::postOutputTestResults(LLSD* sd) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 626a3d1ff3..398dc65727 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -12509,6 +12509,17 @@ Value 0 + TextureFetchMinTimeToLog + + Comment + If texture fetching time exceeds this value, texture fetch tester will log info + Persist + 1 + Type + F32 + Value + 2.0 + TextureFetchFakeFailureRate Comment diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index f64db7beb5..e7b756bf4a 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -70,8 +70,12 @@ LLTrace::EventStatHandle > LLTextureFetch::sCacheH LLTrace::SampleStatHandle LLTextureFetch::sCacheReadLatency("texture_cache_read_latency"); LLTrace::SampleStatHandle LLTextureFetch::sTexDecodeLatency("texture_decode_latency"); +LLTrace::SampleStatHandle LLTextureFetch::sCacheWriteLatency("texture_write_latency"); LLTrace::SampleStatHandle LLTextureFetch::sTexFetchLatency("texture_fetch_latency"); +LLTextureFetchTester* LLTextureFetch::sTesterp = NULL ; +const std::string sTesterName("TextureFetchTester"); + ////////////////////////////////////////////////////////////////////////////// // // Introduction @@ -438,6 +442,29 @@ public: // Threads: Ttf virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); + enum e_state // mState + { + // *NOTE: Do not change the order/value of state variables, some code + // depends upon specific ordering/adjacency. + + // NOTE: Affects LLTextureBar::draw in lltextureview.cpp (debug hack) + INVALID = 0, + INIT, + LOAD_FROM_TEXTURE_CACHE, + CACHE_POST, + LOAD_FROM_NETWORK, + LOAD_FROM_SIMULATOR, + WAIT_HTTP_RESOURCE, // Waiting for HTTP resources + WAIT_HTTP_RESOURCE2, // Waiting for HTTP resources + SEND_HTTP_REQ, // Commit to sending as HTTP + WAIT_HTTP_REQ, // Request sent, wait for completion + DECODE_IMAGE, + DECODE_IMAGE_UPDATE, + WRITE_TO_CACHE, + WAIT_ON_WRITE, + DONE + }; + protected: LLTextureFetchWorker(LLTextureFetch* fetcher, FTType f_type, const std::string& url, const LLUUID& id, const LLHost& host, @@ -517,28 +544,6 @@ private: } private: - enum e_state // mState - { - // *NOTE: Do not change the order/value of state variables, some code - // depends upon specific ordering/adjacency. - - // NOTE: Affects LLTextureBar::draw in lltextureview.cpp (debug hack) - INVALID = 0, - INIT, - LOAD_FROM_TEXTURE_CACHE, - CACHE_POST, - LOAD_FROM_NETWORK, - LOAD_FROM_SIMULATOR, - WAIT_HTTP_RESOURCE, // Waiting for HTTP resources - WAIT_HTTP_RESOURCE2, // Waiting for HTTP resources - SEND_HTTP_REQ, // Commit to sending as HTTP - WAIT_HTTP_REQ, // Request sent, wait for completion - DECODE_IMAGE, - DECODE_IMAGE_UPDATE, - WRITE_TO_CACHE, - WAIT_ON_WRITE, - DONE - }; enum e_request_state // mSentRequest { UNSENT = 0, @@ -551,7 +556,7 @@ private: CAN_WRITE = 1, SHOULD_WRITE = 2 }; - static const char* sStateDescs[]; + e_state mState; void setState(e_state new_state); @@ -579,10 +584,15 @@ private: LLFrameTimer mFetchDeltaTimer; LLTimer mCacheReadTimer; LLTimer mDecodeTimer; + LLTimer mCacheWriteTimer; LLTimer mFetchTimer; + LLTimer mStateTimer; F32 mCacheReadTime; // time for cache read only F32 mDecodeTime; // time for decode only + F32 mCacheWriteTime; F32 mFetchTime; // total time from req to finished fetch + std::map mStateTimersMap; + F32 mSkippedStatesTime; LLTextureCache::handle_t mCacheReadHandle, mCacheWriteHandle; S32 mRequestedSize, @@ -866,8 +876,7 @@ bool truncate_viewer_metrics(int max_regions, LLSD & metrics); ////////////////////////////////////////////////////////////////////////////// -//static -const char* LLTextureFetchWorker::sStateDescs[] = { +const char* sStateDescs[] = { "INVALID", "INIT", "LOAD_FROM_TEXTURE_CACHE", @@ -885,6 +894,9 @@ const char* LLTextureFetchWorker::sStateDescs[] = { "DONE" }; +const std::set LOGGED_STATES = { LLTextureFetchWorker::LOAD_FROM_TEXTURE_CACHE, LLTextureFetchWorker::LOAD_FROM_NETWORK, LLTextureFetchWorker::LOAD_FROM_SIMULATOR, + LLTextureFetchWorker::WAIT_HTTP_REQ, LLTextureFetchWorker::DECODE_IMAGE_UPDATE, LLTextureFetchWorker::WAIT_ON_WRITE }; + // static volatile bool LLTextureFetch::svMetricsDataBreak(true); // Start with a data break @@ -916,6 +928,7 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mLoadedDiscard(-1), mDecodedDiscard(-1), mCacheReadTime(0.f), + mCacheWriteTime(0.f), mDecodeTime(0.f), mFetchTime(0.f), mCacheReadHandle(LLTextureCache::nullHandle()), @@ -924,6 +937,7 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mRequestedOffset(0), mDesiredSize(TEXTURE_CACHE_ENTRY_SIZE), mFileSize(0), + mSkippedStatesTime(0), mCachedSize(0), mLoaded(FALSE), mSentRequest(UNSENT), @@ -1184,6 +1198,13 @@ bool LLTextureFetchWorker::doWork(S32 param) if (mState == INIT) { + mStateTimer.reset(); + mFetchTimer.reset(); + for(auto i : LOGGED_STATES) + { + mStateTimersMap[i] = 0; + } + mSkippedStatesTime = 0; mRawImage = NULL ; mRequestedDiscard = -1; mLoadedDiscard = -1; @@ -1241,9 +1262,10 @@ bool LLTextureFetchWorker::doWork(S32 param) ++mCacheReadCount; std::string filename = mUrl.substr(7, std::string::npos); CacheReadResponder* responder = new CacheReadResponder(mFetcher, mID, mFormattedImage); + mCacheReadTimer.reset(); mCacheReadHandle = mFetcher->mTextureCache->readFromCache(filename, mID, cache_priority, offset, size, responder); - mCacheReadTimer.reset(); + } else if ((mUrl.empty() || mFTType==FTT_SERVER_BAKE) && mFetcher->canLoadFromCache()) { @@ -1251,9 +1273,9 @@ bool LLTextureFetchWorker::doWork(S32 param) ++mCacheReadCount; CacheReadResponder* responder = new CacheReadResponder(mFetcher, mID, mFormattedImage); - mCacheReadHandle = mFetcher->mTextureCache->readFromCache(mID, cache_priority, - offset, size, responder); mCacheReadTimer.reset(); + mCacheReadHandle = mFetcher->mTextureCache->readFromCache(mID, cache_priority, + offset, size, responder);; } else if(!mUrl.empty() && mCanUseHTTP) { @@ -1275,6 +1297,7 @@ bool LLTextureFetchWorker::doWork(S32 param) mCacheReadHandle = LLTextureCache::nullHandle(); setState(CACHE_POST); add(LLTextureFetch::sCacheHit, 1.0); + mCacheReadTime = mCacheReadTimer.getElapsedTimeF32(); // fall through } else @@ -1888,7 +1911,7 @@ bool LLTextureFetchWorker::doWork(S32 param) LL_DEBUGS(LOG_TXT) << mID << " DECODE_IMAGE abort: mLoadedDiscard < 0" << LL_ENDL; return true; } - + mDecodeTimer.reset(); mRawImage = NULL; mAuxImage = NULL; llassert_always(mFormattedImage.notNull()); @@ -1982,6 +2005,7 @@ bool LLTextureFetchWorker::doWork(S32 param) // be protected by work mutex and won't be safe to use here nor in cache worker. // So make sure users of getRequestFinished() does not attempt to modify image while // fetcher is working + mCacheWriteTimer.reset(); mCacheWriteHandle = mFetcher->mTextureCache->writeToCache(mID, cache_priority, mFormattedImage->getData(), datasize, mFileSize, mRawImage, mDecodedDiscard, responder); @@ -1992,6 +2016,7 @@ bool LLTextureFetchWorker::doWork(S32 param) { if (writeToCacheComplete()) { + mCacheWriteTime = mCacheWriteTimer.getElapsedTimeF32(); setState(DONE); // fall through } @@ -2500,7 +2525,6 @@ void LLTextureFetchWorker::callbackDecoded(bool success, LLImageRaw* raw, LLImag mDecoded = TRUE; // LL_INFOS(LOG_TXT) << mID << " : DECODE COMPLETE " << LL_ENDL; setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); - mCacheReadTime = mCacheReadTimer.getElapsedTimeF32(); } // -Mw ////////////////////////////////////////////////////////////////////////////// @@ -2625,6 +2649,17 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image } mOriginFetchSource = mFetchSource; } + + // If that test log has ben requested but not yet created, create it + if (LLMetricPerformanceTesterBasic::isMetricLogRequested(sTesterName) && !LLMetricPerformanceTesterBasic::getTester(sTesterName)) + { + sTesterp = new LLTextureFetchTester() ; + if (!sTesterp->isValid()) + { + delete sTesterp; + sTesterp = NULL; + } + } } LLTextureFetch::~LLTextureFetch() @@ -2966,20 +3001,51 @@ bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level, } else if (worker->checkWork()) { + F32 decode_time; + F32 fetch_time; + F32 cache_read_time; + F32 cache_write_time; + S32 file_size; + std::map logged_state_timers; + F32 skipped_states_time; worker->lockWorkMutex(); // +Mw last_http_get_status = worker->mGetStatus; discard_level = worker->mDecodedDiscard; raw = worker->mRawImage; aux = worker->mAuxImage; - sample(sTexDecodeLatency, worker->mDecodeTime); - sample(sTexFetchLatency, worker->mFetchTime); - sample(sCacheReadLatency, worker->mCacheReadTime); + + decode_time = worker->mDecodeTime; + fetch_time = worker->mFetchTime; + cache_read_time = worker->mCacheReadTime; + cache_write_time = worker->mCacheWriteTime; + file_size = worker->mFileSize; worker->mCacheReadTimer.reset(); worker->mDecodeTimer.reset(); + worker->mCacheWriteTimer.reset(); worker->mFetchTimer.reset(); + logged_state_timers = worker->mStateTimersMap; + skipped_states_time = worker->mSkippedStatesTime; + worker->mStateTimer.reset(); res = true; LL_DEBUGS(LOG_TXT) << id << ": Request Finished. State: " << worker->mState << " Discard: " << discard_level << LL_ENDL; worker->unlockWorkMutex(); // -Mw + + sample(sTexDecodeLatency, decode_time); + sample(sTexFetchLatency, fetch_time); + sample(sCacheReadLatency, cache_read_time); + sample(sCacheWriteLatency, cache_write_time); + + static LLCachedControl min_time_to_log(gSavedSettings, "TextureFetchMinTimeToLog", 2.f); + if (fetch_time > min_time_to_log) + { + //LL_INFOS() << "fetch_time: " << fetch_time << " cache_read_time: " << cache_read_time << " decode_time: " << decode_time << " cache_write_time: " << cache_write_time << LL_ENDL; + + LLTextureFetchTester* tester = (LLTextureFetchTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName); + if (tester) + { + tester->updateStats(logged_state_timers, fetch_time, skipped_states_time, file_size) ; + } + } } else { @@ -3464,6 +3530,21 @@ void LLTextureFetchWorker::setState(e_state new_state) // LL_INFOS(LOG_TXT) << "id: " << mID << " FTType: " << mFTType << " disc: " << mDesiredDiscard << " sz: " << mDesiredSize << " state: " << e_state_name[mState] << " => " << e_state_name[new_state] << LL_ENDL; } + + F32 d_time = mStateTimer.getElapsedTimeF32(); + if (d_time >= 0.0001F) + { + if (LOGGED_STATES.count(mState)) + { + mStateTimersMap[mState] = d_time; + } + else + { + mSkippedStatesTime += d_time; + } + } + + mStateTimer.reset(); mState = new_state; } @@ -3679,7 +3760,7 @@ void LLTextureFetch::dump() LLTextureFetchWorker* worker = (LLTextureFetchWorker*)wreq->getWorkerClass(); LL_INFOS(LOG_TXT) << " ID: " << worker->mID << " PRI: " << llformat("0x%08x",wreq->getPriority()) - << " STATE: " << worker->sStateDescs[worker->mState] + << " STATE: " << sStateDescs[worker->mState] << LL_ENDL; } @@ -5121,4 +5202,40 @@ void LLTextureFetchDebugger::callbackHTTP(FetchEntry & fetch, LLCore::HttpRespon //End LLTextureFetchDebugger /////////////////////////////////////////////////////////////////////////////////////////// +LLTextureFetchTester::LLTextureFetchTester() : LLMetricPerformanceTesterBasic(sTesterName) +{ + mTextureFetchTime = 0; + mSkippedStatesTime = 0; + mFileSize = 0; +} + +LLTextureFetchTester::~LLTextureFetchTester() +{ + outputTestResults(); + LLTextureFetch::sTesterp = NULL; +} + +//virtual +void LLTextureFetchTester::outputTestRecord(LLSD *sd) +{ + std::string currentLabel = getCurrentLabelName(); + + (*sd)[currentLabel]["Texture Fetch Time"] = (LLSD::Real)mTextureFetchTime; + (*sd)[currentLabel]["File Size"] = (LLSD::Integer)mFileSize; + (*sd)[currentLabel]["Skipped States Time"] = (LLSD::String)llformat("%.6f", mSkippedStatesTime); + + for(auto i : LOGGED_STATES) + { + (*sd)[currentLabel][sStateDescs[i]] = mStateTimersMap[i]; + } +} + +void LLTextureFetchTester::updateStats(const std::map state_timers, const F32 fetch_time, const F32 skipped_states_time, const S32 file_size) +{ + mTextureFetchTime = fetch_time; + mStateTimersMap = state_timers; + mFileSize = file_size; + mSkippedStatesTime = skipped_states_time; + outputTestResults(); +} diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 2aa194e141..bf6732963f 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -50,6 +50,7 @@ class LLHost; class LLViewerAssetStats; class LLTextureFetchDebugger; class LLTextureCache; +class LLTextureFetchTester; // Interface class @@ -312,6 +313,7 @@ public: static LLTrace::CountStatHandle sCacheAttempt; static LLTrace::SampleStatHandle sCacheReadLatency; static LLTrace::SampleStatHandle sTexDecodeLatency; + static LLTrace::SampleStatHandle sCacheWriteLatency; static LLTrace::SampleStatHandle sTexFetchLatency; static LLTrace::EventStatHandle > sCacheHitRate; @@ -403,6 +405,9 @@ public: FROM_HTTP_ONLY, INVALID_SOURCE }; + + static LLTextureFetchTester* sTesterp; + private: //debug use LLTextureFetchDebugger* mFetchDebugger; @@ -635,5 +640,26 @@ private: public: static bool isEnabled() {return sDebuggerEnabled;} }; + + +class LLTextureFetchTester : public LLMetricPerformanceTesterBasic +{ +public: + LLTextureFetchTester(); + ~LLTextureFetchTester(); + + void updateStats(const std::map states_timers, const F32 fetch_time, const F32 other_states_time, const S32 file_size); + +protected: + /*virtual*/ void outputTestRecord(LLSD* sd); + +private: + + F32 mTextureFetchTime; + F32 mSkippedStatesTime; + S32 mFileSize; + + std::map mStateTimersMap; +}; #endif // LL_LLTEXTUREFETCH_H diff --git a/indra/newview/skins/default/xui/en/floater_scene_load_stats.xml b/indra/newview/skins/default/xui/en/floater_scene_load_stats.xml index 62cce3a1e3..eb68b0e390 100644 --- a/indra/newview/skins/default/xui/en/floater_scene_load_stats.xml +++ b/indra/newview/skins/default/xui/en/floater_scene_load_stats.xml @@ -36,16 +36,14 @@ stat="FramePixelDifference" bar_max="100" tick_spacing="10" - unit_scale="100" - precision="0"/> + unit_scale="100"/> + tick_spacing="500"/> + show_bar="false"/> + + + + show_bar="false"/> + show_bar="false"/> + show_bar="false"/> + show_bar="false"/> + show_bar="false"/> + show_bar="false"/> + show_bar="false"/> + show_bar="false"/> @@ -303,81 +301,65 @@ orientation="horizontal" stat="simframemsec" unit_label="ms" - precision="3" bar_max="40.f" tick_spacing="10.f" - show_bar="false" - show_mean="false"/> + show_bar="false"/> + show_bar="false"/> + show_bar="false"/> + show_bar="false"/> + show_bar="false"/> + show_bar="false"/> + show_bar="false"/> + show_bar="false"/> + show_bar="false"/> + show_bar="false"/> + show_bar="false"/> + show_bar="false"/> + show_bar="false"/> -- cgit v1.2.3 From c8977fd904df10f225915ac5527d279440356257 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 29 Apr 2021 17:38:15 +0300 Subject: SL-15177 Fix the way of counting for gTextureTimer --- indra/newview/app_settings/settings.xml | 11 ++++++++ indra/newview/llappviewer.cpp | 4 +++ indra/newview/llfloatertexturefetchdebugger.cpp | 8 ++++++ indra/newview/llfloatertexturefetchdebugger.h | 1 + indra/newview/llviewerstats.cpp | 23 ++++++++++------- indra/newview/llviewerstats.h | 1 + indra/newview/llviewertexture.h | 1 + indra/newview/llviewertexturelist.cpp | 30 ++++++++++++++++++++++ indra/newview/llviewertexturelist.h | 2 ++ .../default/xui/en/floater_scene_load_stats.xml | 9 +++++++ .../xui/en/floater_texture_fetch_debugger.xml | 12 +++++++++ 11 files changed, 93 insertions(+), 9 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 398dc65727..5502b3db55 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -12608,6 +12608,17 @@ Value 32 + TextureListFetchingThreshold + + Comment + If the ratio between fetched and all textures in the list is greater than this threshold, which we assume that almost all textures are fetched + Persist + 1 + Type + F32 + Value + 0.97 + TextureLoadFullRes Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 5a64f5e01c..1ffb3777cb 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4856,6 +4856,10 @@ void LLAppViewer::idle() // // Special case idle if still starting up // + if (LLStartUp::getStartupState() >= STATE_WORLD_INIT) + { + update_texture_time(); + } if (LLStartUp::getStartupState() < STATE_STARTED) { // Skip rest if idle startup returns false (essentially, no world yet) diff --git a/indra/newview/llfloatertexturefetchdebugger.cpp b/indra/newview/llfloatertexturefetchdebugger.cpp index 9a23d99802..cda4dc8bcc 100644 --- a/indra/newview/llfloatertexturefetchdebugger.cpp +++ b/indra/newview/llfloatertexturefetchdebugger.cpp @@ -38,6 +38,7 @@ #include "llappviewer.h" #include "lltexturefetch.h" #include "llviewercontrol.h" +#include "llviewerassetstats.h" //gTextureTimer LLFloaterTextureFetchDebugger::LLFloaterTextureFetchDebugger(const LLSD& key) : LLFloater(key), @@ -50,6 +51,7 @@ LLFloaterTextureFetchDebugger::LLFloaterTextureFetchDebugger(const LLSD& key) mCommitCallbackRegistrar.add("TexFetchDebugger.Start", boost::bind(&LLFloaterTextureFetchDebugger::onClickStart, this)); mCommitCallbackRegistrar.add("TexFetchDebugger.Clear", boost::bind(&LLFloaterTextureFetchDebugger::onClickClear, this)); mCommitCallbackRegistrar.add("TexFetchDebugger.Close", boost::bind(&LLFloaterTextureFetchDebugger::onClickClose, this)); + mCommitCallbackRegistrar.add("TexFetchDebugger.ResetFetchTime", boost::bind(&LLFloaterTextureFetchDebugger::onClickResetFetchTime, this)); mCommitCallbackRegistrar.add("TexFetchDebugger.CacheRead", boost::bind(&LLFloaterTextureFetchDebugger::onClickCacheRead, this)); mCommitCallbackRegistrar.add("TexFetchDebugger.CacheWrite", boost::bind(&LLFloaterTextureFetchDebugger::onClickCacheWrite, this)); @@ -228,6 +230,12 @@ void LLFloaterTextureFetchDebugger::onClickClose() delete this; } +void LLFloaterTextureFetchDebugger::onClickResetFetchTime() +{ + gTextureTimer.start(); + gTextureTimer.pause(); +} + void LLFloaterTextureFetchDebugger::onClickClear() { mButtonStateMap["start_btn"] = true; diff --git a/indra/newview/llfloatertexturefetchdebugger.h b/indra/newview/llfloatertexturefetchdebugger.h index 096ad88e07..637f3b03e5 100644 --- a/indra/newview/llfloatertexturefetchdebugger.h +++ b/indra/newview/llfloatertexturefetchdebugger.h @@ -44,6 +44,7 @@ public: void onClickStart(); void onClickClear(); void onClickClose(); + void onClickResetFetchTime(); void onClickCacheRead(); void onClickCacheWrite(); diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 05f88b0a75..0380bb47fc 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -206,6 +206,7 @@ LLTrace::EventStatHandle AVATAR_EDIT_TIME("avataredittime", "Second LLTrace::EventStatHandle > OBJECT_CACHE_HIT_RATE("object_cache_hits"); +LLTrace::EventStatHandle TEXTURE_FETCH_TIME("texture_fetch_time"); } LLViewerStats::LLViewerStats() @@ -387,15 +388,6 @@ void update_statistics() add(LLStatViewer::ASSET_UDP_DATA_RECEIVED, F64Bits(gTransferManager.getTransferBitsIn(LLTCT_ASSET))); gTransferManager.resetTransferBitsIn(LLTCT_ASSET); - if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) - { - gTextureTimer.pause(); - } - else - { - gTextureTimer.unpause(); - } - sample(LLStatViewer::VISIBLE_AVATARS, LLVOAvatar::sNumVisibleAvatars); LLWorld::getInstance()->updateNetStats(); LLWorld::getInstance()->requestCacheMisses(); @@ -417,6 +409,19 @@ void update_statistics() } } +void update_texture_time() +{ + if (gTextureList.isPrioRequestsFetched()) + { + gTextureTimer.pause(); + } + else + { + gTextureTimer.unpause(); + } + + record(LLStatViewer::TEXTURE_FETCH_TIME, gTextureTimer.getElapsedTimeF32()); +} /* * The sim-side LLSD is in newsim/llagentinfo.cpp:forwardViewerStats. * diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index 04870e0c26..64b4628daa 100644 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -295,6 +295,7 @@ static const F32 SEND_STATS_PERIOD = 300.0f; // The following are from (older?) statistics code found in appviewer. void update_statistics(); void send_viewer_stats(bool include_preferences); +void update_texture_time(); extern LLFrameTimer gTextureTimer; extern U32Bytes gTotalTextureData; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 69568cc825..7b4b3d940f 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -415,6 +415,7 @@ public: BOOL isFullyLoaded() const; BOOL hasFetcher() const { return mHasFetcher;} + bool isFetching() const { return mIsFetching;} void setCanUseHTTP(bool can_use_http) {mCanUseHTTP = can_use_http;} void forceToDeleteRequest(); diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 561319ca5d..82973d3278 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -205,6 +205,9 @@ static std::string get_texture_list_name() void LLViewerTextureList::doPrefetchImages() { + gTextureTimer.start(); + gTextureTimer.pause(); + if (LLAppViewer::instance()->getPurgeCache()) { // cache was purged, no point @@ -1402,6 +1405,33 @@ S32Megabytes LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended, fl return max_texmem; } +bool LLViewerTextureList::isPrioRequestsFetched() +{ + static LLCachedControl prio_threshold(gSavedSettings, "TextureFetchUpdatePriorityThreshold", 0.0f); + static LLCachedControl fetching_textures_threshold(gSavedSettings, "TextureListFetchingThreshold", 0.97f); + S32 fetching_tex_count = 0; + S32 tex_count_threshold = gTextureList.mImageList.size() * (1 - fetching_textures_threshold); + + for (LLViewerTextureList::image_priority_list_t::iterator iter = gTextureList.mImageList.begin(); + iter != gTextureList.mImageList.end(); ) + { + LLPointer imagep = *iter++; + if (imagep->getDecodePriority() > prio_threshold) + { + if (imagep->hasFetcher() || imagep->isFetching()) + { + fetching_tex_count++; + if (fetching_tex_count >= tex_count_threshold) + { + return false; + } + } + } + } + + return true; +} + const S32Megabytes VIDEO_CARD_FRAMEBUFFER_MEM(12); const S32Megabytes MIN_MEM_FOR_NON_TEXTURE(512); void LLViewerTextureList::updateMaxResidentTexMem(S32Megabytes mem) diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index 281d23c671..fead2e52b2 100644 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -138,6 +138,8 @@ public: static S32Megabytes getMinVideoRamSetting(); static S32Megabytes getMaxVideoRamSetting(bool get_recommended, float mem_multiplier); + + static bool isPrioRequestsFetched(); private: void updateImagesDecodePriorities(); diff --git a/indra/newview/skins/default/xui/en/floater_scene_load_stats.xml b/indra/newview/skins/default/xui/en/floater_scene_load_stats.xml index eb68b0e390..3f493192ff 100644 --- a/indra/newview/skins/default/xui/en/floater_scene_load_stats.xml +++ b/indra/newview/skins/default/xui/en/floater_scene_load_stats.xml @@ -137,6 +137,15 @@ tick_spacing="100" show_history="true" show_bar="false"/> + +